diff --git a/Nodejs/index.js b/Nodejs/index.js
new file mode 100644
index 0000000..6d86ffb
--- /dev/null
+++ b/Nodejs/index.js
@@ -0,0 +1,47 @@
+const fs = require("fs");
+const login = require("facebook-chat-api");
+const readline = require("readline");
+const readlineSync = require('readline-sync');
+
+var email = readlineSync.question('Please enter your email or phone: ');
+var password = readlineSync.question('Please enter your password: ');
+
+var rl = readline.createInterface({
+ input: process.stdin,
+ output: process.stdout
+});
+
+const obj = {email, password};
+login(obj, (err, api) => {
+ if(err) {
+ switch (err.error) {
+ case 'login-approval':
+ console.log('Enter code > ');
+ rl.on('line', (line) => {
+ err.continue(line);
+ rl.close();
+ });
+ break;
+ default:
+ console.error(err);
+ }
+ return;
+ }
+ console.log("get thread list...");
+ api.getThreadList(1000, null, [], (err, list) => {
+ if (err) throw err;
+ if (list) {
+ console.log("sort...");
+ list.sort(function(a, b) {
+ return a.messageCount - b.messageCount;
+ })
+ console.log("write...");
+ list.forEach(function(value, i) {
+ fs.appendFile('output.txt', (i + 1).toString() + "\t" + value.name + "\t" + value.threadID + "\t" + value.messageCount, (err) => {
+ if (err) throw err;
+ })
+ });
+ console.log("done!");
+ }
+ });
+});
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/escodegen b/Nodejs/node_modules/.bin/escodegen
new file mode 120000
index 0000000..01a7c32
--- /dev/null
+++ b/Nodejs/node_modules/.bin/escodegen
@@ -0,0 +1 @@
+../escodegen/bin/escodegen.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/esgenerate b/Nodejs/node_modules/.bin/esgenerate
new file mode 120000
index 0000000..7d0293e
--- /dev/null
+++ b/Nodejs/node_modules/.bin/esgenerate
@@ -0,0 +1 @@
+../escodegen/bin/esgenerate.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/esparse b/Nodejs/node_modules/.bin/esparse
new file mode 120000
index 0000000..7423b18
--- /dev/null
+++ b/Nodejs/node_modules/.bin/esparse
@@ -0,0 +1 @@
+../esprima/bin/esparse.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/esvalidate b/Nodejs/node_modules/.bin/esvalidate
new file mode 120000
index 0000000..16069ef
--- /dev/null
+++ b/Nodejs/node_modules/.bin/esvalidate
@@ -0,0 +1 @@
+../esprima/bin/esvalidate.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/mkdirp b/Nodejs/node_modules/.bin/mkdirp
new file mode 120000
index 0000000..017896c
--- /dev/null
+++ b/Nodejs/node_modules/.bin/mkdirp
@@ -0,0 +1 @@
+../mkdirp/bin/cmd.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/mqtt b/Nodejs/node_modules/.bin/mqtt
new file mode 120000
index 0000000..ef8b2cf
--- /dev/null
+++ b/Nodejs/node_modules/.bin/mqtt
@@ -0,0 +1 @@
+../mqtt/mqtt.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/mqtt_pub b/Nodejs/node_modules/.bin/mqtt_pub
new file mode 120000
index 0000000..00e8277
--- /dev/null
+++ b/Nodejs/node_modules/.bin/mqtt_pub
@@ -0,0 +1 @@
+../mqtt/bin/pub.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/mqtt_sub b/Nodejs/node_modules/.bin/mqtt_sub
new file mode 120000
index 0000000..2056adc
--- /dev/null
+++ b/Nodejs/node_modules/.bin/mqtt_sub
@@ -0,0 +1 @@
+../mqtt/bin/sub.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/parser b/Nodejs/node_modules/.bin/parser
new file mode 120000
index 0000000..ce7bf97
--- /dev/null
+++ b/Nodejs/node_modules/.bin/parser
@@ -0,0 +1 @@
+../@babel/parser/bin/babel-parser.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/pkg b/Nodejs/node_modules/.bin/pkg
new file mode 120000
index 0000000..3f6f032
--- /dev/null
+++ b/Nodejs/node_modules/.bin/pkg
@@ -0,0 +1 @@
+../pkg/lib-es5/bin.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/pkg-fetch b/Nodejs/node_modules/.bin/pkg-fetch
new file mode 120000
index 0000000..6418e5d
--- /dev/null
+++ b/Nodejs/node_modules/.bin/pkg-fetch
@@ -0,0 +1 @@
+../pkg-fetch/lib-es5/bin.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/semver b/Nodejs/node_modules/.bin/semver
new file mode 120000
index 0000000..5aaadf4
--- /dev/null
+++ b/Nodejs/node_modules/.bin/semver
@@ -0,0 +1 @@
+../semver/bin/semver.js
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/sshpk-conv b/Nodejs/node_modules/.bin/sshpk-conv
new file mode 120000
index 0000000..a2a295c
--- /dev/null
+++ b/Nodejs/node_modules/.bin/sshpk-conv
@@ -0,0 +1 @@
+../sshpk/bin/sshpk-conv
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/sshpk-sign b/Nodejs/node_modules/.bin/sshpk-sign
new file mode 120000
index 0000000..766b9b3
--- /dev/null
+++ b/Nodejs/node_modules/.bin/sshpk-sign
@@ -0,0 +1 @@
+../sshpk/bin/sshpk-sign
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/sshpk-verify b/Nodejs/node_modules/.bin/sshpk-verify
new file mode 120000
index 0000000..bfd7e3a
--- /dev/null
+++ b/Nodejs/node_modules/.bin/sshpk-verify
@@ -0,0 +1 @@
+../sshpk/bin/sshpk-verify
\ No newline at end of file
diff --git a/Nodejs/node_modules/.bin/uuid b/Nodejs/node_modules/.bin/uuid
new file mode 120000
index 0000000..b3e45bc
--- /dev/null
+++ b/Nodejs/node_modules/.bin/uuid
@@ -0,0 +1 @@
+../uuid/bin/uuid
\ No newline at end of file
diff --git a/Nodejs/node_modules/@babel/parser/CHANGELOG.md b/Nodejs/node_modules/@babel/parser/CHANGELOG.md
new file mode 100644
index 0000000..8a43406
--- /dev/null
+++ b/Nodejs/node_modules/@babel/parser/CHANGELOG.md
@@ -0,0 +1,1073 @@
+# Changelog
+
+> **Tags:**
+> - :boom: [Breaking Change]
+> - :eyeglasses: [Spec Compliance]
+> - :rocket: [New Feature]
+> - :bug: [Bug Fix]
+> - :memo: [Documentation]
+> - :house: [Internal]
+> - :nail_care: [Polish]
+
+> Semver Policy: https://github.com/babel/babel/tree/master/packages/babel-parser#semver
+
+_Note: Gaps between patch versions are faulty, broken or test releases._
+
+See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md) for the pre-6.8.0 version Changelog.
+
+## 6.17.1 (2017-05-10)
+
+### :bug: Bug Fix
+ * Fix typo in flow spread operator error (Brian Ng)
+ * Fixed invalid number literal parsing ([#473](https://github.com/babel/babylon/pull/473)) (Alex Kuzmenko)
+ * Fix number parser ([#433](https://github.com/babel/babylon/pull/433)) (Alex Kuzmenko)
+ * Ensure non pattern shorthand props are checked for reserved words ([#479](https://github.com/babel/babylon/pull/479)) (Brian Ng)
+ * Remove jsx context when parsing arrow functions ([#475](https://github.com/babel/babylon/pull/475)) (Brian Ng)
+ * Allow super in class properties ([#499](https://github.com/babel/babylon/pull/499)) (Brian Ng)
+ * Allow flow class field to be named constructor ([#510](https://github.com/babel/babylon/pull/510)) (Brian Ng)
+
+## 6.17.0 (2017-04-20)
+
+### :bug: Bug Fix
+ * Cherry-pick #418 to 6.x ([#476](https://github.com/babel/babylon/pull/476)) (Sebastian McKenzie)
+ * Add support for invalid escapes in tagged templates ([#274](https://github.com/babel/babylon/pull/274)) (Kevin Gibbons)
+ * Throw error if new.target is used outside of a function ([#402](https://github.com/babel/babylon/pull/402)) (Brian Ng)
+ * Fix parsing of class properties ([#351](https://github.com/babel/babylon/pull/351)) (Kevin Gibbons)
+ * Fix parsing yield with dynamicImport ([#383](https://github.com/babel/babylon/pull/383)) (Brian Ng)
+ * Ensure consistent start args for parseParenItem ([#386](https://github.com/babel/babylon/pull/386)) (Brian Ng)
+
+## 7.0.0-beta.8 (2017-04-04)
+
+### New Feature
+* Add support for flow type spread (#418) (Conrad Buck)
+* Allow statics in flow interfaces (#427) (Brian Ng)
+
+### Bug Fix
+* Fix predicate attachment to match flow parser (#428) (Brian Ng)
+* Add extra.raw back to JSXText and JSXAttribute (#344) (Alex Rattray)
+* Fix rest parameters with array and objects (#424) (Brian Ng)
+* Fix number parser (#433) (Alex Kuzmenko)
+
+### Docs
+* Fix CONTRIBUTING.md [skip ci] (#432) (Alex Kuzmenko)
+
+### Internal
+* Use babel-register script when running babel smoke tests (#442) (Brian Ng)
+
+## 7.0.0-beta.7 (2017-03-22)
+
+### Spec Compliance
+* Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu)
+
+### Bug Fix
+
+* Fix push-pop logic in flow (#405) (Daniel Tschinder)
+
+## 7.0.0-beta.6 (2017-03-21)
+
+### New Feature
+* Add support for invalid escapes in tagged templates (#274) (Kevin Gibbons)
+
+### Polish
+* Improves error message when super is called outside of constructor (#408) (Arshabh Kumar Agarwal)
+
+### Docs
+
+* [7.0] Moved value field in spec from ObjectMember to ObjectProperty as ObjectMethod's don't have it (#415) [skip ci] (James Browning)
+
+## 7.0.0-beta.5 (2017-03-21)
+
+### Bug Fix
+* Throw error if new.target is used outside of a function (#402) (Brian Ng)
+* Fix parsing of class properties (#351) (Kevin Gibbons)
+
+### Other
+ * Test runner: Detect extra property in 'actual' but not in 'expected'. (#407) (Andy)
+ * Optimize travis builds (#419) (Daniel Tschinder)
+ * Update codecov to 2.0 (#412) (Daniel Tschinder)
+ * Fix spec for ClassMethod: It doesn't have a function, it *is* a function. (#406) [skip ci] (Andy)
+ * Changed Non-existent RestPattern to RestElement which is what is actually parsed (#409) [skip ci] (James Browning)
+ * Upgrade flow to 0.41 (Daniel Tschinder)
+ * Fix watch command (#403) (Brian Ng)
+ * Update yarn lock (Daniel Tschinder)
+ * Fix watch command (#403) (Brian Ng)
+ * chore(package): update flow-bin to version 0.41.0 (#395) (greenkeeper[bot])
+ * Add estree test for correct order of directives (Daniel Tschinder)
+ * Add DoExpression to spec (#364) (Alex Kuzmenko)
+ * Mention cloning of repository in CONTRIBUTING.md (#391) [skip ci] (Sumedh Nimkarde)
+ * Explain how to run only one test (#389) [skip ci] (Aaron Ang)
+
+ ## 7.0.0-beta.4 (2017-03-01)
+
+* Don't consume async when checking for async func decl (#377) (Brian Ng)
+* add `ranges` option [skip ci] (Henry Zhu)
+* Don't parse class properties without initializers when classProperties is disabled and Flow is enabled (#300) (Andrew Levine)
+
+## 7.0.0-beta.3 (2017-02-28)
+
+- [7.0] Change RestProperty/SpreadProperty to RestElement/SpreadElement (#384)
+- Merge changes from 6.x
+
+## 7.0.0-beta.2 (2017-02-20)
+
+- estree: correctly change literals in all cases (#368) (Daniel Tschinder)
+
+## 7.0.0-beta.1 (2017-02-20)
+
+- Fix negative number literal typeannotations (#366) (Daniel Tschinder)
+- Update contributing with more test info [skip ci] (#355) (Brian Ng)
+
+## 7.0.0-beta.0 (2017-02-15)
+
+- Reintroduce Variance node (#333) (Daniel Tschinder)
+- Rename NumericLiteralTypeAnnotation to NumberLiteralTypeAnnotation (#332) (Charles Pick)
+- [7.0] Remove ForAwaitStatement, add await flag to ForOfStatement (#349) (Brandon Dail)
+- chore(package): update ava to version 0.18.0 (#345) (greenkeeper[bot])
+- chore(package): update babel-plugin-istanbul to version 4.0.0 (#350) (greenkeeper[bot])
+- Change location of ObjectTypeIndexer to match flow (#228) (Daniel Tschinder)
+- Rename flow AST Type ExistentialTypeParam to ExistsTypeAnnotation (#322) (Toru Kobayashi)
+- Revert "Temporary rollback for erroring on trailing comma with spread (#154)" (#290) (Daniel Tschinder)
+- Remove classConstructorCall plugin (#291) (Brian Ng)
+- Update yarn.lock (Daniel Tschinder)
+- Update cross-env to 3.x (Daniel Tschinder)
+- [7.0] Remove node 0.10, 0.12 and 5 from Travis (#284) (Sergey Rubanov)
+- Remove `String.fromCodePoint` shim (#279) (Mathias Bynens)
+
+## 6.16.1 (2017-02-23)
+
+### :bug: Regression
+
+- Revert "Fix export default async function to be FunctionDeclaration" ([#375](https://github.com/babel/babylon/pull/375))
+
+Need to modify Babel for this AST node change, so moving to 7.0.
+
+- Revert "Don't parse class properties without initializers when classProperties plugin is disabled, and Flow is enabled" ([#376](https://github.com/babel/babylon/pull/376))
+
+[react-native](https://github.com/facebook/react-native/issues/12542) broke with this so we reverted.
+
+## 6.16.0 (2017-02-23)
+
+### :rocket: New Feature
+
+***ESTree*** compatibility as plugin ([#277](https://github.com/babel/babylon/pull/277)) (Daniel Tschinder)
+
+We finally introduce a new compatibility layer for ESTree. To put babylon into ESTree-compatible mode the new plugin `estree` can be enabled. In this mode the parser will output an AST that is compliant to the specs of [ESTree](https://github.com/estree/estree/)
+
+We highly recommend everyone who uses babylon outside of babel to use this plugin. This will make it much easier for users to switch between different ESTree-compatible parsers. We so far tested several projects with different parsers and exchanged their parser to babylon and in nearly all cases it worked out of the box. Some other estree-compatible parsers include `acorn`, `esprima`, `espree`, `flow-parser`, etc.
+
+To enable `estree` mode simply add the plugin in the config:
+```json
+{
+ "plugins": [ "estree" ]
+}
+```
+
+If you want to migrate your project from non-ESTree mode to ESTree, have a look at our [Readme](https://github.com/babel/babylon/#output), where all deviations are mentioned.
+
+Add a parseExpression public method ([#213](https://github.com/babel/babylon/pull/213)) (jeromew)
+
+Babylon exports a new function to parse a single expression
+
+```js
+import { parseExpression } from 'babylon';
+
+const ast = parseExpression('x || y && z', options);
+```
+
+The returned AST will only consist of the expression. The options are the same as for `parse()`
+
+Add startLine option ([#346](https://github.com/babel/babylon/pull/346)) (Raphael Mu)
+
+A new option was added to babylon allowing to change the initial linenumber for the first line which is usually `1`.
+Changing this for example to `100` will make line `1` of the input source to be marked as line `100`, line `2` as `101`, line `3` as `102`, ...
+
+Function predicate declaration ([#103](https://github.com/babel/babylon/pull/103)) (Panagiotis Vekris)
+
+Added support for function predicates which flow introduced in version 0.33.0
+
+```js
+declare function is_number(x: mixed): boolean %checks(typeof x === "number");
+```
+
+Allow imports in declare module ([#315](https://github.com/babel/babylon/pull/315)) (Daniel Tschinder)
+
+Added support for imports within module declarations which flow introduced in version 0.37.0
+
+```js
+declare module "C" {
+ import type { DT } from "D";
+ declare export type CT = { D: DT };
+}
+```
+
+### :eyeglasses: Spec Compliance
+
+Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons)
+
+This example now correctly throws an error when there is a semicolon after the decorator:
+
+```js
+class A {
+@a;
+foo(){}
+}
+```
+
+Keywords are not allowed as local specifier ([#307](https://github.com/babel/babylon/pull/307)) (Daniel Tschinder)
+
+Using keywords in imports is not allowed anymore:
+
+```js
+import { default } from "foo";
+import { a as debugger } from "foo";
+```
+
+Do not allow overwritting of primitive types ([#314](https://github.com/babel/babylon/pull/314)) (Daniel Tschinder)
+
+In flow it is now forbidden to overwrite the primitive types `"any"`, `"mixed"`, `"empty"`, `"bool"`, `"boolean"`, `"number"`, `"string"`, `"void"` and `"null"` with your own type declaration.
+
+Disallow import type { type a } from … ([#305](https://github.com/babel/babylon/pull/305)) (Daniel Tschinder)
+
+The following code now correctly throws an error
+
+```js
+import type { type a } from "foo";
+```
+
+Don't parse class properties without initializers when classProperties is disabled and Flow is enabled ([#300](https://github.com/babel/babylon/pull/300)) (Andrew Levine)
+
+Ensure that you enable the `classProperties` plugin in order to enable correct parsing of class properties. Prior to this version it was possible to parse them by enabling the `flow` plugin but this was not intended the behaviour.
+
+If you enable the flow plugin you can only define the type of the class properties, but not initialize them.
+
+Fix export default async function to be FunctionDeclaration ([#324](https://github.com/babel/babylon/pull/324)) (Daniel Tschinder)
+
+Parsing the following code now returns a `FunctionDeclaration` AST node instead of `FunctionExpression`.
+
+```js
+export default async function bar() {};
+```
+
+### :nail_care: Polish
+
+Improve error message on attempt to destructure named import ([#288](https://github.com/babel/babylon/pull/288)) (Brian Ng)
+
+### :bug: Bug Fix
+
+Fix negative number literal typeannotations ([#366](https://github.com/babel/babylon/pull/366)) (Daniel Tschinder)
+
+Ensure takeDecorators is called on exported class ([#358](https://github.com/babel/babylon/pull/358)) (Brian Ng)
+
+ESTree: correctly change literals in all cases ([#368](https://github.com/babel/babylon/pull/368)) (Daniel Tschinder)
+
+Correctly convert RestProperty to Assignable ([#339](https://github.com/babel/babylon/pull/339)) (Daniel Tschinder)
+
+Fix #321 by allowing question marks in type params ([#338](https://github.com/babel/babylon/pull/338)) (Daniel Tschinder)
+
+Fix #336 by correctly setting arrow-param ([#337](https://github.com/babel/babylon/pull/337)) (Daniel Tschinder)
+
+Fix parse error when destructuring `set` with default value ([#317](https://github.com/babel/babylon/pull/317)) (Brian Ng)
+
+Fix ObjectTypeCallProperty static ([#298](https://github.com/babel/babylon/pull/298)) (Dan Harper)
+
+
+### :house: Internal
+
+Fix generator-method-with-computed-name spec ([#360](https://github.com/babel/babylon/pull/360)) (Alex Rattray)
+
+Fix flow type-parameter-declaration test with unintended semantic ([#361](https://github.com/babel/babylon/pull/361)) (Alex Rattray)
+
+Cleanup and splitup parser functions ([#295](https://github.com/babel/babylon/pull/295)) (Daniel Tschinder)
+
+chore(package): update flow-bin to version 0.38.0 ([#313](https://github.com/babel/babylon/pull/313)) (greenkeeper[bot])
+
+Call inner function instead of 1:1 copy to plugin ([#294](https://github.com/babel/babylon/pull/294)) (Daniel Tschinder)
+
+Update eslint-config-babel to the latest version 🚀 ([#299](https://github.com/babel/babylon/pull/299)) (greenkeeper[bot])
+
+Update eslint-config-babel to the latest version 🚀 ([#293](https://github.com/babel/babylon/pull/293)) (greenkeeper[bot])
+
+devDeps: remove eslint-plugin-babel ([#292](https://github.com/babel/babylon/pull/292)) (Kai Cataldo)
+
+Correct indent eslint rule config ([#276](https://github.com/babel/babylon/pull/276)) (Daniel Tschinder)
+
+Fail tests that have expected.json and throws-option ([#285](https://github.com/babel/babylon/pull/285)) (Daniel Tschinder)
+
+### :memo: Documentation
+
+Update contributing with more test info [skip ci] ([#355](https://github.com/babel/babylon/pull/355)) (Brian Ng)
+
+Update API documentation ([#330](https://github.com/babel/babylon/pull/330)) (Timothy Gu)
+
+Added keywords to package.json ([#323](https://github.com/babel/babylon/pull/323)) (Dmytro)
+
+AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon/pull/318)) (Mathias Bynens)
+
+## 6.15.0 (2017-01-10)
+
+### :eyeglasses: Spec Compliance
+
+Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison)
+
+This change implements flows new shorthand import syntax
+and where previously you had to write this code:
+
+```js
+import {someValue} from "blah";
+import type {someType} from "blah";
+import typeof {someOtherValue} from "blah";
+```
+
+you can now write it like this:
+
+```js
+import {
+ someValue,
+ type someType,
+ typeof someOtherValue,
+} from "blah";
+```
+
+For more information look at [this](https://github.com/facebook/flow/pull/2890) pull request.
+
+flow: allow leading pipes in all positions ([#256](https://github.com/babel/babylon/pull/256)) (Vladimir Kurchatkin)
+
+This change now allows a leading pipe everywhere types can be used:
+```js
+var f = (x): | 1 | 2 => 1;
+```
+
+Throw error when exporting non-declaration ([#241](https://github.com/babel/babylon/pull/241)) (Kai Cataldo)
+
+Previously babylon parsed the following exports, although they are not valid:
+```js
+export typeof foo;
+export new Foo();
+export function() {};
+export for (;;);
+export while(foo);
+```
+
+### :bug: Bug Fix
+
+Don't set inType flag when parsing property names ([#266](https://github.com/babel/babylon/pull/266)) (Vladimir Kurchatkin)
+
+This fixes parsing of this case:
+
+```js
+const map = {
+ [age <= 17] : 'Too young'
+};
+```
+
+Fix source location for JSXEmptyExpression nodes (fixes #248) ([#249](https://github.com/babel/babylon/pull/249)) (James Long)
+
+The following case produced an invalid AST
+```js
+
{/* foo */}
+```
+
+Use fromCodePoint to convert high value unicode entities ([#243](https://github.com/babel/babylon/pull/243)) (Ryan Duffy)
+
+When high value unicode entities (e.g. 💩) were used in the input source code they are now correctly encoded in the resulting AST.
+
+Rename folder to avoid Windows-illegal characters ([#281](https://github.com/babel/babylon/pull/281)) (Ryan Plant)
+
+Allow this.state.clone() when parsing decorators ([#262](https://github.com/babel/babylon/pull/262)) (Alex Rattray)
+
+### :house: Internal
+
+User external-helpers ([#254](https://github.com/babel/babylon/pull/254)) (Daniel Tschinder)
+
+Add watch script for dev ([#234](https://github.com/babel/babylon/pull/234)) (Kai Cataldo)
+
+Freeze current plugins list for "*" option, and remove from README.md ([#245](https://github.com/babel/babylon/pull/245)) (Andrew Levine)
+
+Prepare tests for multiple fixture runners. ([#240](https://github.com/babel/babylon/pull/240)) (Daniel Tschinder)
+
+Add some test coverage for decorators stage-0 plugin ([#250](https://github.com/babel/babylon/pull/250)) (Andrew Levine)
+
+Refactor tokenizer types file ([#263](https://github.com/babel/babylon/pull/263)) (Sven SAULEAU)
+
+Update eslint-config-babel to the latest version 🚀 ([#273](https://github.com/babel/babylon/pull/273)) (greenkeeper[bot])
+
+chore(package): update rollup to version 0.41.0 ([#272](https://github.com/babel/babylon/pull/272)) (greenkeeper[bot])
+
+chore(package): update flow-bin to version 0.37.0 ([#255](https://github.com/babel/babylon/pull/255)) (greenkeeper[bot])
+
+## 6.14.1 (2016-11-17)
+
+### :bug: Bug Fix
+
+Allow `"plugins": ["*"]` ([#229](https://github.com/babel/babylon/pull/229)) (Daniel Tschinder)
+
+```js
+{
+ "plugins": ["*"]
+}
+```
+
+Will include all parser plugins instead of specifying each one individually. Useful for tools like babel-eslint, jscodeshift, and ast-explorer.
+
+## 6.14.0 (2016-11-16)
+
+### :eyeglasses: Spec Compliance
+
+Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo)
+
+[11.6.2.2 Future Reserved Words](http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words)
+
+Babylon will throw for more reserved words such as `enum` or `await` (in strict mode).
+
+```
+class enum {} // throws
+class await {} // throws in strict mode (module)
+```
+
+Optional names for function types and object type indexers ([#197](https://github.com/babel/babylon/pull/197)) (Gabe Levi)
+
+So where you used to have to write
+
+```js
+type A = (x: string, y: boolean) => number;
+type B = (z: string) => number;
+type C = { [key: string]: number };
+```
+
+you can now write (with flow 0.34.0)
+
+```js
+type A = (string, boolean) => number;
+type B = string => number;
+type C = { [string]: number };
+```
+
+Parse flow nested array type annotations like `number[][]` ([#219](https://github.com/babel/babylon/pull/219)) (Bernhard Häussner)
+
+Supports these form now of specifying array types:
+
+```js
+var a: number[][][][];
+var b: string[][];
+```
+
+### :bug: Bug Fix
+
+Correctly eat semicolon at the end of `DelcareModuleExports` ([#223](https://github.com/babel/babylon/pull/223)) (Daniel Tschinder)
+
+```
+declare module "foo" { declare module.exports: number }
+declare module "foo" { declare module.exports: number; } // also allowed now
+```
+
+### :house: Internal
+
+ * Count Babel tests towards Babylon code coverage ([#182](https://github.com/babel/babylon/pull/182)) (Moti Zilberman)
+ * Fix strange line endings ([#214](https://github.com/babel/babylon/pull/214)) (Thomas Grainger)
+ * Add node 7 (Daniel Tschinder)
+ * chore(package): update flow-bin to version 0.34.0 ([#204](https://github.com/babel/babylon/pull/204)) (Greenkeeper)
+
+## v6.13.1 (2016-10-26)
+
+### :nail_care: Polish
+
+- Use rollup for bundling to speed up startup time ([#190](https://github.com/babel/babylon/pull/190)) ([@drewml](https://github.com/DrewML))
+
+```js
+const babylon = require('babylon');
+const ast = babylon.parse('var foo = "lol";');
+```
+
+With that test case, there was a ~95ms savings by removing the need for node to build/traverse the dependency graph.
+
+**Without bundling**
+
+
+**With bundling**
+
+
+- add clean command [skip ci] ([#201](https://github.com/babel/babylon/pull/201)) (Henry Zhu)
+- add ForAwaitStatement (async generator already added) [skip ci] ([#196](https://github.com/babel/babylon/pull/196)) (Henry Zhu)
+
+## v6.13.0 (2016-10-21)
+
+### :eyeglasses: Spec Compliance
+
+Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman)
+
+> See https://flowtype.org/docs/variance.html for more information
+
+```js
+type T = { +p: T };
+interface T { -p: T };
+declare class T { +[k:K]: V };
+class T { -[k:K]: V };
+class C2 { +p: T = e };
+```
+
+Raise error on duplicate definition of __proto__ ([#183](https://github.com/babel/babylon/pull/183)) (Moti Zilberman)
+
+```js
+({ __proto__: 1, __proto__: 2 }) // Throws an error now
+```
+
+### :bug: Bug Fix
+
+Flow: Allow class properties to be named `static` ([#184](https://github.com/babel/babylon/pull/184)) (Moti Zilberman)
+
+```js
+declare class A {
+ static: T;
+}
+```
+
+Allow "async" as identifier for object literal property shorthand ([#187](https://github.com/babel/babylon/pull/187)) (Andrew Levine)
+
+```js
+var foo = { async, bar };
+```
+
+### :nail_care: Polish
+
+Fix flowtype and add inType to state ([#189](https://github.com/babel/babylon/pull/189)) (Daniel Tschinder)
+
+> This improves the performance slightly (because of hidden classes)
+
+### :house: Internal
+
+Fix .gitattributes line ending setting ([#191](https://github.com/babel/babylon/pull/191)) (Moti Zilberman)
+
+Increase test coverage ([#175](https://github.com/babel/babylon/pull/175) (Moti Zilberman)
+
+Readd missin .eslinignore for IDEs (Daniel Tschinder)
+
+Error on missing expected.json fixture in CI ([#188](https://github.com/babel/babylon/pull/188)) (Moti Zilberman)
+
+Add .gitattributes and .editorconfig for LF line endings ([#179](https://github.com/babel/babylon/pull/179)) (Moti Zilberman)
+
+Fixes two tests that are failing after the merge of #172 ([#177](https://github.com/babel/babylon/pull/177)) (Moti Zilberman)
+
+## v6.12.0 (2016-10-14)
+
+### :eyeglasses: Spec Compliance
+
+Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler)
+
+#### Dynamic Import
+
+- Proposal Repo: https://github.com/domenic/proposal-dynamic-import
+- Championed by [@domenic](https://github.com/domenic)
+- stage-2
+- [sept-28 tc39 notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2016-09/sept-28.md#113a-import)
+
+> This repository contains a proposal for adding a "function-like" import() module loading syntactic form to JavaScript
+
+```js
+import(`./section-modules/${link.dataset.entryModule}.js`)
+.then(module => {
+ module.loadPageInto(main);
+})
+```
+
+Add EmptyTypeAnnotation ([#171](https://github.com/babel/babylon/pull/171)) (Sam Goldman)
+
+#### EmptyTypeAnnotation
+
+Just wasn't covered before.
+
+```js
+type T = empty;
+```
+
+### :bug: Bug Fix
+
+Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
+
+```js
+// was failing due to sparse array
+export const { foo: [ ,, qux7 ] } = bar;
+```
+
+Allow keyword in Flow object declaration property names with type parameters ([#146](https://github.com/babel/babylon/pull/146)) (Dan Harper)
+
+```js
+declare class X {
+ foobar(): void;
+ static foobar(): void;
+}
+```
+
+Allow keyword in object/class property names with Flow type parameters ([#145](https://github.com/babel/babylon/pull/145)) (Dan Harper)
+
+```js
+class Foo {
+ delete(item: T): T {
+ return item;
+ }
+}
+```
+
+Allow typeAnnotations for yield expressions ([#174](https://github.com/babel/babylon/pull/174))) (Daniel Tschinder)
+
+```js
+function *foo() {
+ const x = (yield 5: any);
+}
+```
+
+### :nail_care: Polish
+
+Annotate more errors with expected token ([#172](https://github.com/babel/babylon/pull/172))) (Moti Zilberman)
+
+```js
+// Unexpected token, expected ; (1:6)
+{ set 1 }
+```
+
+### :house: Internal
+
+Remove kcheck ([#173](https://github.com/babel/babylon/pull/173))) (Daniel Tschinder)
+
+Also run flow, linting, babel tests on separate instances (add back node 0.10)
+
+## v6.11.6 (2016-10-12)
+
+### :bug: Bug Fix/Regression
+
+Fix crash when exporting with destructuring and sparse array ([#170](https://github.com/babel/babylon/pull/170)) (Jeroen Engels)
+
+```js
+// was failing with `Cannot read property 'type' of null` because of null identifiers
+export const { foo: [ ,, qux7 ] } = bar;
+```
+
+## v6.11.5 (2016-10-12)
+
+### :eyeglasses: Spec Compliance
+
+Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo)
+
+```js
+// `foo` has already been exported. Exported identifiers must be unique. (2:20)
+export function foo() {};
+export const { a: [{foo}] } = bar;
+```
+
+Fix: Check for duplicate named exports in exported rest elements/properties ([#164](https://github.com/babel/babylon/pull/164)) (Kai Cataldo)
+
+```js
+// `foo` has already been exported. Exported identifiers must be unique. (2:22)
+export const foo = 1;
+export const [bar, ...foo] = baz;
+```
+
+### :bug: Bug Fix
+
+Fix: Allow identifier `async` for default param in arrow expression ([#165](https://github.com/babel/babylon/pull/165)) (Kai Cataldo)
+
+```js
+// this is ok now
+const test = ({async = true}) => {};
+```
+
+### :nail_care: Polish
+
+Babylon will now print out the token it's expecting if there's a `SyntaxError` ([#150](https://github.com/babel/babylon/pull/150)) (Daniel Tschinder)
+
+```bash
+# So in the case of a missing ending curly (`}`)
+Module build failed: SyntaxError: Unexpected token, expected } (30:0)
+ 28 | }
+ 29 |
+> 30 |
+ | ^
+```
+
+## v6.11.4 (2016-10-03)
+
+Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu)
+
+## v6.11.3 (2016-10-01)
+
+### :eyeglasses: Spec Compliance
+
+Add static errors for object rest (#149) ([@danez](https://github.com/danez))
+
+> https://github.com/sebmarkbage/ecmascript-rest-spread
+
+Object rest copies the *rest* of properties from the right hand side `obj` starting from the left to right.
+
+```js
+let { x, y, ...z } = { x: 1, y: 2, z: 3 };
+// x = 1
+// y = 2
+// z = { z: 3 }
+```
+
+#### New Syntax Errors:
+
+**SyntaxError**: The rest element has to be the last element when destructuring (1:10)
+```bash
+> 1 | let { ...x, y, z } = { x: 1, y: 2, z: 3};
+ | ^
+# Previous behavior:
+# x = { x: 1, y: 2, z: 3 }
+# y = 2
+# z = 3
+```
+
+Before, this was just a more verbose way of shallow copying `obj` since it doesn't actually do what you think.
+
+**SyntaxError**: Cannot have multiple rest elements when destructuring (1:13)
+
+```bash
+> 1 | let { x, ...y, ...z } = { x: 1, y: 2, z: 3};
+ | ^
+# Previous behavior:
+# x = 1
+# y = { y: 2, z: 3 }
+# z = { y: 2, z: 3 }
+```
+
+Before y and z would just be the same value anyway so there is no reason to need to have both.
+
+**SyntaxError**: A trailing comma is not permitted after the rest element (1:16)
+
+```js
+let { x, y, ...z, } = obj;
+```
+
+The rationale for this is that the use case for trailing comma is that you can add something at the end without affecting the line above. Since a RestProperty always has to be the last property it doesn't make sense.
+
+---
+
+get / set are valid property names in default assignment (#142) ([@jezell](https://github.com/jezell))
+
+```js
+// valid
+function something({ set = null, get = null }) {}
+```
+
+## v6.11.2 (2016-09-23)
+
+### Bug Fix
+
+- [#139](https://github.com/babel/babylon/issues/139) Don't do the duplicate check if not an identifier (#140) @hzoo
+
+```js
+// regression with duplicate export check
+SyntaxError: ./typography.js: `undefined` has already been exported. Exported identifiers must be unique. (22:13)
+ 20 |
+ 21 | export const { rhythm } = typography;
+> 22 | export const { TypographyStyle } = typography
+```
+
+Bail out for now, and make a change to account for destructuring in the next release.
+
+## 6.11.1 (2016-09-22)
+
+### Bug Fix
+- [#137](https://github.com/babel/babylon/pull/137) - Fix a regression with duplicate exports - it was erroring on all keys in `Object.prototype`. @danez
+
+```javascript
+export toString from './toString';
+```
+
+```bash
+`toString` has already been exported. Exported identifiers must be unique. (1:7)
+> 1 | export toString from './toString';
+ | ^
+ 2 |
+```
+
+## 6.11.0 (2016-09-22)
+
+### Spec Compliance (will break CI)
+
+- Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo
+
+```js
+// Only one default export allowed per module. (2:9)
+export default function() {};
+export { foo as default };
+
+// Only one default export allowed per module. (2:0)
+export default {};
+export default function() {};
+
+// `Foo` has already been exported. Exported identifiers must be unique. (2:0)
+export { Foo };
+export class Foo {};
+```
+
+### New Feature (Syntax)
+
+- Add support for computed class property names ([#121](https://github.com/babel/babylon/pull/121)) @motiz88
+
+```js
+// AST
+interface ClassProperty <: Node {
+ type: "ClassProperty";
+ key: Identifier;
+ value: Expression;
+ computed: boolean; // added
+}
+```
+
+```js
+// with "plugins": ["classProperties"]
+class Foo {
+ [x]
+ ['y']
+}
+
+class Bar {
+ [p]
+ [m] () {}
+}
+ ```
+
+### Bug Fix
+
+- Fix `static` property falling through in the declare class Flow AST ([#135](https://github.com/babel/babylon/pull/135)) @danharper
+
+```js
+declare class X {
+ a: number;
+ static b: number; // static
+ c: number; // this was being marked as static in the AST as well
+}
+```
+
+### Polish
+
+- Rephrase "assigning/binding to rvalue" errors to include context ([#119](https://github.com/babel/babylon/pull/119)) @motiz88
+
+```js
+// Used to error with:
+// SyntaxError: Assigning to rvalue (1:0)
+
+// Now:
+// Invalid left-hand side in assignment expression (1:0)
+3 = 4
+
+// Invalid left-hand side in for-in statement (1:5)
+for (+i in {});
+```
+
+### Internal
+
+- Fix call to `this.parseMaybeAssign` with correct arguments ([#133](https://github.com/babel/babylon/pull/133)) @danez
+- Add semver note to changelog ([#131](https://github.com/babel/babylon/pull/131)) @hzoo
+
+## 6.10.0 (2016-09-19)
+
+> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue.
+
+### Spec Compliance
+
+* Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu)
+
+> It is a Syntax Error if ContainsUseStrict of FunctionBody is true and IsSimpleParameterList of FormalParameters is false. https://tc39.github.io/ecma262/2016/#sec-function-definitions-static-semantics-early-errors
+
+More Context: [tc39-notes](https://github.com/rwaldron/tc39-notes/blob/master/es7/2015-07/july-29.md#611-the-scope-of-use-strict-with-respect-to-destructuring-in-parameter-lists)
+
+For example:
+
+```js
+// this errors because it uses destructuring and default parameters
+// in a function with a "use strict" directive
+function a([ option1, option2 ] = []) {
+ "use strict";
+}
+ ```
+
+The solution would be to use a top level "use strict" or to remove the destructuring or default parameters when using a function + "use strict" or to.
+
+### New Feature
+
+* Exact object type annotations for Flow plugin ([#104](https://github.com/babel/babylon/pull/104)) (Basil Hosmer)
+
+Added to flow in https://github.com/facebook/flow/commit/c710c40aa2a115435098d6c0dfeaadb023cd39b8
+
+Looks like:
+
+```js
+var a : {| x: number, y: string |} = { x: 0, y: 'foo' };
+```
+
+### Bug Fixes
+
+* Include `typeParameter` location in `ArrowFunctionExpression` ([#126](https://github.com/babel/babylon/pull/126)) (Daniel Tschinder)
+* Error on invalid flow type annotation with default assignment ([#122](https://github.com/babel/babylon/pull/122)) (Dan Harper)
+* Fix Flow return types on arrow functions ([#124](https://github.com/babel/babylon/pull/124)) (Dan Harper)
+
+### Misc
+
+* Add tests for export extensions ([#127](https://github.com/babel/babylon/pull/127)) (Daniel Tschinder)
+* Fix Contributing guidelines [skip ci] (Daniel Tschinder)
+
+## 6.9.2 (2016-09-09)
+
+The only change is to remove the `babel-runtime` dependency by compiling with Babel's ES2015 loose mode. So using babylon standalone should be smaller.
+
+## 6.9.1 (2016-08-23)
+
+This release contains mainly small bugfixes but also updates babylons default mode to es2017. The features for `exponentiationOperator`, `asyncFunctions` and `trailingFunctionCommas` which previously needed to be activated via plugin are now enabled by default and the plugins are now no-ops.
+
+### Bug Fixes
+
+- Fix issues with default object params in async functions ([#96](https://github.com/babel/babylon/pull/96)) @danez
+- Fix issues with flow-types and async function ([#95](https://github.com/babel/babylon/pull/95)) @danez
+- Fix arrow functions with destructuring, types & default value ([#94](https://github.com/babel/babylon/pull/94)) @danharper
+- Fix declare class with qualified type identifier ([#97](https://github.com/babel/babylon/pull/97)) @danez
+- Remove exponentiationOperator, asyncFunctions, trailingFunctionCommas plugins and enable them by default ([#98](https://github.com/babel/babylon/pull/98)) @danez
+
+## 6.9.0 (2016-08-16)
+
+### New syntax support
+
+- Add JSX spread children ([#42](https://github.com/babel/babylon/pull/42)) @calebmer
+
+(Be aware that React is not going to support this syntax)
+
+```js
+
+ {...todos.map(todo => )}
+
+```
+
+- Add support for declare module.exports ([#72](https://github.com/babel/babylon/pull/72)) @danez
+
+```js
+declare module "foo" {
+ declare module.exports: {}
+}
+```
+
+### New Features
+
+- If supplied, attach filename property to comment node loc. ([#80](https://github.com/babel/babylon/pull/80)) @divmain
+- Add identifier name to node loc field ([#90](https://github.com/babel/babylon/pull/90)) @kittens
+
+### Bug Fixes
+
+- Fix exponential operator to behave according to spec ([#75](https://github.com/babel/babylon/pull/75)) @danez
+- Fix lookahead to not add comments to arrays which are not cloned ([#76](https://github.com/babel/babylon/pull/76)) @danez
+- Fix accidental fall-through in Flow type parsing. ([#82](https://github.com/babel/babylon/pull/82)) @xiemaisi
+- Only allow declares inside declare module ([#73](https://github.com/babel/babylon/pull/73)) @danez
+- Small fix for parsing type parameter declarations ([#83](https://github.com/babel/babylon/pull/83)) @gabelevi
+- Fix arrow param locations with flow types ([#57](https://github.com/babel/babylon/pull/57)) @danez
+- Fixes SyntaxError position with flow optional type ([#65](https://github.com/babel/babylon/pull/65)) @danez
+
+### Internal
+
+- Add codecoverage to tests @danez
+- Fix tests to not save expected output if we expect the test to fail @danez
+- Make a shallow clone of babel for testing @danez
+- chore(package): update cross-env to version 2.0.0 ([#77](https://github.com/babel/babylon/pull/77)) @greenkeeperio-bot
+- chore(package): update ava to version 0.16.0 ([#86](https://github.com/babel/babylon/pull/86)) @greenkeeperio-bot
+- chore(package): update babel-plugin-istanbul to version 2.0.0 ([#89](https://github.com/babel/babylon/pull/89)) @greenkeeperio-bot
+- chore(package): update nyc to version 8.0.0 ([#88](https://github.com/babel/babylon/pull/88)) @greenkeeperio-bot
+
+## 6.8.4 (2016-07-06)
+
+### Bug Fixes
+
+- Fix the location of params, when flow and default value used ([#68](https://github.com/babel/babylon/pull/68)) @danez
+
+## 6.8.3 (2016-07-02)
+
+### Bug Fixes
+
+- Fix performance regression introduced in 6.8.2 with conditionals ([#63](https://github.com/babel/babylon/pull/63)) @danez
+
+## 6.8.2 (2016-06-24)
+
+### Bug Fixes
+
+- Fix parse error with yielding jsx elements in generators `function* it() { yield ; }` ([#31](https://github.com/babel/babylon/pull/31)) @eldereal
+- When cloning nodes do not clone its comments ([#24](https://github.com/babel/babylon/pull/24)) @danez
+- Fix parse errors when using arrow functions with an spread element and return type `(...props): void => {}` ([#10](https://github.com/babel/babylon/pull/10)) @danez
+- Fix leading comments added from previous node ([#23](https://github.com/babel/babylon/pull/23)) @danez
+- Fix parse errors with flow's optional arguments `(arg?) => {}` ([#19](https://github.com/babel/babylon/pull/19)) @danez
+- Support negative numeric type literals @kittens
+- Remove line terminator restriction after await keyword @kittens
+- Remove grouped type arrow restriction as it seems flow no longer has it @kittens
+- Fix parse error with generic methods that have the name `get` or `set` `class foo { get() {} }` ([#55](https://github.com/babel/babylon/pull/55)) @vkurchatkin
+- Fix parse error with arrow functions that have flow type parameter declarations `(x: T): T => x;` ([#54](https://github.com/babel/babylon/pull/54)) @gabelevi
+
+### Documentation
+
+- Document AST differences from ESTree ([#41](https://github.com/babel/babylon/pull/41)) @nene
+- Move ast spec from babel/babel ([#46](https://github.com/babel/babylon/pull/46)) @hzoo
+
+### Internal
+
+- Enable skipped tests ([#16](https://github.com/babel/babylon/pull/16)) @danez
+- Add script to test latest version of babylon with babel ([#21](https://github.com/babel/babylon/pull/21)) @danez
+- Upgrade test runner ava @kittens
+- Add missing generate-identifier-regex script @kittens
+- Rename parser context types @kittens
+- Add node v6 to travis testing @hzoo
+- Update to Unicode v9 ([#45](https://github.com/babel/babylon/pull/45)) @mathiasbynens
+
+## 6.8.1 (2016-06-06)
+
+### New Feature
+
+- Parse type parameter declarations with defaults like `type Foo = T`
+
+### Bug Fixes
+- Type parameter declarations need 1 or more type parameters.
+- The existential type `*` is not a valid type parameter.
+- The existential type `*` is a primary type
+
+### Spec Compliance
+- The param list for type parameter declarations now consists of `TypeParameter` nodes
+- New `TypeParameter` AST Node (replaces using the `Identifier` node before)
+
+```
+interface TypeParameter <: Node {
+ bound: TypeAnnotation;
+ default: TypeAnnotation;
+ name: string;
+ variance: "plus" | "minus";
+}
+```
+
+## 6.8.0 (2016-05-02)
+
+#### New Feature
+
+##### Parse Method Parameter Decorators ([#12](https://github.com/babel/babylon/pull/12))
+
+> [Method Parameter Decorators](https://goo.gl/8MmCMG) is now a TC39 [stage 0 proposal](https://github.com/tc39/ecma262/blob/master/stage0.md).
+
+Examples:
+
+```js
+class Foo {
+ constructor(@foo() x, @bar({ a: 123 }) @baz() y) {}
+}
+
+export default function func(@foo() x, @bar({ a: 123 }) @baz() y) {}
+
+var obj = {
+ method(@foo() x, @bar({ a: 123 }) @baz() y) {}
+};
+```
+
+##### Parse for-await statements (w/ `asyncGenerators` plugin) ([#17](https://github.com/babel/babylon/pull/17))
+
+There is also a new node type, `ForAwaitStatement`.
+
+> [Async generators and for-await](https://github.com/tc39/proposal-async-iteration) are now a [stage 2 proposal](https://github.com/tc39/ecma262#current-proposals).
+
+Example:
+
+```js
+async function f() {
+ for await (let x of y);
+}
+```
diff --git a/Nodejs/node_modules/@babel/parser/LICENSE b/Nodejs/node_modules/@babel/parser/LICENSE
new file mode 100644
index 0000000..d4c7fc5
--- /dev/null
+++ b/Nodejs/node_modules/@babel/parser/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2012-2014 by various contributors (see AUTHORS)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/@babel/parser/README.md b/Nodejs/node_modules/@babel/parser/README.md
new file mode 100644
index 0000000..65092a0
--- /dev/null
+++ b/Nodejs/node_modules/@babel/parser/README.md
@@ -0,0 +1,19 @@
+# @babel/parser
+
+> A JavaScript parser
+
+See our website [@babel/parser](https://babeljs.io/docs/en/next/babel-parser.html) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen) associated with this package.
+
+## Install
+
+Using npm:
+
+```sh
+npm install --save-dev @babel/parser
+```
+
+or using yarn:
+
+```sh
+yarn add @babel/parser --dev
+```
diff --git a/Nodejs/node_modules/@babel/parser/bin/babel-parser.js b/Nodejs/node_modules/@babel/parser/bin/babel-parser.js
new file mode 100755
index 0000000..3aca314
--- /dev/null
+++ b/Nodejs/node_modules/@babel/parser/bin/babel-parser.js
@@ -0,0 +1,15 @@
+#!/usr/bin/env node
+/* eslint no-var: 0 */
+
+var parser = require("..");
+var fs = require("fs");
+
+var filename = process.argv[2];
+if (!filename) {
+ console.error("no filename specified");
+} else {
+ var file = fs.readFileSync(filename, "utf8");
+ var ast = parser.parse(file);
+
+ console.log(JSON.stringify(ast, null, " "));
+}
diff --git a/Nodejs/node_modules/@babel/parser/lib/index.js b/Nodejs/node_modules/@babel/parser/lib/index.js
new file mode 100644
index 0000000..5c04001
--- /dev/null
+++ b/Nodejs/node_modules/@babel/parser/lib/index.js
@@ -0,0 +1,12363 @@
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+const beforeExpr = true;
+const startsExpr = true;
+const isLoop = true;
+const isAssign = true;
+const prefix = true;
+const postfix = true;
+class TokenType {
+ constructor(label, conf = {}) {
+ this.label = label;
+ this.keyword = conf.keyword;
+ this.beforeExpr = !!conf.beforeExpr;
+ this.startsExpr = !!conf.startsExpr;
+ this.rightAssociative = !!conf.rightAssociative;
+ this.isLoop = !!conf.isLoop;
+ this.isAssign = !!conf.isAssign;
+ this.prefix = !!conf.prefix;
+ this.postfix = !!conf.postfix;
+ this.binop = conf.binop != null ? conf.binop : null;
+ this.updateContext = null;
+ }
+
+}
+const keywords = new Map();
+
+function createKeyword(name, options = {}) {
+ options.keyword = name;
+ const token = new TokenType(name, options);
+ keywords.set(name, token);
+ return token;
+}
+
+function createBinop(name, binop) {
+ return new TokenType(name, {
+ beforeExpr,
+ binop
+ });
+}
+
+const types = {
+ num: new TokenType("num", {
+ startsExpr
+ }),
+ bigint: new TokenType("bigint", {
+ startsExpr
+ }),
+ regexp: new TokenType("regexp", {
+ startsExpr
+ }),
+ string: new TokenType("string", {
+ startsExpr
+ }),
+ name: new TokenType("name", {
+ startsExpr
+ }),
+ eof: new TokenType("eof"),
+ bracketL: new TokenType("[", {
+ beforeExpr,
+ startsExpr
+ }),
+ bracketR: new TokenType("]"),
+ braceL: new TokenType("{", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceBarL: new TokenType("{|", {
+ beforeExpr,
+ startsExpr
+ }),
+ braceR: new TokenType("}"),
+ braceBarR: new TokenType("|}"),
+ parenL: new TokenType("(", {
+ beforeExpr,
+ startsExpr
+ }),
+ parenR: new TokenType(")"),
+ comma: new TokenType(",", {
+ beforeExpr
+ }),
+ semi: new TokenType(";", {
+ beforeExpr
+ }),
+ colon: new TokenType(":", {
+ beforeExpr
+ }),
+ doubleColon: new TokenType("::", {
+ beforeExpr
+ }),
+ dot: new TokenType("."),
+ question: new TokenType("?", {
+ beforeExpr
+ }),
+ questionDot: new TokenType("?."),
+ arrow: new TokenType("=>", {
+ beforeExpr
+ }),
+ template: new TokenType("template"),
+ ellipsis: new TokenType("...", {
+ beforeExpr
+ }),
+ backQuote: new TokenType("`", {
+ startsExpr
+ }),
+ dollarBraceL: new TokenType("${", {
+ beforeExpr,
+ startsExpr
+ }),
+ at: new TokenType("@"),
+ hash: new TokenType("#", {
+ startsExpr
+ }),
+ interpreterDirective: new TokenType("#!..."),
+ eq: new TokenType("=", {
+ beforeExpr,
+ isAssign
+ }),
+ assign: new TokenType("_=", {
+ beforeExpr,
+ isAssign
+ }),
+ incDec: new TokenType("++/--", {
+ prefix,
+ postfix,
+ startsExpr
+ }),
+ bang: new TokenType("!", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ tilde: new TokenType("~", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ pipeline: createBinop("|>", 0),
+ nullishCoalescing: createBinop("??", 1),
+ logicalOR: createBinop("||", 1),
+ logicalAND: createBinop("&&", 2),
+ bitwiseOR: createBinop("|", 3),
+ bitwiseXOR: createBinop("^", 4),
+ bitwiseAND: createBinop("&", 5),
+ equality: createBinop("==/!=/===/!==", 6),
+ relational: createBinop(">/<=/>=", 7),
+ bitShift: createBinop("<>>/>>>", 8),
+ plusMin: new TokenType("+/-", {
+ beforeExpr,
+ binop: 9,
+ prefix,
+ startsExpr
+ }),
+ modulo: new TokenType("%", {
+ beforeExpr,
+ binop: 10,
+ startsExpr
+ }),
+ star: createBinop("*", 10),
+ slash: createBinop("/", 10),
+ exponent: new TokenType("**", {
+ beforeExpr,
+ binop: 11,
+ rightAssociative: true
+ }),
+ _break: createKeyword("break"),
+ _case: createKeyword("case", {
+ beforeExpr
+ }),
+ _catch: createKeyword("catch"),
+ _continue: createKeyword("continue"),
+ _debugger: createKeyword("debugger"),
+ _default: createKeyword("default", {
+ beforeExpr
+ }),
+ _do: createKeyword("do", {
+ isLoop,
+ beforeExpr
+ }),
+ _else: createKeyword("else", {
+ beforeExpr
+ }),
+ _finally: createKeyword("finally"),
+ _for: createKeyword("for", {
+ isLoop
+ }),
+ _function: createKeyword("function", {
+ startsExpr
+ }),
+ _if: createKeyword("if"),
+ _return: createKeyword("return", {
+ beforeExpr
+ }),
+ _switch: createKeyword("switch"),
+ _throw: createKeyword("throw", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _try: createKeyword("try"),
+ _var: createKeyword("var"),
+ _const: createKeyword("const"),
+ _while: createKeyword("while", {
+ isLoop
+ }),
+ _with: createKeyword("with"),
+ _new: createKeyword("new", {
+ beforeExpr,
+ startsExpr
+ }),
+ _this: createKeyword("this", {
+ startsExpr
+ }),
+ _super: createKeyword("super", {
+ startsExpr
+ }),
+ _class: createKeyword("class", {
+ startsExpr
+ }),
+ _extends: createKeyword("extends", {
+ beforeExpr
+ }),
+ _export: createKeyword("export"),
+ _import: createKeyword("import", {
+ startsExpr
+ }),
+ _null: createKeyword("null", {
+ startsExpr
+ }),
+ _true: createKeyword("true", {
+ startsExpr
+ }),
+ _false: createKeyword("false", {
+ startsExpr
+ }),
+ _in: createKeyword("in", {
+ beforeExpr,
+ binop: 7
+ }),
+ _instanceof: createKeyword("instanceof", {
+ beforeExpr,
+ binop: 7
+ }),
+ _typeof: createKeyword("typeof", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _void: createKeyword("void", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ }),
+ _delete: createKeyword("delete", {
+ beforeExpr,
+ prefix,
+ startsExpr
+ })
+};
+
+const SCOPE_OTHER = 0b00000000,
+ SCOPE_PROGRAM = 0b00000001,
+ SCOPE_FUNCTION = 0b00000010,
+ SCOPE_ARROW = 0b00000100,
+ SCOPE_SIMPLE_CATCH = 0b00001000,
+ SCOPE_SUPER = 0b00010000,
+ SCOPE_DIRECT_SUPER = 0b00100000,
+ SCOPE_CLASS = 0b01000000,
+ SCOPE_TS_MODULE = 0b10000000,
+ SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;
+const BIND_KIND_VALUE = 0b00000000001,
+ BIND_KIND_TYPE = 0b00000000010,
+ BIND_SCOPE_VAR = 0b00000000100,
+ BIND_SCOPE_LEXICAL = 0b00000001000,
+ BIND_SCOPE_FUNCTION = 0b00000010000,
+ BIND_FLAGS_NONE = 0b00001000000,
+ BIND_FLAGS_CLASS = 0b00010000000,
+ BIND_FLAGS_TS_ENUM = 0b00100000000,
+ BIND_FLAGS_TS_CONST_ENUM = 0b01000000000,
+ BIND_FLAGS_TS_EXPORT_ONLY = 0b10000000000;
+const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS,
+ BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0,
+ BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0,
+ BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0,
+ BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS,
+ BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0,
+ BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,
+ BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,
+ BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE,
+ BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,
+ BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY;
+const CLASS_ELEMENT_FLAG_STATIC = 0b100,
+ CLASS_ELEMENT_KIND_GETTER = 0b010,
+ CLASS_ELEMENT_KIND_SETTER = 0b001,
+ CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;
+const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,
+ CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,
+ CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,
+ CLASS_ELEMENT_OTHER = 0;
+
+function isSimpleProperty(node) {
+ return node != null && node.type === "Property" && node.kind === "init" && node.method === false;
+}
+
+var estree = (superClass => class extends superClass {
+ estreeParseRegExpLiteral({
+ pattern,
+ flags
+ }) {
+ let regex = null;
+
+ try {
+ regex = new RegExp(pattern, flags);
+ } catch (e) {}
+
+ const node = this.estreeParseLiteral(regex);
+ node.regex = {
+ pattern,
+ flags
+ };
+ return node;
+ }
+
+ estreeParseBigIntLiteral(value) {
+ const bigInt = typeof BigInt !== "undefined" ? BigInt(value) : null;
+ const node = this.estreeParseLiteral(bigInt);
+ node.bigint = String(node.value || value);
+ return node;
+ }
+
+ estreeParseLiteral(value) {
+ return this.parseLiteral(value, "Literal");
+ }
+
+ directiveToStmt(directive) {
+ const directiveLiteral = directive.value;
+ const stmt = this.startNodeAt(directive.start, directive.loc.start);
+ const expression = this.startNodeAt(directiveLiteral.start, directiveLiteral.loc.start);
+ expression.value = directiveLiteral.value;
+ expression.raw = directiveLiteral.extra.raw;
+ stmt.expression = this.finishNodeAt(expression, "Literal", directiveLiteral.end, directiveLiteral.loc.end);
+ stmt.directive = directiveLiteral.extra.raw.slice(1, -1);
+ return this.finishNodeAt(stmt, "ExpressionStatement", directive.end, directive.loc.end);
+ }
+
+ initFunction(node, isAsync) {
+ super.initFunction(node, isAsync);
+ node.expression = false;
+ }
+
+ checkDeclaration(node) {
+ if (isSimpleProperty(node)) {
+ this.checkDeclaration(node.value);
+ } else {
+ super.checkDeclaration(node);
+ }
+ }
+
+ checkGetterSetterParams(method) {
+ const prop = method;
+ const paramCount = prop.kind === "get" ? 0 : 1;
+ const start = prop.start;
+
+ if (prop.value.params.length !== paramCount) {
+ if (prop.kind === "get") {
+ this.raise(start, "getter must not have any formal parameters");
+ } else {
+ this.raise(start, "setter must have exactly one formal parameter");
+ }
+ } else if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
+ this.raise(start, "setter function argument must not be a rest parameter");
+ }
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription, disallowLetBinding) {
+ switch (expr.type) {
+ case "ObjectPattern":
+ expr.properties.forEach(prop => {
+ this.checkLVal(prop.type === "Property" ? prop.value : prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
+ });
+ break;
+
+ default:
+ super.checkLVal(expr, bindingType, checkClashes, contextDescription, disallowLetBinding);
+ }
+ }
+
+ checkDuplicatedProto(prop, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || prop.computed || prop.method || prop.shorthand) {
+ return;
+ }
+
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : String(key.value);
+
+ if (name === "__proto__" && prop.kind === "init") {
+ if (protoRef.used) {
+ if (refExpressionErrors && refExpressionErrors.doubleProto === -1) {
+ refExpressionErrors.doubleProto = key.start;
+ } else {
+ this.raise(key.start, "Redefinition of __proto__ property");
+ }
+ }
+
+ protoRef.used = true;
+ }
+ }
+
+ isValidDirective(stmt) {
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized);
+ }
+
+ stmtToDirective(stmt) {
+ const directive = super.stmtToDirective(stmt);
+ const value = stmt.expression.value;
+ directive.value.value = value;
+ return directive;
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end) {
+ super.parseBlockBody(node, allowDirectives, topLevel, end);
+ const directiveStatements = node.directives.map(d => this.directiveToStmt(d));
+ node.body = directiveStatements.concat(node.body);
+ delete node.directives;
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true);
+
+ if (method.typeParameters) {
+ method.value.typeParameters = method.typeParameters;
+ delete method.typeParameters;
+ }
+
+ classBody.body.push(method);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ switch (this.state.type) {
+ case types.num:
+ case types.string:
+ return this.estreeParseLiteral(this.state.value);
+
+ case types.regexp:
+ return this.estreeParseRegExpLiteral(this.state.value);
+
+ case types.bigint:
+ return this.estreeParseBigIntLiteral(this.state.value);
+
+ case types._null:
+ return this.estreeParseLiteral(null);
+
+ case types._true:
+ return this.estreeParseLiteral(true);
+
+ case types._false:
+ return this.estreeParseLiteral(false);
+
+ default:
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+
+ parseLiteral(value, type, startPos, startLoc) {
+ const node = super.parseLiteral(value, type, startPos, startLoc);
+ node.raw = node.extra.raw;
+ delete node.extra;
+ return node;
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ super.parseFunctionBody(node, allowExpression, isMethod);
+ node.expression = node.body.type !== "BlockStatement";
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ let funcNode = this.startNode();
+ funcNode.kind = node.kind;
+ funcNode = super.parseMethod(funcNode, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope);
+ funcNode.type = "FunctionExpression";
+ delete funcNode.kind;
+ node.value = funcNode;
+ type = type === "ClassMethod" ? "MethodDefinition" : type;
+ return this.finishNode(node, type);
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
+ const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc);
+
+ if (node) {
+ node.type = "Property";
+ if (node.kind === "method") node.kind = "init";
+ node.shorthand = false;
+ }
+
+ return node;
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ const node = super.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+
+ if (node) {
+ node.kind = "init";
+ node.type = "Property";
+ }
+
+ return node;
+ }
+
+ toAssignable(node) {
+ if (isSimpleProperty(node)) {
+ this.toAssignable(node.value);
+ return node;
+ }
+
+ return super.toAssignable(node);
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast) {
+ if (prop.kind === "get" || prop.kind === "set") {
+ throw this.raise(prop.key.start, "Object pattern can't contain getter or setter");
+ } else if (prop.method) {
+ throw this.raise(prop.key.start, "Object pattern can't contain methods");
+ } else {
+ super.toAssignableObjectExpressionProp(prop, isLast);
+ }
+ }
+
+ finishCallExpression(node, optional) {
+ super.finishCallExpression(node, optional);
+
+ if (node.callee.type === "Import") {
+ node.type = "ImportExpression";
+ node.source = node.arguments[0];
+ delete node.arguments;
+ delete node.callee;
+ }
+
+ return node;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ if (!exprList) {
+ return;
+ }
+
+ super.toReferencedListDeep(exprList, isParenthesizedExpr);
+ }
+
+});
+
+const lineBreak = /\r\n?|[\n\u2028\u2029]/;
+const lineBreakG = new RegExp(lineBreak.source, "g");
+function isNewLine(code) {
+ switch (code) {
+ case 10:
+ case 13:
+ case 8232:
+ case 8233:
+ return true;
+
+ default:
+ return false;
+ }
+}
+const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
+function isWhitespace(code) {
+ switch (code) {
+ case 0x0009:
+ case 0x000b:
+ case 0x000c:
+ case 32:
+ case 160:
+ case 5760:
+ case 0x2000:
+ case 0x2001:
+ case 0x2002:
+ case 0x2003:
+ case 0x2004:
+ case 0x2005:
+ case 0x2006:
+ case 0x2007:
+ case 0x2008:
+ case 0x2009:
+ case 0x200a:
+ case 0x202f:
+ case 0x205f:
+ case 0x3000:
+ case 0xfeff:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+class TokContext {
+ constructor(token, isExpr, preserveSpace, override) {
+ this.token = token;
+ this.isExpr = !!isExpr;
+ this.preserveSpace = !!preserveSpace;
+ this.override = override;
+ }
+
+}
+const types$1 = {
+ braceStatement: new TokContext("{", false),
+ braceExpression: new TokContext("{", true),
+ templateQuasi: new TokContext("${", false),
+ parenStatement: new TokContext("(", false),
+ parenExpression: new TokContext("(", true),
+ template: new TokContext("`", true, true, p => p.readTmplToken()),
+ functionExpression: new TokContext("function", true),
+ functionStatement: new TokContext("function", false)
+};
+
+types.parenR.updateContext = types.braceR.updateContext = function () {
+ if (this.state.context.length === 1) {
+ this.state.exprAllowed = true;
+ return;
+ }
+
+ let out = this.state.context.pop();
+
+ if (out === types$1.braceStatement && this.curContext().token === "function") {
+ out = this.state.context.pop();
+ }
+
+ this.state.exprAllowed = !out.isExpr;
+};
+
+types.name.updateContext = function (prevType) {
+ let allowed = false;
+
+ if (prevType !== types.dot) {
+ if (this.state.value === "of" && !this.state.exprAllowed || this.state.value === "yield" && this.prodParam.hasYield) {
+ allowed = true;
+ }
+ }
+
+ this.state.exprAllowed = allowed;
+
+ if (this.state.isIterator) {
+ this.state.isIterator = false;
+ }
+};
+
+types.braceL.updateContext = function (prevType) {
+ this.state.context.push(this.braceIsBlock(prevType) ? types$1.braceStatement : types$1.braceExpression);
+ this.state.exprAllowed = true;
+};
+
+types.dollarBraceL.updateContext = function () {
+ this.state.context.push(types$1.templateQuasi);
+ this.state.exprAllowed = true;
+};
+
+types.parenL.updateContext = function (prevType) {
+ const statementParens = prevType === types._if || prevType === types._for || prevType === types._with || prevType === types._while;
+ this.state.context.push(statementParens ? types$1.parenStatement : types$1.parenExpression);
+ this.state.exprAllowed = true;
+};
+
+types.incDec.updateContext = function () {};
+
+types._function.updateContext = types._class.updateContext = function (prevType) {
+ if (prevType.beforeExpr && prevType !== types.semi && prevType !== types._else && !(prevType === types._return && lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) && !((prevType === types.colon || prevType === types.braceL) && this.curContext() === types$1.b_stat)) {
+ this.state.context.push(types$1.functionExpression);
+ } else {
+ this.state.context.push(types$1.functionStatement);
+ }
+
+ this.state.exprAllowed = false;
+};
+
+types.backQuote.updateContext = function () {
+ if (this.curContext() === types$1.template) {
+ this.state.context.pop();
+ } else {
+ this.state.context.push(types$1.template);
+ }
+
+ this.state.exprAllowed = false;
+};
+
+const reservedWords = {
+ strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
+ strictBind: ["eval", "arguments"]
+};
+const reservedWordsStrictSet = new Set(reservedWords.strict);
+const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
+const isReservedWord = (word, inModule) => {
+ return inModule && word === "await" || word === "enum";
+};
+function isStrictReservedWord(word, inModule) {
+ return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
+}
+function isStrictBindOnlyReservedWord(word) {
+ return reservedWordsStrictBindSet.has(word);
+}
+function isStrictBindReservedWord(word, inModule) {
+ return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
+}
+function isKeyword(word) {
+ return keywords.has(word);
+}
+const keywordRelationalOperator = /^in(stanceof)?$/;
+let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u08a0-\u08b4\u08b6-\u08bd\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fef\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7bf\ua7c2-\ua7c6\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab67\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
+let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08d3-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1df9\u1dfb-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
+const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
+const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
+nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
+const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 477, 28, 11, 0, 9, 21, 155, 22, 13, 52, 76, 44, 33, 24, 27, 35, 30, 0, 12, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 0, 33, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 230, 43, 117, 63, 32, 0, 161, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 35, 56, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 270, 921, 103, 110, 18, 195, 2749, 1070, 4050, 582, 8634, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 754, 9486, 286, 50, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 2357, 44, 11, 6, 17, 0, 370, 43, 1301, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 3, 5761, 15, 7472, 3104, 541];
+const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 525, 10, 176, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 4, 9, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 232, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 135, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 419, 13, 1495, 6, 110, 6, 6, 9, 792487, 239];
+
+function isInAstralSet(code, set) {
+ let pos = 0x10000;
+
+ for (let i = 0, length = set.length; i < length; i += 2) {
+ pos += set[i];
+ if (pos > code) return false;
+ pos += set[i + 1];
+ if (pos >= code) return true;
+ }
+
+ return false;
+}
+
+function isIdentifierStart(code) {
+ if (code < 65) return code === 36;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes);
+}
+function isIteratorStart(current, next) {
+ return current === 64 && next === 64;
+}
+function isIdentifierChar(code) {
+ if (code < 48) return code === 36;
+ if (code < 58) return true;
+ if (code < 65) return false;
+ if (code <= 90) return true;
+ if (code < 97) return code === 95;
+ if (code <= 122) return true;
+
+ if (code <= 0xffff) {
+ return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
+ }
+
+ return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
+}
+
+const reservedTypes = new Set(["_", "any", "bool", "boolean", "empty", "extends", "false", "interface", "mixed", "null", "number", "static", "string", "true", "typeof", "void"]);
+
+function isEsModuleType(bodyElement) {
+ return bodyElement.type === "DeclareExportAllDeclaration" || bodyElement.type === "DeclareExportDeclaration" && (!bodyElement.declaration || bodyElement.declaration.type !== "TypeAlias" && bodyElement.declaration.type !== "InterfaceDeclaration");
+}
+
+function hasTypeImportKind(node) {
+ return node.importKind === "type" || node.importKind === "typeof";
+}
+
+function isMaybeDefaultImport(state) {
+ return (state.type === types.name || !!state.type.keyword) && state.value !== "from";
+}
+
+const exportSuggestions = {
+ const: "declare export var",
+ let: "declare export var",
+ type: "export type",
+ interface: "export interface"
+};
+
+function partition(list, test) {
+ const list1 = [];
+ const list2 = [];
+
+ for (let i = 0; i < list.length; i++) {
+ (test(list[i], i, list) ? list1 : list2).push(list[i]);
+ }
+
+ return [list1, list2];
+}
+
+const FLOW_PRAGMA_REGEX = /\*?\s*@((?:no)?flow)\b/;
+var flow = (superClass => class extends superClass {
+ constructor(options, input) {
+ super(options, input);
+ this.flowPragma = undefined;
+ }
+
+ shouldParseTypes() {
+ return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
+ }
+
+ shouldParseEnums() {
+ return !!this.getPluginOption("flow", "enums");
+ }
+
+ finishToken(type, val) {
+ if (type !== types.string && type !== types.semi && type !== types.interpreterDirective) {
+ if (this.flowPragma === undefined) {
+ this.flowPragma = null;
+ }
+ }
+
+ return super.finishToken(type, val);
+ }
+
+ addComment(comment) {
+ if (this.flowPragma === undefined) {
+ const matches = FLOW_PRAGMA_REGEX.exec(comment.value);
+
+ if (!matches) ; else if (matches[1] === "flow") {
+ this.flowPragma = "flow";
+ } else if (matches[1] === "noflow") {
+ this.flowPragma = "noflow";
+ } else {
+ throw new Error("Unexpected flow pragma");
+ }
+ }
+
+ return super.addComment(comment);
+ }
+
+ flowParseTypeInitialiser(tok) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(tok || types.colon);
+ const type = this.flowParseType();
+ this.state.inType = oldInType;
+ return type;
+ }
+
+ flowParsePredicate() {
+ const node = this.startNode();
+ const moduloLoc = this.state.startLoc;
+ const moduloPos = this.state.start;
+ this.expect(types.modulo);
+ const checksLoc = this.state.startLoc;
+ this.expectContextual("checks");
+
+ if (moduloLoc.line !== checksLoc.line || moduloLoc.column !== checksLoc.column - 1) {
+ this.raise(moduloPos, "Spaces between ´%´ and ´checks´ are not allowed here.");
+ }
+
+ if (this.eat(types.parenL)) {
+ node.value = this.parseExpression();
+ this.expect(types.parenR);
+ return this.finishNode(node, "DeclaredPredicate");
+ } else {
+ return this.finishNode(node, "InferredPredicate");
+ }
+ }
+
+ flowParseTypeAndPredicateInitialiser() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ this.expect(types.colon);
+ let type = null;
+ let predicate = null;
+
+ if (this.match(types.modulo)) {
+ this.state.inType = oldInType;
+ predicate = this.flowParsePredicate();
+ } else {
+ type = this.flowParseType();
+ this.state.inType = oldInType;
+
+ if (this.match(types.modulo)) {
+ predicate = this.flowParsePredicate();
+ }
+ }
+
+ return [type, predicate];
+ }
+
+ flowParseDeclareClass(node) {
+ this.next();
+ this.flowParseInterfaceish(node, true);
+ return this.finishNode(node, "DeclareClass");
+ }
+
+ flowParseDeclareFunction(node) {
+ this.next();
+ const id = node.id = this.parseIdentifier();
+ const typeNode = this.startNode();
+ const typeContainer = this.startNode();
+
+ if (this.isRelational("<")) {
+ typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ typeNode.typeParameters = null;
+ }
+
+ this.expect(types.parenL);
+ const tmp = this.flowParseFunctionTypeParams();
+ typeNode.params = tmp.params;
+ typeNode.rest = tmp.rest;
+ this.expect(types.parenR);
+ [typeNode.returnType, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
+ id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
+ this.resetEndLocation(id);
+ this.semicolon();
+ return this.finishNode(node, "DeclareFunction");
+ }
+
+ flowParseDeclare(node, insideModule) {
+ if (this.match(types._class)) {
+ return this.flowParseDeclareClass(node);
+ } else if (this.match(types._function)) {
+ return this.flowParseDeclareFunction(node);
+ } else if (this.match(types._var)) {
+ return this.flowParseDeclareVariable(node);
+ } else if (this.eatContextual("module")) {
+ if (this.match(types.dot)) {
+ return this.flowParseDeclareModuleExports(node);
+ } else {
+ if (insideModule) {
+ this.raise(this.state.lastTokStart, "`declare module` cannot be used inside another `declare module`");
+ }
+
+ return this.flowParseDeclareModule(node);
+ }
+ } else if (this.isContextual("type")) {
+ return this.flowParseDeclareTypeAlias(node);
+ } else if (this.isContextual("opaque")) {
+ return this.flowParseDeclareOpaqueType(node);
+ } else if (this.isContextual("interface")) {
+ return this.flowParseDeclareInterface(node);
+ } else if (this.match(types._export)) {
+ return this.flowParseDeclareExportDeclaration(node, insideModule);
+ } else {
+ throw this.unexpected();
+ }
+ }
+
+ flowParseDeclareVariable(node) {
+ this.next();
+ node.id = this.flowParseTypeAnnotatableIdentifier(true);
+ this.scope.declareName(node.id.name, BIND_VAR, node.id.start);
+ this.semicolon();
+ return this.finishNode(node, "DeclareVariable");
+ }
+
+ flowParseDeclareModule(node) {
+ this.scope.enter(SCOPE_OTHER);
+
+ if (this.match(types.string)) {
+ node.id = this.parseExprAtom();
+ } else {
+ node.id = this.parseIdentifier();
+ }
+
+ const bodyNode = node.body = this.startNode();
+ const body = bodyNode.body = [];
+ this.expect(types.braceL);
+
+ while (!this.match(types.braceR)) {
+ let bodyNode = this.startNode();
+
+ if (this.match(types._import)) {
+ this.next();
+
+ if (!this.isContextual("type") && !this.match(types._typeof)) {
+ this.raise(this.state.lastTokStart, "Imports within a `declare module` body must always be `import type` or `import typeof`");
+ }
+
+ this.parseImport(bodyNode);
+ } else {
+ this.expectContextual("declare", "Only declares and type imports are allowed inside declare module");
+ bodyNode = this.flowParseDeclare(bodyNode, true);
+ }
+
+ body.push(bodyNode);
+ }
+
+ this.scope.exit();
+ this.expect(types.braceR);
+ this.finishNode(bodyNode, "BlockStatement");
+ let kind = null;
+ let hasModuleExport = false;
+ const errorMessage = "Found both `declare module.exports` and `declare export` in the same module. " + "Modules can only have 1 since they are either an ES module or they are a CommonJS module";
+ body.forEach(bodyElement => {
+ if (isEsModuleType(bodyElement)) {
+ if (kind === "CommonJS") {
+ this.raise(bodyElement.start, errorMessage);
+ }
+
+ kind = "ES";
+ } else if (bodyElement.type === "DeclareModuleExports") {
+ if (hasModuleExport) {
+ this.raise(bodyElement.start, "Duplicate `declare module.exports` statement");
+ }
+
+ if (kind === "ES") this.raise(bodyElement.start, errorMessage);
+ kind = "CommonJS";
+ hasModuleExport = true;
+ }
+ });
+ node.kind = kind || "CommonJS";
+ return this.finishNode(node, "DeclareModule");
+ }
+
+ flowParseDeclareExportDeclaration(node, insideModule) {
+ this.expect(types._export);
+
+ if (this.eat(types._default)) {
+ if (this.match(types._function) || this.match(types._class)) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ } else {
+ node.declaration = this.flowParseType();
+ this.semicolon();
+ }
+
+ node.default = true;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else {
+ if (this.match(types._const) || this.isLet() || (this.isContextual("type") || this.isContextual("interface")) && !insideModule) {
+ const label = this.state.value;
+ const suggestion = exportSuggestions[label];
+ this.unexpected(this.state.start, `\`declare export ${label}\` is not supported. Use \`${suggestion}\` instead`);
+ }
+
+ if (this.match(types._var) || this.match(types._function) || this.match(types._class) || this.isContextual("opaque")) {
+ node.declaration = this.flowParseDeclare(this.startNode());
+ node.default = false;
+ return this.finishNode(node, "DeclareExportDeclaration");
+ } else if (this.match(types.star) || this.match(types.braceL) || this.isContextual("interface") || this.isContextual("type") || this.isContextual("opaque")) {
+ node = this.parseExport(node);
+
+ if (node.type === "ExportNamedDeclaration") {
+ node.type = "ExportDeclaration";
+ node.default = false;
+ delete node.exportKind;
+ }
+
+ node.type = "Declare" + node.type;
+ return node;
+ }
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParseDeclareModuleExports(node) {
+ this.next();
+ this.expectContextual("exports");
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ this.semicolon();
+ return this.finishNode(node, "DeclareModuleExports");
+ }
+
+ flowParseDeclareTypeAlias(node) {
+ this.next();
+ this.flowParseTypeAlias(node);
+ node.type = "DeclareTypeAlias";
+ return node;
+ }
+
+ flowParseDeclareOpaqueType(node) {
+ this.next();
+ this.flowParseOpaqueType(node, true);
+ node.type = "DeclareOpaqueType";
+ return node;
+ }
+
+ flowParseDeclareInterface(node) {
+ this.next();
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "DeclareInterface");
+ }
+
+ flowParseInterfaceish(node, isClass = false) {
+ node.id = this.flowParseRestrictedIdentifier(!isClass, true);
+ this.scope.declareName(node.id.name, isClass ? BIND_FUNCTION : BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.extends = [];
+ node.implements = [];
+ node.mixins = [];
+
+ if (this.eat(types._extends)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (!isClass && this.eat(types.comma));
+ }
+
+ if (this.isContextual("mixins")) {
+ this.next();
+
+ do {
+ node.mixins.push(this.flowParseInterfaceExtends());
+ } while (this.eat(types.comma));
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+
+ do {
+ node.implements.push(this.flowParseInterfaceExtends());
+ } while (this.eat(types.comma));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: isClass,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: isClass,
+ allowInexact: false
+ });
+ }
+
+ flowParseInterfaceExtends() {
+ const node = this.startNode();
+ node.id = this.flowParseQualifiedTypeIdentifier();
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ return this.finishNode(node, "InterfaceExtends");
+ }
+
+ flowParseInterface(node) {
+ this.flowParseInterfaceish(node);
+ return this.finishNode(node, "InterfaceDeclaration");
+ }
+
+ checkNotUnderscore(word) {
+ if (word === "_") {
+ this.raise(this.state.start, "`_` is only allowed as a type argument to call or new");
+ }
+ }
+
+ checkReservedType(word, startLoc, declaration) {
+ if (!reservedTypes.has(word)) return;
+
+ if (declaration) {
+ this.raise(startLoc, `Cannot overwrite reserved type ${word}`);
+ return;
+ }
+
+ this.raise(startLoc, `Unexpected reserved type ${word}`);
+ }
+
+ flowParseRestrictedIdentifier(liberal, declaration) {
+ this.checkReservedType(this.state.value, this.state.start, declaration);
+ return this.parseIdentifier(liberal);
+ }
+
+ flowParseTypeAlias(node) {
+ node.id = this.flowParseRestrictedIdentifier(false, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.right = this.flowParseTypeInitialiser(types.eq);
+ this.semicolon();
+ return this.finishNode(node, "TypeAlias");
+ }
+
+ flowParseOpaqueType(node, declare) {
+ this.expectContextual("type");
+ node.id = this.flowParseRestrictedIdentifier(true, true);
+ this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ } else {
+ node.typeParameters = null;
+ }
+
+ node.supertype = null;
+
+ if (this.match(types.colon)) {
+ node.supertype = this.flowParseTypeInitialiser(types.colon);
+ }
+
+ node.impltype = null;
+
+ if (!declare) {
+ node.impltype = this.flowParseTypeInitialiser(types.eq);
+ }
+
+ this.semicolon();
+ return this.finishNode(node, "OpaqueType");
+ }
+
+ flowParseTypeParameter(requireDefault = false) {
+ const nodeStart = this.state.start;
+ const node = this.startNode();
+ const variance = this.flowParseVariance();
+ const ident = this.flowParseTypeAnnotatableIdentifier();
+ node.name = ident.name;
+ node.variance = variance;
+ node.bound = ident.typeAnnotation;
+
+ if (this.match(types.eq)) {
+ this.eat(types.eq);
+ node.default = this.flowParseType();
+ } else {
+ if (requireDefault) {
+ this.raise(nodeStart, "Type parameter declaration needs a default, since a preceding type parameter declaration has a default.");
+ }
+ }
+
+ return this.finishNode(node, "TypeParameter");
+ }
+
+ flowParseTypeParameterDeclaration() {
+ const oldInType = this.state.inType;
+ const node = this.startNode();
+ node.params = [];
+ this.state.inType = true;
+
+ if (this.isRelational("<") || this.match(types.jsxTagStart)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ let defaultRequired = false;
+
+ do {
+ const typeParameter = this.flowParseTypeParameter(defaultRequired);
+ node.params.push(typeParameter);
+
+ if (typeParameter.default) {
+ defaultRequired = true;
+ }
+
+ if (!this.isRelational(">")) {
+ this.expect(types.comma);
+ }
+ } while (!this.isRelational(">"));
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterDeclaration");
+ }
+
+ flowParseTypeParameterInstantiation() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = false;
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseType());
+
+ if (!this.isRelational(">")) {
+ this.expect(types.comma);
+ }
+ }
+
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseTypeParameterInstantiationCallOrNew() {
+ const node = this.startNode();
+ const oldInType = this.state.inType;
+ node.params = [];
+ this.state.inType = true;
+ this.expectRelational("<");
+
+ while (!this.isRelational(">")) {
+ node.params.push(this.flowParseTypeOrImplicitInstantiation());
+
+ if (!this.isRelational(">")) {
+ this.expect(types.comma);
+ }
+ }
+
+ this.expectRelational(">");
+ this.state.inType = oldInType;
+ return this.finishNode(node, "TypeParameterInstantiation");
+ }
+
+ flowParseInterfaceType() {
+ const node = this.startNode();
+ this.expectContextual("interface");
+ node.extends = [];
+
+ if (this.eat(types._extends)) {
+ do {
+ node.extends.push(this.flowParseInterfaceExtends());
+ } while (this.eat(types.comma));
+ }
+
+ node.body = this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: false,
+ allowProto: false,
+ allowInexact: false
+ });
+ return this.finishNode(node, "InterfaceTypeAnnotation");
+ }
+
+ flowParseObjectPropertyKey() {
+ return this.match(types.num) || this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
+ }
+
+ flowParseObjectTypeIndexer(node, isStatic, variance) {
+ node.static = isStatic;
+
+ if (this.lookahead().type === types.colon) {
+ node.id = this.flowParseObjectPropertyKey();
+ node.key = this.flowParseTypeInitialiser();
+ } else {
+ node.id = null;
+ node.key = this.flowParseType();
+ }
+
+ this.expect(types.bracketR);
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ return this.finishNode(node, "ObjectTypeIndexer");
+ }
+
+ flowParseObjectTypeInternalSlot(node, isStatic) {
+ node.static = isStatic;
+ node.id = this.flowParseObjectPropertyKey();
+ this.expect(types.bracketR);
+ this.expect(types.bracketR);
+
+ if (this.isRelational("<") || this.match(types.parenL)) {
+ node.method = true;
+ node.optional = false;
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+ } else {
+ node.method = false;
+
+ if (this.eat(types.question)) {
+ node.optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ }
+
+ return this.finishNode(node, "ObjectTypeInternalSlot");
+ }
+
+ flowParseObjectTypeMethodish(node) {
+ node.params = [];
+ node.rest = null;
+ node.typeParameters = null;
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ this.expect(types.parenL);
+
+ while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
+ node.params.push(this.flowParseFunctionTypeParam());
+
+ if (!this.match(types.parenR)) {
+ this.expect(types.comma);
+ }
+ }
+
+ if (this.eat(types.ellipsis)) {
+ node.rest = this.flowParseFunctionTypeParam();
+ }
+
+ this.expect(types.parenR);
+ node.returnType = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ flowParseObjectTypeCallProperty(node, isStatic) {
+ const valueNode = this.startNode();
+ node.static = isStatic;
+ node.value = this.flowParseObjectTypeMethodish(valueNode);
+ return this.finishNode(node, "ObjectTypeCallProperty");
+ }
+
+ flowParseObjectType({
+ allowStatic,
+ allowExact,
+ allowSpread,
+ allowProto,
+ allowInexact
+ }) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const nodeStart = this.startNode();
+ nodeStart.callProperties = [];
+ nodeStart.properties = [];
+ nodeStart.indexers = [];
+ nodeStart.internalSlots = [];
+ let endDelim;
+ let exact;
+ let inexact = false;
+
+ if (allowExact && this.match(types.braceBarL)) {
+ this.expect(types.braceBarL);
+ endDelim = types.braceBarR;
+ exact = true;
+ } else {
+ this.expect(types.braceL);
+ endDelim = types.braceR;
+ exact = false;
+ }
+
+ nodeStart.exact = exact;
+
+ while (!this.match(endDelim)) {
+ let isStatic = false;
+ let protoStart = null;
+ let inexactStart = null;
+ const node = this.startNode();
+
+ if (allowProto && this.isContextual("proto")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== types.colon && lookahead.type !== types.question) {
+ this.next();
+ protoStart = this.state.start;
+ allowStatic = false;
+ }
+ }
+
+ if (allowStatic && this.isContextual("static")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type !== types.colon && lookahead.type !== types.question) {
+ this.next();
+ isStatic = true;
+ }
+ }
+
+ const variance = this.flowParseVariance();
+
+ if (this.eat(types.bracketL)) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (this.eat(types.bracketL)) {
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
+ } else {
+ nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
+ }
+ } else if (this.match(types.parenL) || this.isRelational("<")) {
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
+ } else {
+ let kind = "init";
+
+ if (this.isContextual("get") || this.isContextual("set")) {
+ const lookahead = this.lookahead();
+
+ if (lookahead.type === types.name || lookahead.type === types.string || lookahead.type === types.num) {
+ kind = this.state.value;
+ this.next();
+ }
+ }
+
+ const propOrInexact = this.flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact != null ? allowInexact : !exact);
+
+ if (propOrInexact === null) {
+ inexact = true;
+ inexactStart = this.state.lastTokStart;
+ } else {
+ nodeStart.properties.push(propOrInexact);
+ }
+ }
+
+ this.flowObjectTypeSemicolon();
+
+ if (inexactStart && !this.match(types.braceR) && !this.match(types.braceBarR)) {
+ this.raise(inexactStart, "Explicit inexact syntax must appear at the end of an inexact object");
+ }
+ }
+
+ this.expect(endDelim);
+
+ if (allowSpread) {
+ nodeStart.inexact = inexact;
+ }
+
+ const out = this.finishNode(nodeStart, "ObjectTypeAnnotation");
+ this.state.inType = oldInType;
+ return out;
+ }
+
+ flowParseObjectTypeProperty(node, isStatic, protoStart, variance, kind, allowSpread, allowInexact) {
+ if (this.eat(types.ellipsis)) {
+ const isInexactToken = this.match(types.comma) || this.match(types.semi) || this.match(types.braceR) || this.match(types.braceBarR);
+
+ if (isInexactToken) {
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, "Explicit inexact syntax cannot appear in class or interface definitions");
+ } else if (!allowInexact) {
+ this.raise(this.state.lastTokStart, "Explicit inexact syntax cannot appear inside an explicit exact object type");
+ }
+
+ if (variance) {
+ this.raise(variance.start, "Explicit inexact syntax cannot have variance");
+ }
+
+ return null;
+ }
+
+ if (!allowSpread) {
+ this.raise(this.state.lastTokStart, "Spread operator cannot appear in class or interface definitions");
+ }
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.raise(variance.start, "Spread properties cannot have variance");
+ }
+
+ node.argument = this.flowParseType();
+ return this.finishNode(node, "ObjectTypeSpreadProperty");
+ } else {
+ node.key = this.flowParseObjectPropertyKey();
+ node.static = isStatic;
+ node.proto = protoStart != null;
+ node.kind = kind;
+ let optional = false;
+
+ if (this.isRelational("<") || this.match(types.parenL)) {
+ node.method = true;
+
+ if (protoStart != null) {
+ this.unexpected(protoStart);
+ }
+
+ if (variance) {
+ this.unexpected(variance.start);
+ }
+
+ node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(node.start, node.loc.start));
+
+ if (kind === "get" || kind === "set") {
+ this.flowCheckGetterSetterParams(node);
+ }
+ } else {
+ if (kind !== "init") this.unexpected();
+ node.method = false;
+
+ if (this.eat(types.question)) {
+ optional = true;
+ }
+
+ node.value = this.flowParseTypeInitialiser();
+ node.variance = variance;
+ }
+
+ node.optional = optional;
+ return this.finishNode(node, "ObjectTypeProperty");
+ }
+ }
+
+ flowCheckGetterSetterParams(property) {
+ const paramCount = property.kind === "get" ? 0 : 1;
+ const start = property.start;
+ const length = property.value.params.length + (property.value.rest ? 1 : 0);
+
+ if (length !== paramCount) {
+ if (property.kind === "get") {
+ this.raise(start, "getter must not have any formal parameters");
+ } else {
+ this.raise(start, "setter must have exactly one formal parameter");
+ }
+ }
+
+ if (property.kind === "set" && property.value.rest) {
+ this.raise(start, "setter function argument must not be a rest parameter");
+ }
+ }
+
+ flowObjectTypeSemicolon() {
+ if (!this.eat(types.semi) && !this.eat(types.comma) && !this.match(types.braceR) && !this.match(types.braceBarR)) {
+ this.unexpected();
+ }
+ }
+
+ flowParseQualifiedTypeIdentifier(startPos, startLoc, id) {
+ startPos = startPos || this.state.start;
+ startLoc = startLoc || this.state.startLoc;
+ let node = id || this.flowParseRestrictedIdentifier(true);
+
+ while (this.eat(types.dot)) {
+ const node2 = this.startNodeAt(startPos, startLoc);
+ node2.qualification = node;
+ node2.id = this.flowParseRestrictedIdentifier(true);
+ node = this.finishNode(node2, "QualifiedTypeIdentifier");
+ }
+
+ return node;
+ }
+
+ flowParseGenericType(startPos, startLoc, id) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = null;
+ node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ return this.finishNode(node, "GenericTypeAnnotation");
+ }
+
+ flowParseTypeofType() {
+ const node = this.startNode();
+ this.expect(types._typeof);
+ node.argument = this.flowParsePrimaryType();
+ return this.finishNode(node, "TypeofTypeAnnotation");
+ }
+
+ flowParseTupleType() {
+ const node = this.startNode();
+ node.types = [];
+ this.expect(types.bracketL);
+
+ while (this.state.pos < this.length && !this.match(types.bracketR)) {
+ node.types.push(this.flowParseType());
+ if (this.match(types.bracketR)) break;
+ this.expect(types.comma);
+ }
+
+ this.expect(types.bracketR);
+ return this.finishNode(node, "TupleTypeAnnotation");
+ }
+
+ flowParseFunctionTypeParam() {
+ let name = null;
+ let optional = false;
+ let typeAnnotation = null;
+ const node = this.startNode();
+ const lh = this.lookahead();
+
+ if (lh.type === types.colon || lh.type === types.question) {
+ name = this.parseIdentifier();
+
+ if (this.eat(types.question)) {
+ optional = true;
+ }
+
+ typeAnnotation = this.flowParseTypeInitialiser();
+ } else {
+ typeAnnotation = this.flowParseType();
+ }
+
+ node.name = name;
+ node.optional = optional;
+ node.typeAnnotation = typeAnnotation;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ reinterpretTypeAsFunctionTypeParam(type) {
+ const node = this.startNodeAt(type.start, type.loc.start);
+ node.name = null;
+ node.optional = false;
+ node.typeAnnotation = type;
+ return this.finishNode(node, "FunctionTypeParam");
+ }
+
+ flowParseFunctionTypeParams(params = []) {
+ let rest = null;
+
+ while (!this.match(types.parenR) && !this.match(types.ellipsis)) {
+ params.push(this.flowParseFunctionTypeParam());
+
+ if (!this.match(types.parenR)) {
+ this.expect(types.comma);
+ }
+ }
+
+ if (this.eat(types.ellipsis)) {
+ rest = this.flowParseFunctionTypeParam();
+ }
+
+ return {
+ params,
+ rest
+ };
+ }
+
+ flowIdentToTypeAnnotation(startPos, startLoc, node, id) {
+ switch (id.name) {
+ case "any":
+ return this.finishNode(node, "AnyTypeAnnotation");
+
+ case "bool":
+ case "boolean":
+ return this.finishNode(node, "BooleanTypeAnnotation");
+
+ case "mixed":
+ return this.finishNode(node, "MixedTypeAnnotation");
+
+ case "empty":
+ return this.finishNode(node, "EmptyTypeAnnotation");
+
+ case "number":
+ return this.finishNode(node, "NumberTypeAnnotation");
+
+ case "string":
+ return this.finishNode(node, "StringTypeAnnotation");
+
+ default:
+ this.checkNotUnderscore(id.name);
+ return this.flowParseGenericType(startPos, startLoc, id);
+ }
+ }
+
+ flowParsePrimaryType() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.startNode();
+ let tmp;
+ let type;
+ let isGroupedType = false;
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+
+ switch (this.state.type) {
+ case types.name:
+ if (this.isContextual("interface")) {
+ return this.flowParseInterfaceType();
+ }
+
+ return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
+
+ case types.braceL:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: false,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: true
+ });
+
+ case types.braceBarL:
+ return this.flowParseObjectType({
+ allowStatic: false,
+ allowExact: true,
+ allowSpread: true,
+ allowProto: false,
+ allowInexact: false
+ });
+
+ case types.bracketL:
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseTupleType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ return type;
+
+ case types.relational:
+ if (this.state.value === "<") {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ this.expect(types.parenL);
+ tmp = this.flowParseFunctionTypeParams();
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ this.expect(types.parenR);
+ this.expect(types.arrow);
+ node.returnType = this.flowParseType();
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ break;
+
+ case types.parenL:
+ this.next();
+
+ if (!this.match(types.parenR) && !this.match(types.ellipsis)) {
+ if (this.match(types.name)) {
+ const token = this.lookahead().type;
+ isGroupedType = token !== types.question && token !== types.colon;
+ } else {
+ isGroupedType = true;
+ }
+ }
+
+ if (isGroupedType) {
+ this.state.noAnonFunctionType = false;
+ type = this.flowParseType();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+
+ if (this.state.noAnonFunctionType || !(this.match(types.comma) || this.match(types.parenR) && this.lookahead().type === types.arrow)) {
+ this.expect(types.parenR);
+ return type;
+ } else {
+ this.eat(types.comma);
+ }
+ }
+
+ if (type) {
+ tmp = this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(type)]);
+ } else {
+ tmp = this.flowParseFunctionTypeParams();
+ }
+
+ node.params = tmp.params;
+ node.rest = tmp.rest;
+ this.expect(types.parenR);
+ this.expect(types.arrow);
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+
+ case types.string:
+ return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
+
+ case types._true:
+ case types._false:
+ node.value = this.match(types._true);
+ this.next();
+ return this.finishNode(node, "BooleanLiteralTypeAnnotation");
+
+ case types.plusMin:
+ if (this.state.value === "-") {
+ this.next();
+
+ if (this.match(types.num)) {
+ return this.parseLiteral(-this.state.value, "NumberLiteralTypeAnnotation", node.start, node.loc.start);
+ }
+
+ if (this.match(types.bigint)) {
+ return this.parseLiteral(-this.state.value, "BigIntLiteralTypeAnnotation", node.start, node.loc.start);
+ }
+
+ throw this.raise(this.state.start, `Unexpected token, expected "number" or "bigint"`);
+ }
+
+ throw this.unexpected();
+
+ case types.num:
+ return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
+
+ case types.bigint:
+ return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
+
+ case types._void:
+ this.next();
+ return this.finishNode(node, "VoidTypeAnnotation");
+
+ case types._null:
+ this.next();
+ return this.finishNode(node, "NullLiteralTypeAnnotation");
+
+ case types._this:
+ this.next();
+ return this.finishNode(node, "ThisTypeAnnotation");
+
+ case types.star:
+ this.next();
+ return this.finishNode(node, "ExistsTypeAnnotation");
+
+ default:
+ if (this.state.type.keyword === "typeof") {
+ return this.flowParseTypeofType();
+ } else if (this.state.type.keyword) {
+ const label = this.state.type.label;
+ this.next();
+ return super.createIdentifier(node, label);
+ }
+
+ }
+
+ throw this.unexpected();
+ }
+
+ flowParsePostfixType() {
+ const startPos = this.state.start,
+ startLoc = this.state.startLoc;
+ let type = this.flowParsePrimaryType();
+
+ while (this.match(types.bracketL) && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.elementType = type;
+ this.expect(types.bracketL);
+ this.expect(types.bracketR);
+ type = this.finishNode(node, "ArrayTypeAnnotation");
+ }
+
+ return type;
+ }
+
+ flowParsePrefixType() {
+ const node = this.startNode();
+
+ if (this.eat(types.question)) {
+ node.typeAnnotation = this.flowParsePrefixType();
+ return this.finishNode(node, "NullableTypeAnnotation");
+ } else {
+ return this.flowParsePostfixType();
+ }
+ }
+
+ flowParseAnonFunctionWithoutParens() {
+ const param = this.flowParsePrefixType();
+
+ if (!this.state.noAnonFunctionType && this.eat(types.arrow)) {
+ const node = this.startNodeAt(param.start, param.loc.start);
+ node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
+ node.rest = null;
+ node.returnType = this.flowParseType();
+ node.typeParameters = null;
+ return this.finishNode(node, "FunctionTypeAnnotation");
+ }
+
+ return param;
+ }
+
+ flowParseIntersectionType() {
+ const node = this.startNode();
+ this.eat(types.bitwiseAND);
+ const type = this.flowParseAnonFunctionWithoutParens();
+ node.types = [type];
+
+ while (this.eat(types.bitwiseAND)) {
+ node.types.push(this.flowParseAnonFunctionWithoutParens());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation");
+ }
+
+ flowParseUnionType() {
+ const node = this.startNode();
+ this.eat(types.bitwiseOR);
+ const type = this.flowParseIntersectionType();
+ node.types = [type];
+
+ while (this.eat(types.bitwiseOR)) {
+ node.types.push(this.flowParseIntersectionType());
+ }
+
+ return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation");
+ }
+
+ flowParseType() {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+ const type = this.flowParseUnionType();
+ this.state.inType = oldInType;
+ this.state.exprAllowed = this.state.exprAllowed || this.state.noAnonFunctionType;
+ return type;
+ }
+
+ flowParseTypeOrImplicitInstantiation() {
+ if (this.state.type === types.name && this.state.value === "_") {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const node = this.parseIdentifier();
+ return this.flowParseGenericType(startPos, startLoc, node);
+ } else {
+ return this.flowParseType();
+ }
+ }
+
+ flowParseTypeAnnotation() {
+ const node = this.startNode();
+ node.typeAnnotation = this.flowParseTypeInitialiser();
+ return this.finishNode(node, "TypeAnnotation");
+ }
+
+ flowParseTypeAnnotatableIdentifier(allowPrimitiveOverride) {
+ const ident = allowPrimitiveOverride ? this.parseIdentifier() : this.flowParseRestrictedIdentifier();
+
+ if (this.match(types.colon)) {
+ ident.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(ident);
+ }
+
+ return ident;
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ flowParseVariance() {
+ let variance = null;
+
+ if (this.match(types.plusMin)) {
+ variance = this.startNode();
+
+ if (this.state.value === "+") {
+ variance.kind = "plus";
+ } else {
+ variance.kind = "minus";
+ }
+
+ this.next();
+ this.finishNode(variance, "Variance");
+ }
+
+ return variance;
+ }
+
+ parseFunctionBody(node, allowExpressionBody, isMethod = false) {
+ if (allowExpressionBody) {
+ return this.forwardNoArrowParamsConversionAt(node, () => super.parseFunctionBody(node, true, isMethod));
+ }
+
+ return super.parseFunctionBody(node, false, isMethod);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(types.colon)) {
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ node.returnType = typeNode.typeAnnotation ? this.finishNode(typeNode, "TypeAnnotation") : null;
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.state.strict && this.match(types.name) && this.state.value === "interface") {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseInterface(node);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ } else {
+ const stmt = super.parseStatement(context, topLevel);
+
+ if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
+ this.flowPragma = null;
+ }
+
+ return stmt;
+ }
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type === "Identifier") {
+ if (expr.name === "declare") {
+ if (this.match(types._class) || this.match(types.name) || this.match(types._function) || this.match(types._var) || this.match(types._export)) {
+ return this.flowParseDeclare(node);
+ }
+ } else if (this.match(types.name)) {
+ if (expr.name === "interface") {
+ return this.flowParseInterface(node);
+ } else if (expr.name === "type") {
+ return this.flowParseTypeAlias(node);
+ } else if (expr.name === "opaque") {
+ return this.flowParseOpaqueType(node, false);
+ }
+ }
+ }
+
+ return super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ return this.isContextual("type") || this.isContextual("interface") || this.isContextual("opaque") || this.shouldParseEnums() && this.isContextual("enum") || super.shouldParseExportDeclaration();
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types.name) && (this.state.value === "type" || this.state.value === "interface" || this.state.value === "opaque" || this.shouldParseEnums() && this.state.value === "enum")) {
+ return false;
+ }
+
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseExportDefaultExpression() {
+ if (this.shouldParseEnums() && this.isContextual("enum")) {
+ const node = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(node);
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
+ if (!this.match(types.question)) return expr;
+
+ if (refNeedsArrowPos) {
+ const result = this.tryParse(() => super.parseConditional(expr, noIn, startPos, startLoc));
+
+ if (!result.node) {
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ this.expect(types.question);
+ const state = this.state.clone();
+ const originalNoArrowAt = this.state.noArrowAt;
+ const node = this.startNodeAt(startPos, startLoc);
+ let {
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent();
+ let [valid, invalid] = this.getArrowLikeExpressions(consequent);
+
+ if (failed || invalid.length > 0) {
+ const noArrowAt = [...originalNoArrowAt];
+
+ if (invalid.length > 0) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt;
+
+ for (let i = 0; i < invalid.length; i++) {
+ noArrowAt.push(invalid[i].start);
+ }
+
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ [valid, invalid] = this.getArrowLikeExpressions(consequent);
+ }
+
+ if (failed && valid.length > 1) {
+ this.raise(state.start, "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.");
+ }
+
+ if (failed && valid.length === 1) {
+ this.state = state;
+ this.state.noArrowAt = noArrowAt.concat(valid[0].start);
+ ({
+ consequent,
+ failed
+ } = this.tryParseConditionalConsequent());
+ }
+ }
+
+ this.getArrowLikeExpressions(consequent, true);
+ this.state.noArrowAt = originalNoArrowAt;
+ this.expect(types.colon);
+ node.test = expr;
+ node.consequent = consequent;
+ node.alternate = this.forwardNoArrowParamsConversionAt(node, () => this.parseMaybeAssign(noIn, undefined, undefined, undefined));
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ tryParseConditionalConsequent() {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ const consequent = this.parseMaybeAssign();
+ const failed = !this.match(types.colon);
+ this.state.noArrowParamsConversionAt.pop();
+ return {
+ consequent,
+ failed
+ };
+ }
+
+ getArrowLikeExpressions(node, disallowInvalid) {
+ const stack = [node];
+ const arrows = [];
+
+ while (stack.length !== 0) {
+ const node = stack.pop();
+
+ if (node.type === "ArrowFunctionExpression") {
+ if (node.typeParameters || !node.returnType) {
+ this.finishArrowValidation(node);
+ } else {
+ arrows.push(node);
+ }
+
+ stack.push(node.body);
+ } else if (node.type === "ConditionalExpression") {
+ stack.push(node.consequent);
+ stack.push(node.alternate);
+ }
+ }
+
+ if (disallowInvalid) {
+ arrows.forEach(node => this.finishArrowValidation(node));
+ return [arrows, []];
+ }
+
+ return partition(arrows, node => node.params.every(param => this.isAssignable(param, true)));
+ }
+
+ finishArrowValidation(node) {
+ var _node$extra;
+
+ this.toAssignableList(node.params, (_node$extra = node.extra) == null ? void 0 : _node$extra.trailingComma);
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ super.checkParams(node, false, true);
+ this.scope.exit();
+ }
+
+ forwardNoArrowParamsConversionAt(node, parse) {
+ let result;
+
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ this.state.noArrowParamsConversionAt.push(this.state.start);
+ result = parse();
+ this.state.noArrowParamsConversionAt.pop();
+ } else {
+ result = parse();
+ }
+
+ return result;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(types.question)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(types.colon)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TypeCastExpression");
+ }
+
+ return node;
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (node.type === "ImportDeclaration" && (node.importKind === "type" || node.importKind === "typeof") || node.type === "ExportNamedDeclaration" && node.exportKind === "type" || node.type === "ExportAllDeclaration" && node.exportKind === "type") {
+ return;
+ }
+
+ super.assertModuleNodeAllowed(node);
+ }
+
+ parseExport(node) {
+ const decl = super.parseExport(node);
+
+ if (decl.type === "ExportNamedDeclaration" || decl.type === "ExportAllDeclaration") {
+ decl.exportKind = decl.exportKind || "value";
+ }
+
+ return decl;
+ }
+
+ parseExportDeclaration(node) {
+ if (this.isContextual("type")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+
+ if (this.match(types.braceL)) {
+ node.specifiers = this.parseExportSpecifiers();
+ this.parseExportFrom(node);
+ return null;
+ } else {
+ return this.flowParseTypeAlias(declarationNode);
+ }
+ } else if (this.isContextual("opaque")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseOpaqueType(declarationNode, false);
+ } else if (this.isContextual("interface")) {
+ node.exportKind = "type";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseInterface(declarationNode);
+ } else if (this.shouldParseEnums() && this.isContextual("enum")) {
+ node.exportKind = "value";
+ const declarationNode = this.startNode();
+ this.next();
+ return this.flowParseEnumDeclaration(declarationNode);
+ } else {
+ return super.parseExportDeclaration(node);
+ }
+ }
+
+ eatExportStar(node) {
+ if (super.eatExportStar(...arguments)) return true;
+
+ if (this.isContextual("type") && this.lookahead().type === types.star) {
+ node.exportKind = "type";
+ this.next();
+ this.next();
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ const pos = this.state.start;
+ const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);
+
+ if (hasNamespace && node.exportKind === "type") {
+ this.unexpected(pos);
+ }
+
+ return hasNamespace;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ super.parseClassId(node, isStatement, optionalId);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+ }
+
+ getTokenFromCode(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 123 && next === 124) {
+ return this.finishOp(types.braceBarL, 2);
+ } else if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(types.relational, 1);
+ } else if (isIteratorStart(code, next)) {
+ this.state.isIterator = true;
+ return super.readWord();
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ isAssignable(node, isBinding) {
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ return true;
+
+ case "ObjectExpression":
+ {
+ const last = node.properties.length - 1;
+ return node.properties.every((prop, i) => {
+ return prop.type !== "ObjectMethod" && (i === last || prop.type === "SpreadElement") && this.isAssignable(prop);
+ });
+ }
+
+ case "ObjectProperty":
+ return this.isAssignable(node.value);
+
+ case "SpreadElement":
+ return this.isAssignable(node.argument);
+
+ case "ArrayExpression":
+ return node.elements.every(element => this.isAssignable(element));
+
+ case "AssignmentExpression":
+ return node.operator === "=";
+
+ case "ParenthesizedExpression":
+ case "TypeCastExpression":
+ return this.isAssignable(node.expression);
+
+ case "MemberExpression":
+ case "OptionalMemberExpression":
+ return !isBinding;
+
+ default:
+ return false;
+ }
+ }
+
+ toAssignable(node) {
+ if (node.type === "TypeCastExpression") {
+ return super.toAssignable(this.typeCastToParameter(node));
+ } else {
+ return super.toAssignable(node);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TypeCastExpression") {
+ exprList[i] = this.typeCastToParameter(expr);
+ }
+ }
+
+ return super.toAssignableList(exprList, trailingCommaPos);
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TypeCastExpression" && (!expr.extra || !expr.extra.parenthesized) && (exprList.length > 1 || !isParenthesizedExpr)) {
+ this.raise(expr.typeAnnotation.start, "The type cast expression is expected to be wrapped with parenthesis");
+ }
+ }
+
+ return exprList;
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) {
+ if (expr.type !== "TypeCastExpression") {
+ return super.checkLVal(expr, bindingType, checkClashes, contextDescription);
+ }
+ }
+
+ parseClassProperty(node) {
+ if (this.match(types.colon)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (this.match(types.colon)) {
+ node.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ return super.parseClassPrivateProperty(node);
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(types.colon) || super.isClassProperty();
+ }
+
+ isNonstaticConstructor(method) {
+ return !this.match(types.colon) && super.isNonstaticConstructor(method);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ if (method.variance) {
+ this.unexpected(method.variance.start);
+ }
+
+ delete method.variance;
+
+ if (this.isRelational("<")) {
+ method.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.flowParseTypeParameterInstantiation();
+ }
+
+ if (this.isContextual("implements")) {
+ this.next();
+ const implemented = node.implements = [];
+
+ do {
+ const node = this.startNode();
+ node.id = this.flowParseRestrictedIdentifier(true);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterInstantiation();
+ } else {
+ node.typeParameters = null;
+ }
+
+ implemented.push(this.finishNode(node, "ClassImplements"));
+ } while (this.eat(types.comma));
+ }
+ }
+
+ parsePropertyName(node, isPrivateNameAllowed) {
+ const variance = this.flowParseVariance();
+ const key = super.parsePropertyName(node, isPrivateNameAllowed);
+ node.variance = variance;
+ return key;
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc) {
+ if (prop.variance) {
+ this.unexpected(prop.variance.start);
+ }
+
+ delete prop.variance;
+ let typeParameters;
+
+ if (this.isRelational("<")) {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ if (!this.match(types.parenL)) this.unexpected();
+ }
+
+ super.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc);
+
+ if (typeParameters) {
+ (prop.value || prop).typeParameters = typeParameters;
+ }
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(types.question)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature.");
+ }
+
+ param.optional = true;
+ }
+
+ if (this.match(types.colon)) {
+ param.typeAnnotation = this.flowParseTypeAnnotation();
+ }
+
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ const node = super.parseMaybeDefault(startPos, startLoc, left);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`");
+ }
+
+ return node;
+ }
+
+ shouldParseDefaultImport(node) {
+ if (!hasTypeImportKind(node)) {
+ return super.shouldParseDefaultImport(node);
+ }
+
+ return isMaybeDefaultImport(this.state);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = hasTypeImportKind(node) ? this.flowParseRestrictedIdentifier(true, true) : this.parseIdentifier();
+ this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ node.importKind = "value";
+ let kind = null;
+
+ if (this.match(types._typeof)) {
+ kind = "typeof";
+ } else if (this.isContextual("type")) {
+ kind = "type";
+ }
+
+ if (kind) {
+ const lh = this.lookahead();
+
+ if (kind === "type" && lh.type === types.star) {
+ this.unexpected(lh.start);
+ }
+
+ if (isMaybeDefaultImport(lh) || lh.type === types.braceL || lh.type === types.star) {
+ this.next();
+ node.importKind = kind;
+ }
+ }
+
+ return super.maybeParseDefaultImportSpecifier(node);
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ const firstIdentLoc = this.state.start;
+ const firstIdent = this.parseIdentifier(true);
+ let specifierTypeKind = null;
+
+ if (firstIdent.name === "type") {
+ specifierTypeKind = "type";
+ } else if (firstIdent.name === "typeof") {
+ specifierTypeKind = "typeof";
+ }
+
+ let isBinding = false;
+
+ if (this.isContextual("as") && !this.isLookaheadContextual("as")) {
+ const as_ident = this.parseIdentifier(true);
+
+ if (specifierTypeKind !== null && !this.match(types.name) && !this.state.type.keyword) {
+ specifier.imported = as_ident;
+ specifier.importKind = specifierTypeKind;
+ specifier.local = as_ident.__clone();
+ } else {
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = this.parseIdentifier();
+ }
+ } else if (specifierTypeKind !== null && (this.match(types.name) || this.state.type.keyword)) {
+ specifier.imported = this.parseIdentifier(true);
+ specifier.importKind = specifierTypeKind;
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ isBinding = true;
+ specifier.local = specifier.imported.__clone();
+ }
+ } else {
+ isBinding = true;
+ specifier.imported = firstIdent;
+ specifier.importKind = null;
+ specifier.local = specifier.imported.__clone();
+ }
+
+ const nodeIsTypeImport = hasTypeImportKind(node);
+ const specifierIsTypeImport = hasTypeImportKind(specifier);
+
+ if (nodeIsTypeImport && specifierIsTypeImport) {
+ this.raise(firstIdentLoc, "The `type` and `typeof` keywords on named imports can only be used on regular " + "`import` statements. It cannot be used with `import type` or `import typeof` statements");
+ }
+
+ if (nodeIsTypeImport || specifierIsTypeImport) {
+ this.checkReservedType(specifier.local.name, specifier.local.start, true);
+ }
+
+ if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {
+ this.checkReservedWord(specifier.local.name, specifier.start, true, true);
+ }
+
+ this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier");
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const kind = node.kind;
+
+ if (kind !== "get" && kind !== "set" && this.isRelational("<")) {
+ node.typeParameters = this.flowParseTypeParameterDeclaration();
+ }
+
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (this.match(types.colon)) {
+ decl.id.typeAnnotation = this.flowParseTypeAnnotation();
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(types.colon)) {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ node.returnType = this.flowParseTypeAnnotation();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(types.colon) || super.shouldParseAsyncArrow();
+ }
+
+ parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos) {
+ let state = null;
+ let jsx;
+
+ if (this.hasPlugin("jsx") && (this.match(types.jsxTagStart) || this.isRelational("<"))) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types$1.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (jsx && jsx.error || this.isRelational("<")) {
+ state = state || this.state.clone();
+ let typeParameters;
+ const arrow = this.tryParse(() => {
+ typeParameters = this.flowParseTypeParameterDeclaration();
+ const arrowExpression = this.forwardNoArrowParamsConversionAt(typeParameters, () => super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos));
+ arrowExpression.typeParameters = typeParameters;
+ this.resetStartLocationFromNode(arrowExpression, typeParameters);
+ return arrowExpression;
+ }, state);
+ const arrowExpression = arrow.node && arrow.node.type === "ArrowFunctionExpression" ? arrow.node : null;
+ if (!arrow.error && arrowExpression) return arrowExpression;
+
+ if (jsx && jsx.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrowExpression) {
+ this.state = arrow.failState;
+ return arrowExpression;
+ }
+
+ if (jsx && jsx.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ throw this.raise(typeParameters.start, "Expected an arrow function after this type parameter declaration");
+ }
+
+ return super.parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos);
+ }
+
+ parseArrow(node) {
+ if (this.match(types.colon)) {
+ const result = this.tryParse(() => {
+ const oldNoAnonFunctionType = this.state.noAnonFunctionType;
+ this.state.noAnonFunctionType = true;
+ const typeNode = this.startNode();
+ [typeNode.typeAnnotation, node.predicate] = this.flowParseTypeAndPredicateInitialiser();
+ this.state.noAnonFunctionType = oldNoAnonFunctionType;
+ if (this.canInsertSemicolon()) this.unexpected();
+ if (!this.match(types.arrow)) this.unexpected();
+ return typeNode;
+ });
+ if (result.thrown) return null;
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node.typeAnnotation ? this.finishNode(result.node, "TypeAnnotation") : null;
+ }
+
+ return super.parseArrow(node);
+ }
+
+ shouldParseArrow() {
+ return this.match(types.colon) || super.shouldParseArrow();
+ }
+
+ setArrowFunctionParameters(node, params) {
+ if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ node.params = params;
+ } else {
+ super.setArrowFunctionParameters(node, params);
+ }
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction) {
+ if (isArrowFunction && this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {
+ return;
+ }
+
+ return super.checkParams(...arguments);
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ return super.parseParenAndDistinguishExpression(canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.indexOf(startPos) !== -1) {
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ base = this.finishNode(node, "CallExpression");
+ } else if (base.type === "Identifier" && base.name === "async" && this.isRelational("<")) {
+ const state = this.state.clone();
+ const arrow = this.tryParse(abort => this.parseAsyncArrowWithTypeParameters(startPos, startLoc) || abort(), state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+ const result = this.tryParse(() => super.parseSubscripts(base, startPos, startLoc, noCalls), state);
+ if (result.node && !result.error) return result.node;
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if (result.node) {
+ this.state = result.failState;
+ return result.node;
+ }
+
+ throw arrow.error || result.error;
+ }
+
+ return super.parseSubscripts(base, startPos, startLoc, noCalls);
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, subscriptState) {
+ if (this.match(types.questionDot) && this.isLookaheadRelational("<")) {
+ subscriptState.optionalChainMember = true;
+
+ if (noCalls) {
+ subscriptState.stop = true;
+ return base;
+ }
+
+ this.next();
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ node.typeArguments = this.flowParseTypeParameterInstantiation();
+ this.expect(types.parenL);
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ node.optional = true;
+ return this.finishCallExpression(node, true);
+ } else if (!noCalls && this.shouldParseTypes() && this.isRelational("<")) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const result = this.tryParse(() => {
+ node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();
+ this.expect(types.parenL);
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ if (subscriptState.optionalChainMember) node.optional = false;
+ return this.finishCallExpression(node, subscriptState.optionalChainMember);
+ });
+
+ if (result.node) {
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, subscriptState);
+ }
+
+ parseNewArguments(node) {
+ let targs = null;
+
+ if (this.shouldParseTypes() && this.isRelational("<")) {
+ targs = this.tryParse(() => this.flowParseTypeParameterInstantiationCallOrNew()).node;
+ }
+
+ node.typeArguments = targs;
+ super.parseNewArguments(node);
+ }
+
+ parseAsyncArrowWithTypeParameters(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ this.parseFunctionParams(node);
+ if (!this.parseArrow(node)) return;
+ return this.parseArrowExpression(node, undefined, true);
+ }
+
+ readToken_mult_modulo(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 42 && next === 47 && this.state.hasFlowComment) {
+ this.state.hasFlowComment = false;
+ this.state.pos += 2;
+ this.nextToken();
+ return;
+ }
+
+ super.readToken_mult_modulo(code);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (code === 124 && next === 125) {
+ this.finishOp(types.braceBarR, 2);
+ return;
+ }
+
+ super.readToken_pipe_amp(code);
+ }
+
+ parseTopLevel(file, program) {
+ const fileNode = super.parseTopLevel(file, program);
+
+ if (this.state.hasFlowComment) {
+ this.raise(this.state.pos, "Unterminated flow-comment");
+ }
+
+ return fileNode;
+ }
+
+ skipBlockComment() {
+ if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
+ if (this.state.hasFlowComment) {
+ this.unexpected(null, "Cannot have a flow comment inside another flow comment");
+ }
+
+ this.hasFlowCommentCompletion();
+ this.state.pos += this.skipFlowComment();
+ this.state.hasFlowComment = true;
+ return;
+ }
+
+ if (this.state.hasFlowComment) {
+ const end = this.input.indexOf("*-/", this.state.pos += 2);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos - 2, "Unterminated comment");
+ }
+
+ this.state.pos = end + 3;
+ return;
+ }
+
+ super.skipBlockComment();
+ }
+
+ skipFlowComment() {
+ const {
+ pos
+ } = this.state;
+ let shiftToFirstNonWhiteSpace = 2;
+
+ while ([32, 9].includes(this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace))) {
+ shiftToFirstNonWhiteSpace++;
+ }
+
+ const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);
+ const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);
+
+ if (ch2 === 58 && ch3 === 58) {
+ return shiftToFirstNonWhiteSpace + 2;
+ }
+
+ if (this.input.slice(shiftToFirstNonWhiteSpace + pos, shiftToFirstNonWhiteSpace + pos + 12) === "flow-include") {
+ return shiftToFirstNonWhiteSpace + 12;
+ }
+
+ if (ch2 === 58 && ch3 !== 58) {
+ return shiftToFirstNonWhiteSpace;
+ }
+
+ return false;
+ }
+
+ hasFlowCommentCompletion() {
+ const end = this.input.indexOf("*/", this.state.pos);
+
+ if (end === -1) {
+ throw this.raise(this.state.pos, "Unterminated comment");
+ }
+ }
+
+ flowEnumErrorBooleanMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, `Boolean enum members need to be initialized. Use either \`${memberName} = true,\` ` + `or \`${memberName} = false,\` in enum \`${enumName}\`.`);
+ }
+
+ flowEnumErrorInvalidMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ const suggestion = memberName[0].toUpperCase() + memberName.slice(1);
+ this.raise(pos, `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using ` + `\`${memberName}\`, consider using \`${suggestion}\`, in enum \`${enumName}\`.`);
+ }
+
+ flowEnumErrorDuplicateMemberName(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, `Enum member names need to be unique, but the name \`${memberName}\` has already been used ` + `before in enum \`${enumName}\`.`);
+ }
+
+ flowEnumErrorInconsistentMemberValues(pos, {
+ enumName
+ }) {
+ this.raise(pos, `Enum \`${enumName}\` has inconsistent member initializers. Either use no initializers, or ` + `consistently use literals (either booleans, numbers, or strings) for all member initializers.`);
+ }
+
+ flowEnumErrorInvalidExplicitType(pos, {
+ enumName,
+ suppliedType
+ }) {
+ const suggestion = `Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in ` + `enum \`${enumName}\`.`;
+ const message = suppliedType === null ? `Supplied enum type is not valid. ${suggestion}` : `Enum type \`${suppliedType}\` is not valid. ${suggestion}`;
+ return this.raise(pos, message);
+ }
+
+ flowEnumErrorInvalidMemberInitializer(pos, {
+ enumName,
+ explicitType,
+ memberName
+ }) {
+ let message = null;
+
+ switch (explicitType) {
+ case "boolean":
+ case "number":
+ case "string":
+ message = `Enum \`${enumName}\` has type \`${explicitType}\`, so the initializer of ` + `\`${memberName}\` needs to be a ${explicitType} literal.`;
+ break;
+
+ case "symbol":
+ message = `Symbol enum members cannot be initialized. Use \`${memberName},\` in ` + `enum \`${enumName}\`.`;
+ break;
+
+ default:
+ message = `The enum member initializer for \`${memberName}\` needs to be a literal (either ` + `a boolean, number, or string) in enum \`${enumName}\`.`;
+ }
+
+ return this.raise(pos, message);
+ }
+
+ flowEnumErrorNumberMemberNotInitialized(pos, {
+ enumName,
+ memberName
+ }) {
+ this.raise(pos, `Number enum members need to be initialized, e.g. \`${memberName} = 1\` in enum \`${enumName}\`.`);
+ }
+
+ flowEnumErrorStringMemberInconsistentlyInitailized(pos, {
+ enumName
+ }) {
+ this.raise(pos, `String enum members need to consistently either all use initializers, or use no initializers, ` + `in enum \`${enumName}\`.`);
+ }
+
+ flowEnumMemberInit() {
+ const startPos = this.state.start;
+
+ const endOfInit = () => this.match(types.comma) || this.match(types.braceR);
+
+ switch (this.state.type) {
+ case types.num:
+ {
+ const literal = this.parseLiteral(this.state.value, "NumericLiteral");
+
+ if (endOfInit()) {
+ return {
+ type: "number",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case types.string:
+ {
+ const literal = this.parseLiteral(this.state.value, "StringLiteral");
+
+ if (endOfInit()) {
+ return {
+ type: "string",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ case types._true:
+ case types._false:
+ {
+ const literal = this.parseBooleanLiteral();
+
+ if (endOfInit()) {
+ return {
+ type: "boolean",
+ pos: literal.start,
+ value: literal
+ };
+ }
+
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+
+ default:
+ return {
+ type: "invalid",
+ pos: startPos
+ };
+ }
+ }
+
+ flowEnumMemberRaw() {
+ const pos = this.state.start;
+ const id = this.parseIdentifier(true);
+ const init = this.eat(types.eq) ? this.flowEnumMemberInit() : {
+ type: "none",
+ pos
+ };
+ return {
+ id,
+ init
+ };
+ }
+
+ flowEnumCheckExplicitTypeMismatch(pos, context, expectedType) {
+ const {
+ explicitType
+ } = context;
+
+ if (explicitType === null) {
+ return;
+ }
+
+ if (explicitType !== expectedType) {
+ this.flowEnumErrorInvalidMemberInitializer(pos, context);
+ }
+ }
+
+ flowEnumMembers({
+ enumName,
+ explicitType
+ }) {
+ const seenNames = new Set();
+ const members = {
+ booleanMembers: [],
+ numberMembers: [],
+ stringMembers: [],
+ defaultedMembers: []
+ };
+
+ while (!this.match(types.braceR)) {
+ const memberNode = this.startNode();
+ const {
+ id,
+ init
+ } = this.flowEnumMemberRaw();
+ const memberName = id.name;
+
+ if (memberName === "") {
+ continue;
+ }
+
+ if (/^[a-z]/.test(memberName)) {
+ this.flowEnumErrorInvalidMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ if (seenNames.has(memberName)) {
+ this.flowEnumErrorDuplicateMemberName(id.start, {
+ enumName,
+ memberName
+ });
+ }
+
+ seenNames.add(memberName);
+ const context = {
+ enumName,
+ explicitType,
+ memberName
+ };
+ memberNode.id = id;
+
+ switch (init.type) {
+ case "boolean":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "boolean");
+ memberNode.init = init.value;
+ members.booleanMembers.push(this.finishNode(memberNode, "EnumBooleanMember"));
+ break;
+ }
+
+ case "number":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "number");
+ memberNode.init = init.value;
+ members.numberMembers.push(this.finishNode(memberNode, "EnumNumberMember"));
+ break;
+ }
+
+ case "string":
+ {
+ this.flowEnumCheckExplicitTypeMismatch(init.pos, context, "string");
+ memberNode.init = init.value;
+ members.stringMembers.push(this.finishNode(memberNode, "EnumStringMember"));
+ break;
+ }
+
+ case "invalid":
+ {
+ throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);
+ }
+
+ case "none":
+ {
+ switch (explicitType) {
+ case "boolean":
+ this.flowEnumErrorBooleanMemberNotInitialized(init.pos, context);
+ break;
+
+ case "number":
+ this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);
+ break;
+
+ default:
+ members.defaultedMembers.push(this.finishNode(memberNode, "EnumDefaultedMember"));
+ }
+ }
+ }
+
+ if (!this.match(types.braceR)) {
+ this.expect(types.comma);
+ }
+ }
+
+ return members;
+ }
+
+ flowEnumStringMembers(initializedMembers, defaultedMembers, {
+ enumName
+ }) {
+ if (initializedMembers.length === 0) {
+ return defaultedMembers;
+ } else if (defaultedMembers.length === 0) {
+ return initializedMembers;
+ } else if (defaultedMembers.length > initializedMembers.length) {
+ for (let _i = 0; _i < initializedMembers.length; _i++) {
+ const member = initializedMembers[_i];
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return defaultedMembers;
+ } else {
+ for (let _i2 = 0; _i2 < defaultedMembers.length; _i2++) {
+ const member = defaultedMembers[_i2];
+ this.flowEnumErrorStringMemberInconsistentlyInitailized(member.start, {
+ enumName
+ });
+ }
+
+ return initializedMembers;
+ }
+ }
+
+ flowEnumParseExplicitType({
+ enumName
+ }) {
+ if (this.eatContextual("of")) {
+ if (!this.match(types.name)) {
+ throw this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: null
+ });
+ }
+
+ const {
+ value
+ } = this.state;
+ this.next();
+
+ if (value !== "boolean" && value !== "number" && value !== "string" && value !== "symbol") {
+ this.flowEnumErrorInvalidExplicitType(this.state.start, {
+ enumName,
+ suppliedType: value
+ });
+ }
+
+ return value;
+ }
+
+ return null;
+ }
+
+ flowEnumBody(node, {
+ enumName,
+ nameLoc
+ }) {
+ const explicitType = this.flowEnumParseExplicitType({
+ enumName
+ });
+ this.expect(types.braceL);
+ const members = this.flowEnumMembers({
+ enumName,
+ explicitType
+ });
+
+ switch (explicitType) {
+ case "boolean":
+ node.explicitType = true;
+ node.members = members.booleanMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumBooleanBody");
+
+ case "number":
+ node.explicitType = true;
+ node.members = members.numberMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumNumberBody");
+
+ case "string":
+ node.explicitType = true;
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumStringBody");
+
+ case "symbol":
+ node.members = members.defaultedMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumSymbolBody");
+
+ default:
+ {
+ const empty = () => {
+ node.members = [];
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumStringBody");
+ };
+
+ node.explicitType = false;
+ const boolsLen = members.booleanMembers.length;
+ const numsLen = members.numberMembers.length;
+ const strsLen = members.stringMembers.length;
+ const defaultedLen = members.defaultedMembers.length;
+
+ if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {
+ return empty();
+ } else if (!boolsLen && !numsLen) {
+ node.members = this.flowEnumStringMembers(members.stringMembers, members.defaultedMembers, {
+ enumName
+ });
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumStringBody");
+ } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
+ for (let _i3 = 0, _members$defaultedMem = members.defaultedMembers; _i3 < _members$defaultedMem.length; _i3++) {
+ const member = _members$defaultedMem[_i3];
+ this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.booleanMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumBooleanBody");
+ } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
+ for (let _i4 = 0, _members$defaultedMem2 = members.defaultedMembers; _i4 < _members$defaultedMem2.length; _i4++) {
+ const member = _members$defaultedMem2[_i4];
+ this.flowEnumErrorNumberMemberNotInitialized(member.start, {
+ enumName,
+ memberName: member.id.name
+ });
+ }
+
+ node.members = members.numberMembers;
+ this.expect(types.braceR);
+ return this.finishNode(node, "EnumNumberBody");
+ } else {
+ this.flowEnumErrorInconsistentMemberValues(nameLoc, {
+ enumName
+ });
+ return empty();
+ }
+ }
+ }
+ }
+
+ flowParseEnumDeclaration(node) {
+ const id = this.parseIdentifier();
+ node.id = id;
+ node.body = this.flowEnumBody(this.startNode(), {
+ enumName: id.name,
+ nameLoc: id.start
+ });
+ return this.finishNode(node, "EnumDeclaration");
+ }
+
+});
+
+const entities = {
+ quot: "\u0022",
+ amp: "&",
+ apos: "\u0027",
+ lt: "<",
+ gt: ">",
+ nbsp: "\u00A0",
+ iexcl: "\u00A1",
+ cent: "\u00A2",
+ pound: "\u00A3",
+ curren: "\u00A4",
+ yen: "\u00A5",
+ brvbar: "\u00A6",
+ sect: "\u00A7",
+ uml: "\u00A8",
+ copy: "\u00A9",
+ ordf: "\u00AA",
+ laquo: "\u00AB",
+ not: "\u00AC",
+ shy: "\u00AD",
+ reg: "\u00AE",
+ macr: "\u00AF",
+ deg: "\u00B0",
+ plusmn: "\u00B1",
+ sup2: "\u00B2",
+ sup3: "\u00B3",
+ acute: "\u00B4",
+ micro: "\u00B5",
+ para: "\u00B6",
+ middot: "\u00B7",
+ cedil: "\u00B8",
+ sup1: "\u00B9",
+ ordm: "\u00BA",
+ raquo: "\u00BB",
+ frac14: "\u00BC",
+ frac12: "\u00BD",
+ frac34: "\u00BE",
+ iquest: "\u00BF",
+ Agrave: "\u00C0",
+ Aacute: "\u00C1",
+ Acirc: "\u00C2",
+ Atilde: "\u00C3",
+ Auml: "\u00C4",
+ Aring: "\u00C5",
+ AElig: "\u00C6",
+ Ccedil: "\u00C7",
+ Egrave: "\u00C8",
+ Eacute: "\u00C9",
+ Ecirc: "\u00CA",
+ Euml: "\u00CB",
+ Igrave: "\u00CC",
+ Iacute: "\u00CD",
+ Icirc: "\u00CE",
+ Iuml: "\u00CF",
+ ETH: "\u00D0",
+ Ntilde: "\u00D1",
+ Ograve: "\u00D2",
+ Oacute: "\u00D3",
+ Ocirc: "\u00D4",
+ Otilde: "\u00D5",
+ Ouml: "\u00D6",
+ times: "\u00D7",
+ Oslash: "\u00D8",
+ Ugrave: "\u00D9",
+ Uacute: "\u00DA",
+ Ucirc: "\u00DB",
+ Uuml: "\u00DC",
+ Yacute: "\u00DD",
+ THORN: "\u00DE",
+ szlig: "\u00DF",
+ agrave: "\u00E0",
+ aacute: "\u00E1",
+ acirc: "\u00E2",
+ atilde: "\u00E3",
+ auml: "\u00E4",
+ aring: "\u00E5",
+ aelig: "\u00E6",
+ ccedil: "\u00E7",
+ egrave: "\u00E8",
+ eacute: "\u00E9",
+ ecirc: "\u00EA",
+ euml: "\u00EB",
+ igrave: "\u00EC",
+ iacute: "\u00ED",
+ icirc: "\u00EE",
+ iuml: "\u00EF",
+ eth: "\u00F0",
+ ntilde: "\u00F1",
+ ograve: "\u00F2",
+ oacute: "\u00F3",
+ ocirc: "\u00F4",
+ otilde: "\u00F5",
+ ouml: "\u00F6",
+ divide: "\u00F7",
+ oslash: "\u00F8",
+ ugrave: "\u00F9",
+ uacute: "\u00FA",
+ ucirc: "\u00FB",
+ uuml: "\u00FC",
+ yacute: "\u00FD",
+ thorn: "\u00FE",
+ yuml: "\u00FF",
+ OElig: "\u0152",
+ oelig: "\u0153",
+ Scaron: "\u0160",
+ scaron: "\u0161",
+ Yuml: "\u0178",
+ fnof: "\u0192",
+ circ: "\u02C6",
+ tilde: "\u02DC",
+ Alpha: "\u0391",
+ Beta: "\u0392",
+ Gamma: "\u0393",
+ Delta: "\u0394",
+ Epsilon: "\u0395",
+ Zeta: "\u0396",
+ Eta: "\u0397",
+ Theta: "\u0398",
+ Iota: "\u0399",
+ Kappa: "\u039A",
+ Lambda: "\u039B",
+ Mu: "\u039C",
+ Nu: "\u039D",
+ Xi: "\u039E",
+ Omicron: "\u039F",
+ Pi: "\u03A0",
+ Rho: "\u03A1",
+ Sigma: "\u03A3",
+ Tau: "\u03A4",
+ Upsilon: "\u03A5",
+ Phi: "\u03A6",
+ Chi: "\u03A7",
+ Psi: "\u03A8",
+ Omega: "\u03A9",
+ alpha: "\u03B1",
+ beta: "\u03B2",
+ gamma: "\u03B3",
+ delta: "\u03B4",
+ epsilon: "\u03B5",
+ zeta: "\u03B6",
+ eta: "\u03B7",
+ theta: "\u03B8",
+ iota: "\u03B9",
+ kappa: "\u03BA",
+ lambda: "\u03BB",
+ mu: "\u03BC",
+ nu: "\u03BD",
+ xi: "\u03BE",
+ omicron: "\u03BF",
+ pi: "\u03C0",
+ rho: "\u03C1",
+ sigmaf: "\u03C2",
+ sigma: "\u03C3",
+ tau: "\u03C4",
+ upsilon: "\u03C5",
+ phi: "\u03C6",
+ chi: "\u03C7",
+ psi: "\u03C8",
+ omega: "\u03C9",
+ thetasym: "\u03D1",
+ upsih: "\u03D2",
+ piv: "\u03D6",
+ ensp: "\u2002",
+ emsp: "\u2003",
+ thinsp: "\u2009",
+ zwnj: "\u200C",
+ zwj: "\u200D",
+ lrm: "\u200E",
+ rlm: "\u200F",
+ ndash: "\u2013",
+ mdash: "\u2014",
+ lsquo: "\u2018",
+ rsquo: "\u2019",
+ sbquo: "\u201A",
+ ldquo: "\u201C",
+ rdquo: "\u201D",
+ bdquo: "\u201E",
+ dagger: "\u2020",
+ Dagger: "\u2021",
+ bull: "\u2022",
+ hellip: "\u2026",
+ permil: "\u2030",
+ prime: "\u2032",
+ Prime: "\u2033",
+ lsaquo: "\u2039",
+ rsaquo: "\u203A",
+ oline: "\u203E",
+ frasl: "\u2044",
+ euro: "\u20AC",
+ image: "\u2111",
+ weierp: "\u2118",
+ real: "\u211C",
+ trade: "\u2122",
+ alefsym: "\u2135",
+ larr: "\u2190",
+ uarr: "\u2191",
+ rarr: "\u2192",
+ darr: "\u2193",
+ harr: "\u2194",
+ crarr: "\u21B5",
+ lArr: "\u21D0",
+ uArr: "\u21D1",
+ rArr: "\u21D2",
+ dArr: "\u21D3",
+ hArr: "\u21D4",
+ forall: "\u2200",
+ part: "\u2202",
+ exist: "\u2203",
+ empty: "\u2205",
+ nabla: "\u2207",
+ isin: "\u2208",
+ notin: "\u2209",
+ ni: "\u220B",
+ prod: "\u220F",
+ sum: "\u2211",
+ minus: "\u2212",
+ lowast: "\u2217",
+ radic: "\u221A",
+ prop: "\u221D",
+ infin: "\u221E",
+ ang: "\u2220",
+ and: "\u2227",
+ or: "\u2228",
+ cap: "\u2229",
+ cup: "\u222A",
+ int: "\u222B",
+ there4: "\u2234",
+ sim: "\u223C",
+ cong: "\u2245",
+ asymp: "\u2248",
+ ne: "\u2260",
+ equiv: "\u2261",
+ le: "\u2264",
+ ge: "\u2265",
+ sub: "\u2282",
+ sup: "\u2283",
+ nsub: "\u2284",
+ sube: "\u2286",
+ supe: "\u2287",
+ oplus: "\u2295",
+ otimes: "\u2297",
+ perp: "\u22A5",
+ sdot: "\u22C5",
+ lceil: "\u2308",
+ rceil: "\u2309",
+ lfloor: "\u230A",
+ rfloor: "\u230B",
+ lang: "\u2329",
+ rang: "\u232A",
+ loz: "\u25CA",
+ spades: "\u2660",
+ clubs: "\u2663",
+ hearts: "\u2665",
+ diams: "\u2666"
+};
+
+const HEX_NUMBER = /^[\da-fA-F]+$/;
+const DECIMAL_NUMBER = /^\d+$/;
+types$1.j_oTag = new TokContext("... ", true, true);
+types.jsxName = new TokenType("jsxName");
+types.jsxText = new TokenType("jsxText", {
+ beforeExpr: true
+});
+types.jsxTagStart = new TokenType("jsxTagStart", {
+ startsExpr: true
+});
+types.jsxTagEnd = new TokenType("jsxTagEnd");
+
+types.jsxTagStart.updateContext = function () {
+ this.state.context.push(types$1.j_expr);
+ this.state.context.push(types$1.j_oTag);
+ this.state.exprAllowed = false;
+};
+
+types.jsxTagEnd.updateContext = function (prevType) {
+ const out = this.state.context.pop();
+
+ if (out === types$1.j_oTag && prevType === types.slash || out === types$1.j_cTag) {
+ this.state.context.pop();
+ this.state.exprAllowed = this.curContext() === types$1.j_expr;
+ } else {
+ this.state.exprAllowed = true;
+ }
+};
+
+function isFragment(object) {
+ return object ? object.type === "JSXOpeningFragment" || object.type === "JSXClosingFragment" : false;
+}
+
+function getQualifiedJSXName(object) {
+ if (object.type === "JSXIdentifier") {
+ return object.name;
+ }
+
+ if (object.type === "JSXNamespacedName") {
+ return object.namespace.name + ":" + object.name.name;
+ }
+
+ if (object.type === "JSXMemberExpression") {
+ return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property);
+ }
+
+ throw new Error("Node had unexpected type: " + object.type);
+}
+
+var jsx = (superClass => class extends superClass {
+ jsxReadToken() {
+ let out = "";
+ let chunkStart = this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, "Unterminated JSX contents");
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 60:
+ case 123:
+ if (this.state.pos === this.state.start) {
+ if (ch === 60 && this.state.exprAllowed) {
+ ++this.state.pos;
+ return this.finishToken(types.jsxTagStart);
+ }
+
+ return super.getTokenFromCode(ch);
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ return this.finishToken(types.jsxText, out);
+
+ case 38:
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ break;
+
+ default:
+ if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(true);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+
+ }
+ }
+ }
+
+ jsxReadNewLine(normalizeCRLF) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let out;
+ ++this.state.pos;
+
+ if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ out = normalizeCRLF ? "\n" : "\r\n";
+ } else {
+ out = String.fromCharCode(ch);
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ return out;
+ }
+
+ jsxReadString(quote) {
+ let out = "";
+ let chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, "Unterminated string constant");
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 38) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadEntity();
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.jsxReadNewLine(false);
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ return this.finishToken(types.string, out);
+ }
+
+ jsxReadEntity() {
+ let str = "";
+ let count = 0;
+ let entity;
+ let ch = this.input[this.state.pos];
+ const startPos = ++this.state.pos;
+
+ while (this.state.pos < this.length && count++ < 10) {
+ ch = this.input[this.state.pos++];
+
+ if (ch === ";") {
+ if (str[0] === "#") {
+ if (str[1] === "x") {
+ str = str.substr(2);
+
+ if (HEX_NUMBER.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 16));
+ }
+ } else {
+ str = str.substr(1);
+
+ if (DECIMAL_NUMBER.test(str)) {
+ entity = String.fromCodePoint(parseInt(str, 10));
+ }
+ }
+ } else {
+ entity = entities[str];
+ }
+
+ break;
+ }
+
+ str += ch;
+ }
+
+ if (!entity) {
+ this.state.pos = startPos;
+ return "&";
+ }
+
+ return entity;
+ }
+
+ jsxReadWord() {
+ let ch;
+ const start = this.state.pos;
+
+ do {
+ ch = this.input.charCodeAt(++this.state.pos);
+ } while (isIdentifierChar(ch) || ch === 45);
+
+ return this.finishToken(types.jsxName, this.input.slice(start, this.state.pos));
+ }
+
+ jsxParseIdentifier() {
+ const node = this.startNode();
+
+ if (this.match(types.jsxName)) {
+ node.name = this.state.value;
+ } else if (this.state.type.keyword) {
+ node.name = this.state.type.keyword;
+ } else {
+ this.unexpected();
+ }
+
+ this.next();
+ return this.finishNode(node, "JSXIdentifier");
+ }
+
+ jsxParseNamespacedName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const name = this.jsxParseIdentifier();
+ if (!this.eat(types.colon)) return name;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.namespace = name;
+ node.name = this.jsxParseIdentifier();
+ return this.finishNode(node, "JSXNamespacedName");
+ }
+
+ jsxParseElementName() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let node = this.jsxParseNamespacedName();
+
+ if (node.type === "JSXNamespacedName") {
+ return node;
+ }
+
+ while (this.eat(types.dot)) {
+ const newNode = this.startNodeAt(startPos, startLoc);
+ newNode.object = node;
+ newNode.property = this.jsxParseIdentifier();
+ node = this.finishNode(newNode, "JSXMemberExpression");
+ }
+
+ return node;
+ }
+
+ jsxParseAttributeValue() {
+ let node;
+
+ switch (this.state.type) {
+ case types.braceL:
+ node = this.startNode();
+ this.next();
+ node = this.jsxParseExpressionContainer(node);
+
+ if (node.expression.type === "JSXEmptyExpression") {
+ this.raise(node.start, "JSX attributes must only be assigned a non-empty expression");
+ }
+
+ return node;
+
+ case types.jsxTagStart:
+ case types.string:
+ return this.parseExprAtom();
+
+ default:
+ throw this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text");
+ }
+ }
+
+ jsxParseEmptyExpression() {
+ const node = this.startNodeAt(this.state.lastTokEnd, this.state.lastTokEndLoc);
+ return this.finishNodeAt(node, "JSXEmptyExpression", this.state.start, this.state.startLoc);
+ }
+
+ jsxParseSpreadChild(node) {
+ this.next();
+ node.expression = this.parseExpression();
+ this.expect(types.braceR);
+ return this.finishNode(node, "JSXSpreadChild");
+ }
+
+ jsxParseExpressionContainer(node) {
+ if (this.match(types.braceR)) {
+ node.expression = this.jsxParseEmptyExpression();
+ } else {
+ node.expression = this.parseExpression();
+ }
+
+ this.expect(types.braceR);
+ return this.finishNode(node, "JSXExpressionContainer");
+ }
+
+ jsxParseAttribute() {
+ const node = this.startNode();
+
+ if (this.eat(types.braceL)) {
+ this.expect(types.ellipsis);
+ node.argument = this.parseMaybeAssign();
+ this.expect(types.braceR);
+ return this.finishNode(node, "JSXSpreadAttribute");
+ }
+
+ node.name = this.jsxParseNamespacedName();
+ node.value = this.eat(types.eq) ? this.jsxParseAttributeValue() : null;
+ return this.finishNode(node, "JSXAttribute");
+ }
+
+ jsxParseOpeningElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(types.jsxTagEnd)) {
+ this.expect(types.jsxTagEnd);
+ return this.finishNode(node, "JSXOpeningFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ return this.jsxParseOpeningElementAfterName(node);
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ const attributes = [];
+
+ while (!this.match(types.slash) && !this.match(types.jsxTagEnd)) {
+ attributes.push(this.jsxParseAttribute());
+ }
+
+ node.attributes = attributes;
+ node.selfClosing = this.eat(types.slash);
+ this.expect(types.jsxTagEnd);
+ return this.finishNode(node, "JSXOpeningElement");
+ }
+
+ jsxParseClosingElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+
+ if (this.match(types.jsxTagEnd)) {
+ this.expect(types.jsxTagEnd);
+ return this.finishNode(node, "JSXClosingFragment");
+ }
+
+ node.name = this.jsxParseElementName();
+ this.expect(types.jsxTagEnd);
+ return this.finishNode(node, "JSXClosingElement");
+ }
+
+ jsxParseElementAt(startPos, startLoc) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const children = [];
+ const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
+ let closingElement = null;
+
+ if (!openingElement.selfClosing) {
+ contents: for (;;) {
+ switch (this.state.type) {
+ case types.jsxTagStart:
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ this.next();
+
+ if (this.eat(types.slash)) {
+ closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
+ break contents;
+ }
+
+ children.push(this.jsxParseElementAt(startPos, startLoc));
+ break;
+
+ case types.jsxText:
+ children.push(this.parseExprAtom());
+ break;
+
+ case types.braceL:
+ {
+ const node = this.startNode();
+ this.next();
+
+ if (this.match(types.ellipsis)) {
+ children.push(this.jsxParseSpreadChild(node));
+ } else {
+ children.push(this.jsxParseExpressionContainer(node));
+ }
+
+ break;
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ if (isFragment(openingElement) && !isFragment(closingElement)) {
+ this.raise(closingElement.start, "Expected corresponding JSX closing tag for <>");
+ } else if (!isFragment(openingElement) && isFragment(closingElement)) {
+ this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
+ } else if (!isFragment(openingElement) && !isFragment(closingElement)) {
+ if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
+ this.raise(closingElement.start, "Expected corresponding JSX closing tag for <" + getQualifiedJSXName(openingElement.name) + ">");
+ }
+ }
+ }
+
+ if (isFragment(openingElement)) {
+ node.openingFragment = openingElement;
+ node.closingFragment = closingElement;
+ } else {
+ node.openingElement = openingElement;
+ node.closingElement = closingElement;
+ }
+
+ node.children = children;
+
+ if (this.isRelational("<")) {
+ throw this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag. " + "Did you want a JSX fragment <>...>?");
+ }
+
+ return isFragment(openingElement) ? this.finishNode(node, "JSXFragment") : this.finishNode(node, "JSXElement");
+ }
+
+ jsxParseElement() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.next();
+ return this.jsxParseElementAt(startPos, startLoc);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ if (this.match(types.jsxText)) {
+ return this.parseLiteral(this.state.value, "JSXText");
+ } else if (this.match(types.jsxTagStart)) {
+ return this.jsxParseElement();
+ } else if (this.isRelational("<") && this.input.charCodeAt(this.state.pos) !== 33) {
+ this.finishToken(types.jsxTagStart);
+ return this.jsxParseElement();
+ } else {
+ return super.parseExprAtom(refExpressionErrors);
+ }
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inPropertyName) return super.getTokenFromCode(code);
+ const context = this.curContext();
+
+ if (context === types$1.j_expr) {
+ return this.jsxReadToken();
+ }
+
+ if (context === types$1.j_oTag || context === types$1.j_cTag) {
+ if (isIdentifierStart(code)) {
+ return this.jsxReadWord();
+ }
+
+ if (code === 62) {
+ ++this.state.pos;
+ return this.finishToken(types.jsxTagEnd);
+ }
+
+ if ((code === 34 || code === 39) && context === types$1.j_oTag) {
+ return this.jsxReadString(code);
+ }
+ }
+
+ if (code === 60 && this.state.exprAllowed && this.input.charCodeAt(this.state.pos + 1) !== 33) {
+ ++this.state.pos;
+ return this.finishToken(types.jsxTagStart);
+ }
+
+ return super.getTokenFromCode(code);
+ }
+
+ updateContext(prevType) {
+ if (this.match(types.braceL)) {
+ const curContext = this.curContext();
+
+ if (curContext === types$1.j_oTag) {
+ this.state.context.push(types$1.braceExpression);
+ } else if (curContext === types$1.j_expr) {
+ this.state.context.push(types$1.templateQuasi);
+ } else {
+ super.updateContext(prevType);
+ }
+
+ this.state.exprAllowed = true;
+ } else if (this.match(types.slash) && prevType === types.jsxTagStart) {
+ this.state.context.length -= 2;
+ this.state.context.push(types$1.j_cTag);
+ this.state.exprAllowed = false;
+ } else {
+ return super.updateContext(prevType);
+ }
+ }
+
+});
+
+class Scope {
+ constructor(flags) {
+ this.var = [];
+ this.lexical = [];
+ this.functions = [];
+ this.flags = flags;
+ }
+
+}
+class ScopeHandler {
+ constructor(raise, inModule) {
+ this.scopeStack = [];
+ this.undefinedExports = new Map();
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ this.inModule = inModule;
+ }
+
+ get inFunction() {
+ return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;
+ }
+
+ get allowSuper() {
+ return (this.currentThisScope().flags & SCOPE_SUPER) > 0;
+ }
+
+ get allowDirectSuper() {
+ return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;
+ }
+
+ get inClass() {
+ return (this.currentThisScope().flags & SCOPE_CLASS) > 0;
+ }
+
+ get inNonArrowFunction() {
+ return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0;
+ }
+
+ get treatFunctionsAsVar() {
+ return this.treatFunctionsAsVarInScope(this.currentScope());
+ }
+
+ createScope(flags) {
+ return new Scope(flags);
+ }
+
+ enter(flags) {
+ this.scopeStack.push(this.createScope(flags));
+ }
+
+ exit() {
+ this.scopeStack.pop();
+ }
+
+ treatFunctionsAsVarInScope(scope) {
+ return !!(scope.flags & SCOPE_FUNCTION || !this.inModule && scope.flags & SCOPE_PROGRAM);
+ }
+
+ declareName(name, bindingType, pos) {
+ let scope = this.currentScope();
+
+ if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ scope.functions.push(name);
+ } else {
+ scope.lexical.push(name);
+ }
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ this.maybeExportDefined(scope, name);
+ }
+ } else if (bindingType & BIND_SCOPE_VAR) {
+ for (let i = this.scopeStack.length - 1; i >= 0; --i) {
+ scope = this.scopeStack[i];
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ scope.var.push(name);
+ this.maybeExportDefined(scope, name);
+ if (scope.flags & SCOPE_VAR) break;
+ }
+ }
+
+ if (this.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ maybeExportDefined(scope, name) {
+ if (this.inModule && scope.flags & SCOPE_PROGRAM) {
+ this.undefinedExports.delete(name);
+ }
+ }
+
+ checkRedeclarationInScope(scope, name, bindingType, pos) {
+ if (this.isRedeclaredInScope(scope, name, bindingType)) {
+ this.raise(pos, `Identifier '${name}' has already been declared`);
+ }
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (!(bindingType & BIND_KIND_VALUE)) return false;
+
+ if (bindingType & BIND_SCOPE_LEXICAL) {
+ return scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
+ }
+
+ if (bindingType & BIND_SCOPE_FUNCTION) {
+ return scope.lexical.indexOf(name) > -1 || !this.treatFunctionsAsVarInScope(scope) && scope.var.indexOf(name) > -1;
+ }
+
+ return scope.lexical.indexOf(name) > -1 && !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name) || !this.treatFunctionsAsVarInScope(scope) && scope.functions.indexOf(name) > -1;
+ }
+
+ checkLocalExport(id) {
+ if (this.scopeStack[0].lexical.indexOf(id.name) === -1 && this.scopeStack[0].var.indexOf(id.name) === -1 && this.scopeStack[0].functions.indexOf(id.name) === -1) {
+ this.undefinedExports.set(id.name, id.start);
+ }
+ }
+
+ currentScope() {
+ return this.scopeStack[this.scopeStack.length - 1];
+ }
+
+ currentVarScope() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const scope = this.scopeStack[i];
+
+ if (scope.flags & SCOPE_VAR) {
+ return scope;
+ }
+ }
+ }
+
+ currentThisScope() {
+ for (let i = this.scopeStack.length - 1;; i--) {
+ const scope = this.scopeStack[i];
+
+ if ((scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) && !(scope.flags & SCOPE_ARROW)) {
+ return scope;
+ }
+ }
+ }
+
+}
+
+class TypeScriptScope extends Scope {
+ constructor(...args) {
+ super(...args);
+ this.types = [];
+ this.enums = [];
+ this.constEnums = [];
+ this.classes = [];
+ this.exportOnlyBindings = [];
+ }
+
+}
+
+class TypeScriptScopeHandler extends ScopeHandler {
+ createScope(flags) {
+ return new TypeScriptScope(flags);
+ }
+
+ declareName(name, bindingType, pos) {
+ const scope = this.currentScope();
+
+ if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {
+ this.maybeExportDefined(scope, name);
+ scope.exportOnlyBindings.push(name);
+ return;
+ }
+
+ super.declareName(...arguments);
+
+ if (bindingType & BIND_KIND_TYPE) {
+ if (!(bindingType & BIND_KIND_VALUE)) {
+ this.checkRedeclarationInScope(scope, name, bindingType, pos);
+ this.maybeExportDefined(scope, name);
+ }
+
+ scope.types.push(name);
+ }
+
+ if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name);
+ if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name);
+ if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name);
+ }
+
+ isRedeclaredInScope(scope, name, bindingType) {
+ if (scope.enums.indexOf(name) > -1) {
+ if (bindingType & BIND_FLAGS_TS_ENUM) {
+ const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);
+ const wasConst = scope.constEnums.indexOf(name) > -1;
+ return isConst !== wasConst;
+ }
+
+ return true;
+ }
+
+ if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) {
+ if (scope.lexical.indexOf(name) > -1) {
+ return !!(bindingType & BIND_KIND_VALUE);
+ } else {
+ return false;
+ }
+ }
+
+ if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) {
+ return true;
+ }
+
+ return super.isRedeclaredInScope(...arguments);
+ }
+
+ checkLocalExport(id) {
+ if (this.scopeStack[0].types.indexOf(id.name) === -1 && this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1) {
+ super.checkLocalExport(id);
+ }
+ }
+
+}
+
+const PARAM = 0b000,
+ PARAM_YIELD = 0b001,
+ PARAM_AWAIT = 0b010,
+ PARAM_RETURN = 0b100;
+class ProductionParameterHandler {
+ constructor() {
+ this.stacks = [];
+ }
+
+ enter(flags) {
+ this.stacks.push(flags);
+ }
+
+ exit() {
+ this.stacks.pop();
+ }
+
+ currentFlags() {
+ return this.stacks[this.stacks.length - 1];
+ }
+
+ get hasAwait() {
+ return (this.currentFlags() & PARAM_AWAIT) > 0;
+ }
+
+ get hasYield() {
+ return (this.currentFlags() & PARAM_YIELD) > 0;
+ }
+
+ get hasReturn() {
+ return (this.currentFlags() & PARAM_RETURN) > 0;
+ }
+
+}
+function functionFlags(isAsync, isGenerator) {
+ return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);
+}
+
+function nonNull(x) {
+ if (x == null) {
+ throw new Error(`Unexpected ${x} value.`);
+ }
+
+ return x;
+}
+
+function assert(x) {
+ if (!x) {
+ throw new Error("Assert fail");
+ }
+}
+
+function keywordTypeFromName(value) {
+ switch (value) {
+ case "any":
+ return "TSAnyKeyword";
+
+ case "boolean":
+ return "TSBooleanKeyword";
+
+ case "bigint":
+ return "TSBigIntKeyword";
+
+ case "never":
+ return "TSNeverKeyword";
+
+ case "number":
+ return "TSNumberKeyword";
+
+ case "object":
+ return "TSObjectKeyword";
+
+ case "string":
+ return "TSStringKeyword";
+
+ case "symbol":
+ return "TSSymbolKeyword";
+
+ case "undefined":
+ return "TSUndefinedKeyword";
+
+ case "unknown":
+ return "TSUnknownKeyword";
+
+ default:
+ return undefined;
+ }
+}
+
+var typescript = (superClass => class extends superClass {
+ getScopeHandler() {
+ return TypeScriptScopeHandler;
+ }
+
+ tsIsIdentifier() {
+ return this.match(types.name);
+ }
+
+ tsNextTokenCanFollowModifier() {
+ this.next();
+ return !this.hasPrecedingLineBreak() && !this.match(types.parenL) && !this.match(types.parenR) && !this.match(types.colon) && !this.match(types.eq) && !this.match(types.question) && !this.match(types.bang);
+ }
+
+ tsParseModifier(allowedModifiers) {
+ if (!this.match(types.name)) {
+ return undefined;
+ }
+
+ const modifier = this.state.value;
+
+ if (allowedModifiers.indexOf(modifier) !== -1 && this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) {
+ return modifier;
+ }
+
+ return undefined;
+ }
+
+ tsParseModifiers(modified, allowedModifiers) {
+ for (;;) {
+ const startPos = this.state.start;
+ const modifier = this.tsParseModifier(allowedModifiers);
+ if (!modifier) break;
+
+ if (Object.hasOwnProperty.call(modified, modifier)) {
+ this.raise(startPos, `Duplicate modifier: '${modifier}'`);
+ }
+
+ modified[modifier] = true;
+ }
+ }
+
+ tsIsListTerminator(kind) {
+ switch (kind) {
+ case "EnumMembers":
+ case "TypeMembers":
+ return this.match(types.braceR);
+
+ case "HeritageClauseElement":
+ return this.match(types.braceL);
+
+ case "TupleElementTypes":
+ return this.match(types.bracketR);
+
+ case "TypeParametersOrArguments":
+ return this.isRelational(">");
+ }
+
+ throw new Error("Unreachable");
+ }
+
+ tsParseList(kind, parseElement) {
+ const result = [];
+
+ while (!this.tsIsListTerminator(kind)) {
+ result.push(parseElement());
+ }
+
+ return result;
+ }
+
+ tsParseDelimitedList(kind, parseElement) {
+ return nonNull(this.tsParseDelimitedListWorker(kind, parseElement, true));
+ }
+
+ tsParseDelimitedListWorker(kind, parseElement, expectSuccess) {
+ const result = [];
+
+ for (;;) {
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ const element = parseElement();
+
+ if (element == null) {
+ return undefined;
+ }
+
+ result.push(element);
+
+ if (this.eat(types.comma)) {
+ continue;
+ }
+
+ if (this.tsIsListTerminator(kind)) {
+ break;
+ }
+
+ if (expectSuccess) {
+ this.expect(types.comma);
+ }
+
+ return undefined;
+ }
+
+ return result;
+ }
+
+ tsParseBracketedList(kind, parseElement, bracket, skipFirstToken) {
+ if (!skipFirstToken) {
+ if (bracket) {
+ this.expect(types.bracketL);
+ } else {
+ this.expectRelational("<");
+ }
+ }
+
+ const result = this.tsParseDelimitedList(kind, parseElement);
+
+ if (bracket) {
+ this.expect(types.bracketR);
+ } else {
+ this.expectRelational(">");
+ }
+
+ return result;
+ }
+
+ tsParseImportType() {
+ const node = this.startNode();
+ this.expect(types._import);
+ this.expect(types.parenL);
+
+ if (!this.match(types.string)) {
+ this.raise(this.state.start, "Argument in a type import must be a string literal");
+ }
+
+ node.argument = this.parseExprAtom();
+ this.expect(types.parenR);
+
+ if (this.eat(types.dot)) {
+ node.qualifier = this.tsParseEntityName(true);
+ }
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSImportType");
+ }
+
+ tsParseEntityName(allowReservedWords) {
+ let entity = this.parseIdentifier();
+
+ while (this.eat(types.dot)) {
+ const node = this.startNodeAtNode(entity);
+ node.left = entity;
+ node.right = this.parseIdentifier(allowReservedWords);
+ entity = this.finishNode(node, "TSQualifiedName");
+ }
+
+ return entity;
+ }
+
+ tsParseTypeReference() {
+ const node = this.startNode();
+ node.typeName = this.tsParseEntityName(false);
+
+ if (!this.hasPrecedingLineBreak() && this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSTypeReference");
+ }
+
+ tsParseThisTypePredicate(lhs) {
+ this.next();
+ const node = this.startNodeAtNode(lhs);
+ node.parameterName = lhs;
+ node.typeAnnotation = this.tsParseTypeAnnotation(false);
+ return this.finishNode(node, "TSTypePredicate");
+ }
+
+ tsParseThisTypeNode() {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, "TSThisType");
+ }
+
+ tsParseTypeQuery() {
+ const node = this.startNode();
+ this.expect(types._typeof);
+
+ if (this.match(types._import)) {
+ node.exprName = this.tsParseImportType();
+ } else {
+ node.exprName = this.tsParseEntityName(true);
+ }
+
+ return this.finishNode(node, "TSTypeQuery");
+ }
+
+ tsParseTypeParameter() {
+ const node = this.startNode();
+ node.name = this.parseIdentifierName(node.start);
+ node.constraint = this.tsEatThenParseType(types._extends);
+ node.default = this.tsEatThenParseType(types.eq);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsTryParseTypeParameters() {
+ if (this.isRelational("<")) {
+ return this.tsParseTypeParameters();
+ }
+ }
+
+ tsParseTypeParameters() {
+ const node = this.startNode();
+
+ if (this.isRelational("<") || this.match(types.jsxTagStart)) {
+ this.next();
+ } else {
+ this.unexpected();
+ }
+
+ node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this), false, true);
+ return this.finishNode(node, "TSTypeParameterDeclaration");
+ }
+
+ tsTryNextParseConstantContext() {
+ if (this.lookahead().type === types._const) {
+ this.next();
+ return this.tsParseTypeReference();
+ }
+
+ return null;
+ }
+
+ tsFillSignature(returnToken, signature) {
+ const returnTokenRequired = returnToken === types.arrow;
+ signature.typeParameters = this.tsTryParseTypeParameters();
+ this.expect(types.parenL);
+ signature.parameters = this.tsParseBindingListForSignature();
+
+ if (returnTokenRequired) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ } else if (this.match(returnToken)) {
+ signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(returnToken);
+ }
+ }
+
+ tsParseBindingListForSignature() {
+ return this.parseBindingList(types.parenR, 41).map(pattern => {
+ if (pattern.type !== "Identifier" && pattern.type !== "RestElement" && pattern.type !== "ObjectPattern" && pattern.type !== "ArrayPattern") {
+ this.raise(pattern.start, "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," + `instead got ${pattern.type}`);
+ }
+
+ return pattern;
+ });
+ }
+
+ tsParseTypeMemberSemicolon() {
+ if (!this.eat(types.comma)) {
+ this.semicolon();
+ }
+ }
+
+ tsParseSignatureMember(kind, node) {
+ this.tsFillSignature(types.colon, node);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, kind);
+ }
+
+ tsIsUnambiguouslyIndexSignature() {
+ this.next();
+ return this.eat(types.name) && this.match(types.colon);
+ }
+
+ tsTryParseIndexSignature(node) {
+ if (!(this.match(types.bracketL) && this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this)))) {
+ return undefined;
+ }
+
+ this.expect(types.bracketL);
+ const id = this.parseIdentifier();
+ id.typeAnnotation = this.tsParseTypeAnnotation();
+ this.resetEndLocation(id);
+ this.expect(types.bracketR);
+ node.parameters = [id];
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(node, "TSIndexSignature");
+ }
+
+ tsParsePropertyOrMethodSignature(node, readonly) {
+ if (this.eat(types.question)) node.optional = true;
+ const nodeAny = node;
+
+ if (!readonly && (this.match(types.parenL) || this.isRelational("<"))) {
+ const method = nodeAny;
+ this.tsFillSignature(types.colon, method);
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(method, "TSMethodSignature");
+ } else {
+ const property = nodeAny;
+ if (readonly) property.readonly = true;
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) property.typeAnnotation = type;
+ this.tsParseTypeMemberSemicolon();
+ return this.finishNode(property, "TSPropertySignature");
+ }
+ }
+
+ tsParseTypeMember() {
+ const node = this.startNode();
+
+ if (this.match(types.parenL) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSCallSignatureDeclaration", node);
+ }
+
+ if (this.match(types._new)) {
+ const id = this.startNode();
+ this.next();
+
+ if (this.match(types.parenL) || this.isRelational("<")) {
+ return this.tsParseSignatureMember("TSConstructSignatureDeclaration", node);
+ } else {
+ node.key = this.createIdentifier(id, "new");
+ return this.tsParsePropertyOrMethodSignature(node, false);
+ }
+ }
+
+ const readonly = !!this.tsParseModifier(["readonly"]);
+ const idx = this.tsTryParseIndexSignature(node);
+
+ if (idx) {
+ if (readonly) node.readonly = true;
+ return idx;
+ }
+
+ this.parsePropertyName(node, false);
+ return this.tsParsePropertyOrMethodSignature(node, readonly);
+ }
+
+ tsParseTypeLiteral() {
+ const node = this.startNode();
+ node.members = this.tsParseObjectTypeMembers();
+ return this.finishNode(node, "TSTypeLiteral");
+ }
+
+ tsParseObjectTypeMembers() {
+ this.expect(types.braceL);
+ const members = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
+ this.expect(types.braceR);
+ return members;
+ }
+
+ tsIsStartOfMappedType() {
+ this.next();
+
+ if (this.eat(types.plusMin)) {
+ return this.isContextual("readonly");
+ }
+
+ if (this.isContextual("readonly")) {
+ this.next();
+ }
+
+ if (!this.match(types.bracketL)) {
+ return false;
+ }
+
+ this.next();
+
+ if (!this.tsIsIdentifier()) {
+ return false;
+ }
+
+ this.next();
+ return this.match(types._in);
+ }
+
+ tsParseMappedTypeParameter() {
+ const node = this.startNode();
+ node.name = this.parseIdentifierName(node.start);
+ node.constraint = this.tsExpectThenParseType(types._in);
+ return this.finishNode(node, "TSTypeParameter");
+ }
+
+ tsParseMappedType() {
+ const node = this.startNode();
+ this.expect(types.braceL);
+
+ if (this.match(types.plusMin)) {
+ node.readonly = this.state.value;
+ this.next();
+ this.expectContextual("readonly");
+ } else if (this.eatContextual("readonly")) {
+ node.readonly = true;
+ }
+
+ this.expect(types.bracketL);
+ node.typeParameter = this.tsParseMappedTypeParameter();
+ this.expect(types.bracketR);
+
+ if (this.match(types.plusMin)) {
+ node.optional = this.state.value;
+ this.next();
+ this.expect(types.question);
+ } else if (this.eat(types.question)) {
+ node.optional = true;
+ }
+
+ node.typeAnnotation = this.tsTryParseType();
+ this.semicolon();
+ this.expect(types.braceR);
+ return this.finishNode(node, "TSMappedType");
+ }
+
+ tsParseTupleType() {
+ const node = this.startNode();
+ node.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), true, false);
+ let seenOptionalElement = false;
+ node.elementTypes.forEach(elementNode => {
+ if (elementNode.type === "TSOptionalType") {
+ seenOptionalElement = true;
+ } else if (seenOptionalElement && elementNode.type !== "TSRestType") {
+ this.raise(elementNode.start, "A required element cannot follow an optional element.");
+ }
+ });
+ return this.finishNode(node, "TSTupleType");
+ }
+
+ tsParseTupleElementType() {
+ if (this.match(types.ellipsis)) {
+ const restNode = this.startNode();
+ this.next();
+ restNode.typeAnnotation = this.tsParseType();
+
+ if (this.match(types.comma) && this.lookaheadCharCode() !== 93) {
+ this.raiseRestNotLast(this.state.start);
+ }
+
+ return this.finishNode(restNode, "TSRestType");
+ }
+
+ const type = this.tsParseType();
+
+ if (this.eat(types.question)) {
+ const optionalTypeNode = this.startNodeAtNode(type);
+ optionalTypeNode.typeAnnotation = type;
+ return this.finishNode(optionalTypeNode, "TSOptionalType");
+ }
+
+ return type;
+ }
+
+ tsParseParenthesizedType() {
+ const node = this.startNode();
+ this.expect(types.parenL);
+ node.typeAnnotation = this.tsParseType();
+ this.expect(types.parenR);
+ return this.finishNode(node, "TSParenthesizedType");
+ }
+
+ tsParseFunctionOrConstructorType(type) {
+ const node = this.startNode();
+
+ if (type === "TSConstructorType") {
+ this.expect(types._new);
+ }
+
+ this.tsFillSignature(types.arrow, node);
+ return this.finishNode(node, type);
+ }
+
+ tsParseLiteralTypeNode() {
+ const node = this.startNode();
+
+ node.literal = (() => {
+ switch (this.state.type) {
+ case types.num:
+ case types.string:
+ case types._true:
+ case types._false:
+ return this.parseExprAtom();
+
+ default:
+ throw this.unexpected();
+ }
+ })();
+
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseTemplateLiteralType() {
+ const node = this.startNode();
+ const templateNode = this.parseTemplate(false);
+
+ if (templateNode.expressions.length > 0) {
+ this.raise(templateNode.expressions[0].start, "Template literal types cannot have any substitution");
+ }
+
+ node.literal = templateNode;
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ tsParseThisTypeOrThisTypePredicate() {
+ const thisKeyword = this.tsParseThisTypeNode();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ return this.tsParseThisTypePredicate(thisKeyword);
+ } else {
+ return thisKeyword;
+ }
+ }
+
+ tsParseNonArrayType() {
+ switch (this.state.type) {
+ case types.name:
+ case types._void:
+ case types._null:
+ {
+ const type = this.match(types._void) ? "TSVoidKeyword" : this.match(types._null) ? "TSNullKeyword" : keywordTypeFromName(this.state.value);
+
+ if (type !== undefined && this.lookaheadCharCode() !== 46) {
+ const node = this.startNode();
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ return this.tsParseTypeReference();
+ }
+
+ case types.string:
+ case types.num:
+ case types._true:
+ case types._false:
+ return this.tsParseLiteralTypeNode();
+
+ case types.plusMin:
+ if (this.state.value === "-") {
+ const node = this.startNode();
+
+ if (this.lookahead().type !== types.num) {
+ throw this.unexpected();
+ }
+
+ node.literal = this.parseMaybeUnary();
+ return this.finishNode(node, "TSLiteralType");
+ }
+
+ break;
+
+ case types._this:
+ return this.tsParseThisTypeOrThisTypePredicate();
+
+ case types._typeof:
+ return this.tsParseTypeQuery();
+
+ case types._import:
+ return this.tsParseImportType();
+
+ case types.braceL:
+ return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
+
+ case types.bracketL:
+ return this.tsParseTupleType();
+
+ case types.parenL:
+ return this.tsParseParenthesizedType();
+
+ case types.backQuote:
+ return this.tsParseTemplateLiteralType();
+ }
+
+ throw this.unexpected();
+ }
+
+ tsParseArrayTypeOrHigher() {
+ let type = this.tsParseNonArrayType();
+
+ while (!this.hasPrecedingLineBreak() && this.eat(types.bracketL)) {
+ if (this.match(types.bracketR)) {
+ const node = this.startNodeAtNode(type);
+ node.elementType = type;
+ this.expect(types.bracketR);
+ type = this.finishNode(node, "TSArrayType");
+ } else {
+ const node = this.startNodeAtNode(type);
+ node.objectType = type;
+ node.indexType = this.tsParseType();
+ this.expect(types.bracketR);
+ type = this.finishNode(node, "TSIndexedAccessType");
+ }
+ }
+
+ return type;
+ }
+
+ tsParseTypeOperator(operator) {
+ const node = this.startNode();
+ this.expectContextual(operator);
+ node.operator = operator;
+ node.typeAnnotation = this.tsParseTypeOperatorOrHigher();
+
+ if (operator === "readonly") {
+ this.tsCheckTypeAnnotationForReadOnly(node);
+ }
+
+ return this.finishNode(node, "TSTypeOperator");
+ }
+
+ tsCheckTypeAnnotationForReadOnly(node) {
+ switch (node.typeAnnotation.type) {
+ case "TSTupleType":
+ case "TSArrayType":
+ return;
+
+ default:
+ this.raise(node.start, "'readonly' type modifier is only permitted on array and tuple literal types.");
+ }
+ }
+
+ tsParseInferType() {
+ const node = this.startNode();
+ this.expectContextual("infer");
+ const typeParameter = this.startNode();
+ typeParameter.name = this.parseIdentifierName(typeParameter.start);
+ node.typeParameter = this.finishNode(typeParameter, "TSTypeParameter");
+ return this.finishNode(node, "TSInferType");
+ }
+
+ tsParseTypeOperatorOrHigher() {
+ const operator = ["keyof", "unique", "readonly"].find(kw => this.isContextual(kw));
+ return operator ? this.tsParseTypeOperator(operator) : this.isContextual("infer") ? this.tsParseInferType() : this.tsParseArrayTypeOrHigher();
+ }
+
+ tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
+ this.eat(operator);
+ let type = parseConstituentType();
+
+ if (this.match(operator)) {
+ const types = [type];
+
+ while (this.eat(operator)) {
+ types.push(parseConstituentType());
+ }
+
+ const node = this.startNodeAtNode(type);
+ node.types = types;
+ type = this.finishNode(node, kind);
+ }
+
+ return type;
+ }
+
+ tsParseIntersectionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSIntersectionType", this.tsParseTypeOperatorOrHigher.bind(this), types.bitwiseAND);
+ }
+
+ tsParseUnionTypeOrHigher() {
+ return this.tsParseUnionOrIntersectionType("TSUnionType", this.tsParseIntersectionTypeOrHigher.bind(this), types.bitwiseOR);
+ }
+
+ tsIsStartOfFunctionType() {
+ if (this.isRelational("<")) {
+ return true;
+ }
+
+ return this.match(types.parenL) && this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this));
+ }
+
+ tsSkipParameterStart() {
+ if (this.match(types.name) || this.match(types._this)) {
+ this.next();
+ return true;
+ }
+
+ if (this.match(types.braceL)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(types.braceL)) {
+ ++braceStackCounter;
+ } else if (this.match(types.braceR)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ if (this.match(types.bracketL)) {
+ let braceStackCounter = 1;
+ this.next();
+
+ while (braceStackCounter > 0) {
+ if (this.match(types.bracketL)) {
+ ++braceStackCounter;
+ } else if (this.match(types.bracketR)) {
+ --braceStackCounter;
+ }
+
+ this.next();
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ tsIsUnambiguouslyStartOfFunctionType() {
+ this.next();
+
+ if (this.match(types.parenR) || this.match(types.ellipsis)) {
+ return true;
+ }
+
+ if (this.tsSkipParameterStart()) {
+ if (this.match(types.colon) || this.match(types.comma) || this.match(types.question) || this.match(types.eq)) {
+ return true;
+ }
+
+ if (this.match(types.parenR)) {
+ this.next();
+
+ if (this.match(types.arrow)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ tsParseTypeOrTypePredicateAnnotation(returnToken) {
+ return this.tsInType(() => {
+ const t = this.startNode();
+ this.expect(returnToken);
+ const asserts = this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));
+
+ if (asserts && this.match(types._this)) {
+ let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();
+
+ if (thisTypePredicate.type === "TSThisType") {
+ const node = this.startNodeAtNode(t);
+ node.parameterName = thisTypePredicate;
+ node.asserts = true;
+ thisTypePredicate = this.finishNode(node, "TSTypePredicate");
+ } else {
+ thisTypePredicate.asserts = true;
+ }
+
+ t.typeAnnotation = thisTypePredicate;
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));
+
+ if (!typePredicateVariable) {
+ if (!asserts) {
+ return this.tsParseTypeAnnotation(false, t);
+ }
+
+ const node = this.startNodeAtNode(t);
+ node.parameterName = this.parseIdentifier();
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ const type = this.tsParseTypeAnnotation(false);
+ const node = this.startNodeAtNode(t);
+ node.parameterName = typePredicateVariable;
+ node.typeAnnotation = type;
+ node.asserts = asserts;
+ t.typeAnnotation = this.finishNode(node, "TSTypePredicate");
+ return this.finishNode(t, "TSTypeAnnotation");
+ });
+ }
+
+ tsTryParseTypeOrTypePredicateAnnotation() {
+ return this.match(types.colon) ? this.tsParseTypeOrTypePredicateAnnotation(types.colon) : undefined;
+ }
+
+ tsTryParseTypeAnnotation() {
+ return this.match(types.colon) ? this.tsParseTypeAnnotation() : undefined;
+ }
+
+ tsTryParseType() {
+ return this.tsEatThenParseType(types.colon);
+ }
+
+ tsParseTypePredicatePrefix() {
+ const id = this.parseIdentifier();
+
+ if (this.isContextual("is") && !this.hasPrecedingLineBreak()) {
+ this.next();
+ return id;
+ }
+ }
+
+ tsParseTypePredicateAsserts() {
+ if (!this.match(types.name) || this.state.value !== "asserts" || this.hasPrecedingLineBreak()) {
+ return false;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.next();
+
+ if (!this.match(types.name) && !this.match(types._this)) {
+ return false;
+ }
+
+ if (containsEsc) {
+ this.raise(this.state.lastTokStart, "Escape sequence in keyword asserts");
+ }
+
+ return true;
+ }
+
+ tsParseTypeAnnotation(eatColon = true, t = this.startNode()) {
+ this.tsInType(() => {
+ if (eatColon) this.expect(types.colon);
+ t.typeAnnotation = this.tsParseType();
+ });
+ return this.finishNode(t, "TSTypeAnnotation");
+ }
+
+ tsParseType() {
+ assert(this.state.inType);
+ const type = this.tsParseNonConditionalType();
+
+ if (this.hasPrecedingLineBreak() || !this.eat(types._extends)) {
+ return type;
+ }
+
+ const node = this.startNodeAtNode(type);
+ node.checkType = type;
+ node.extendsType = this.tsParseNonConditionalType();
+ this.expect(types.question);
+ node.trueType = this.tsParseType();
+ this.expect(types.colon);
+ node.falseType = this.tsParseType();
+ return this.finishNode(node, "TSConditionalType");
+ }
+
+ tsParseNonConditionalType() {
+ if (this.tsIsStartOfFunctionType()) {
+ return this.tsParseFunctionOrConstructorType("TSFunctionType");
+ }
+
+ if (this.match(types._new)) {
+ return this.tsParseFunctionOrConstructorType("TSConstructorType");
+ }
+
+ return this.tsParseUnionTypeOrHigher();
+ }
+
+ tsParseTypeAssertion() {
+ const node = this.startNode();
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ node.typeAnnotation = _const || this.tsNextThenParseType();
+ this.expectRelational(">");
+ node.expression = this.parseMaybeUnary();
+ return this.finishNode(node, "TSTypeAssertion");
+ }
+
+ tsParseHeritageClause(descriptor) {
+ const originalStart = this.state.start;
+ const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", this.tsParseExpressionWithTypeArguments.bind(this));
+
+ if (!delimitedList.length) {
+ this.raise(originalStart, `'${descriptor}' list cannot be empty.`);
+ }
+
+ return delimitedList;
+ }
+
+ tsParseExpressionWithTypeArguments() {
+ const node = this.startNode();
+ node.expression = this.tsParseEntityName(false);
+
+ if (this.isRelational("<")) {
+ node.typeParameters = this.tsParseTypeArguments();
+ }
+
+ return this.finishNode(node, "TSExpressionWithTypeArguments");
+ }
+
+ tsParseInterfaceDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, BIND_TS_INTERFACE, undefined, "typescript interface declaration");
+ node.typeParameters = this.tsTryParseTypeParameters();
+
+ if (this.eat(types._extends)) {
+ node.extends = this.tsParseHeritageClause("extends");
+ }
+
+ const body = this.startNode();
+ body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));
+ node.body = this.finishNode(body, "TSInterfaceBody");
+ return this.finishNode(node, "TSInterfaceDeclaration");
+ }
+
+ tsParseTypeAliasDeclaration(node) {
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, BIND_TS_TYPE, undefined, "typescript type alias");
+ node.typeParameters = this.tsTryParseTypeParameters();
+ node.typeAnnotation = this.tsExpectThenParseType(types.eq);
+ this.semicolon();
+ return this.finishNode(node, "TSTypeAliasDeclaration");
+ }
+
+ tsInNoContext(cb) {
+ const oldContext = this.state.context;
+ this.state.context = [oldContext[0]];
+
+ try {
+ return cb();
+ } finally {
+ this.state.context = oldContext;
+ }
+ }
+
+ tsInType(cb) {
+ const oldInType = this.state.inType;
+ this.state.inType = true;
+
+ try {
+ return cb();
+ } finally {
+ this.state.inType = oldInType;
+ }
+ }
+
+ tsEatThenParseType(token) {
+ return !this.match(token) ? undefined : this.tsNextThenParseType();
+ }
+
+ tsExpectThenParseType(token) {
+ return this.tsDoThenParseType(() => this.expect(token));
+ }
+
+ tsNextThenParseType() {
+ return this.tsDoThenParseType(() => this.next());
+ }
+
+ tsDoThenParseType(cb) {
+ return this.tsInType(() => {
+ cb();
+ return this.tsParseType();
+ });
+ }
+
+ tsParseEnumMember() {
+ const node = this.startNode();
+ node.id = this.match(types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
+
+ if (this.eat(types.eq)) {
+ node.initializer = this.parseMaybeAssign();
+ }
+
+ return this.finishNode(node, "TSEnumMember");
+ }
+
+ tsParseEnumDeclaration(node, isConst) {
+ if (isConst) node.const = true;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM, undefined, "typescript enum declaration");
+ this.expect(types.braceL);
+ node.members = this.tsParseDelimitedList("EnumMembers", this.tsParseEnumMember.bind(this));
+ this.expect(types.braceR);
+ return this.finishNode(node, "TSEnumDeclaration");
+ }
+
+ tsParseModuleBlock() {
+ const node = this.startNode();
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(types.braceL);
+ this.parseBlockOrModuleBlockBody(node.body = [], undefined, true, types.braceR);
+ this.scope.exit();
+ return this.finishNode(node, "TSModuleBlock");
+ }
+
+ tsParseModuleOrNamespaceDeclaration(node, nested = false) {
+ node.id = this.parseIdentifier();
+
+ if (!nested) {
+ this.checkLVal(node.id, BIND_TS_NAMESPACE, null, "module or namespace declaration");
+ }
+
+ if (this.eat(types.dot)) {
+ const inner = this.startNode();
+ this.tsParseModuleOrNamespaceDeclaration(inner, true);
+ node.body = inner;
+ } else {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseAmbientExternalModuleDeclaration(node) {
+ if (this.isContextual("global")) {
+ node.global = true;
+ node.id = this.parseIdentifier();
+ } else if (this.match(types.string)) {
+ node.id = this.parseExprAtom();
+ } else {
+ this.unexpected();
+ }
+
+ if (this.match(types.braceL)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ node.body = this.tsParseModuleBlock();
+ this.prodParam.exit();
+ this.scope.exit();
+ } else {
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "TSModuleDeclaration");
+ }
+
+ tsParseImportEqualsDeclaration(node, isExport) {
+ node.isExport = isExport || false;
+ node.id = this.parseIdentifier();
+ this.checkLVal(node.id, BIND_LEXICAL, undefined, "import equals declaration");
+ this.expect(types.eq);
+ node.moduleReference = this.tsParseModuleReference();
+ this.semicolon();
+ return this.finishNode(node, "TSImportEqualsDeclaration");
+ }
+
+ tsIsExternalModuleReference() {
+ return this.isContextual("require") && this.lookaheadCharCode() === 40;
+ }
+
+ tsParseModuleReference() {
+ return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(false);
+ }
+
+ tsParseExternalModuleReference() {
+ const node = this.startNode();
+ this.expectContextual("require");
+ this.expect(types.parenL);
+
+ if (!this.match(types.string)) {
+ throw this.unexpected();
+ }
+
+ node.expression = this.parseExprAtom();
+ this.expect(types.parenR);
+ return this.finishNode(node, "TSExternalModuleReference");
+ }
+
+ tsLookAhead(f) {
+ const state = this.state.clone();
+ const res = f();
+ this.state = state;
+ return res;
+ }
+
+ tsTryParseAndCatch(f) {
+ const result = this.tryParse(abort => f() || abort());
+ if (result.aborted || !result.node) return undefined;
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ tsTryParse(f) {
+ const state = this.state.clone();
+ const result = f();
+
+ if (result !== undefined && result !== false) {
+ return result;
+ } else {
+ this.state = state;
+ return undefined;
+ }
+ }
+
+ tsTryParseDeclare(nany) {
+ if (this.isLineTerminator()) {
+ return;
+ }
+
+ let starttype = this.state.type;
+ let kind;
+
+ if (this.isContextual("let")) {
+ starttype = types._var;
+ kind = "let";
+ }
+
+ switch (starttype) {
+ case types._function:
+ return this.parseFunctionStatement(nany, false, true);
+
+ case types._class:
+ nany.declare = true;
+ return this.parseClass(nany, true, false);
+
+ case types._const:
+ if (this.match(types._const) && this.isLookaheadContextual("enum")) {
+ this.expect(types._const);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(nany, true);
+ }
+
+ case types._var:
+ kind = kind || this.state.value;
+ return this.parseVarStatement(nany, kind);
+
+ case types.name:
+ {
+ const value = this.state.value;
+
+ if (value === "global") {
+ return this.tsParseAmbientExternalModuleDeclaration(nany);
+ } else {
+ return this.tsParseDeclaration(nany, value, true);
+ }
+ }
+ }
+ }
+
+ tsTryParseExportDeclaration() {
+ return this.tsParseDeclaration(this.startNode(), this.state.value, true);
+ }
+
+ tsParseExpressionStatement(node, expr) {
+ switch (expr.name) {
+ case "declare":
+ {
+ const declaration = this.tsTryParseDeclare(node);
+
+ if (declaration) {
+ declaration.declare = true;
+ return declaration;
+ }
+
+ break;
+ }
+
+ case "global":
+ if (this.match(types.braceL)) {
+ this.scope.enter(SCOPE_TS_MODULE);
+ this.prodParam.enter(PARAM);
+ const mod = node;
+ mod.global = true;
+ mod.id = expr;
+ mod.body = this.tsParseModuleBlock();
+ this.scope.exit();
+ this.prodParam.exit();
+ return this.finishNode(mod, "TSModuleDeclaration");
+ }
+
+ break;
+
+ default:
+ return this.tsParseDeclaration(node, expr.name, false);
+ }
+ }
+
+ tsParseDeclaration(node, value, next) {
+ switch (value) {
+ case "abstract":
+ if (this.tsCheckLineTerminatorAndMatch(types._class, next)) {
+ const cls = node;
+ cls.abstract = true;
+
+ if (next) {
+ this.next();
+
+ if (!this.match(types._class)) {
+ this.unexpected(null, types._class);
+ }
+ }
+
+ return this.parseClass(cls, true, false);
+ }
+
+ break;
+
+ case "enum":
+ if (next || this.match(types.name)) {
+ if (next) this.next();
+ return this.tsParseEnumDeclaration(node, false);
+ }
+
+ break;
+
+ case "interface":
+ if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
+ if (next) this.next();
+ return this.tsParseInterfaceDeclaration(node);
+ }
+
+ break;
+
+ case "module":
+ if (next) this.next();
+
+ if (this.match(types.string)) {
+ return this.tsParseAmbientExternalModuleDeclaration(node);
+ } else if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+
+ break;
+
+ case "namespace":
+ if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
+ if (next) this.next();
+ return this.tsParseModuleOrNamespaceDeclaration(node);
+ }
+
+ break;
+
+ case "type":
+ if (this.tsCheckLineTerminatorAndMatch(types.name, next)) {
+ if (next) this.next();
+ return this.tsParseTypeAliasDeclaration(node);
+ }
+
+ break;
+ }
+ }
+
+ tsCheckLineTerminatorAndMatch(tokenType, next) {
+ return (next || this.match(tokenType)) && !this.isLineTerminator();
+ }
+
+ tsTryParseGenericAsyncArrowFunction(startPos, startLoc) {
+ if (!this.isRelational("<")) {
+ return undefined;
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ const res = this.tsTryParseAndCatch(() => {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.typeParameters = this.tsParseTypeParameters();
+ super.parseFunctionParams(node);
+ node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();
+ this.expect(types.arrow);
+ return node;
+ });
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+
+ if (!res) {
+ return undefined;
+ }
+
+ return this.parseArrowExpression(res, null, true);
+ }
+
+ tsParseTypeArguments() {
+ const node = this.startNode();
+ node.params = this.tsInType(() => this.tsInNoContext(() => {
+ this.expectRelational("<");
+ return this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this));
+ }));
+ this.state.exprAllowed = false;
+ this.expectRelational(">");
+ return this.finishNode(node, "TSTypeParameterInstantiation");
+ }
+
+ tsIsDeclarationStart() {
+ if (this.match(types.name)) {
+ switch (this.state.value) {
+ case "abstract":
+ case "declare":
+ case "enum":
+ case "interface":
+ case "module":
+ case "namespace":
+ case "type":
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.tsIsDeclarationStart()) return false;
+ return super.isExportDefaultSpecifier();
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let accessibility;
+ let readonly = false;
+
+ if (allowModifiers) {
+ accessibility = this.parseAccessModifier();
+ readonly = !!this.tsParseModifier(["readonly"]);
+ }
+
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (accessibility || readonly) {
+ const pp = this.startNodeAt(startPos, startLoc);
+
+ if (decorators.length) {
+ pp.decorators = decorators;
+ }
+
+ if (accessibility) pp.accessibility = accessibility;
+ if (readonly) pp.readonly = readonly;
+
+ if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") {
+ this.raise(pp.start, "A parameter property may not be declared using a binding pattern.");
+ }
+
+ pp.parameter = elt;
+ return this.finishNode(pp, "TSParameterProperty");
+ }
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ if (this.match(types.colon)) {
+ node.returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);
+ }
+
+ const bodilessType = type === "FunctionDeclaration" ? "TSDeclareFunction" : type === "ClassMethod" ? "TSDeclareMethod" : undefined;
+
+ if (bodilessType && !this.match(types.braceL) && this.isLineTerminator()) {
+ this.finishNode(node, bodilessType);
+ return;
+ }
+
+ super.parseFunctionBodyAndFinish(node, type, isMethod);
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.body && node.id) {
+ this.checkLVal(node.id, BIND_TS_AMBIENT, null, "function name");
+ } else {
+ super.registerFunctionStatementId(...arguments);
+ }
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!this.hasPrecedingLineBreak() && this.match(types.bang)) {
+ this.state.exprAllowed = false;
+ this.next();
+ const nonNullExpression = this.startNodeAt(startPos, startLoc);
+ nonNullExpression.expression = base;
+ return this.finishNode(nonNullExpression, "TSNonNullExpression");
+ }
+
+ if (this.isRelational("<")) {
+ const result = this.tsTryParseAndCatch(() => {
+ if (!noCalls && this.atPossibleAsync(base)) {
+ const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(startPos, startLoc);
+
+ if (asyncArrowFn) {
+ return asyncArrowFn;
+ }
+ }
+
+ const node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (typeArguments) {
+ if (!noCalls && this.eat(types.parenL)) {
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ node.typeParameters = typeArguments;
+ return this.finishCallExpression(node, state.optionalChainMember);
+ } else if (this.match(types.backQuote)) {
+ return this.parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments);
+ }
+ }
+
+ this.unexpected();
+ });
+ if (result) return result;
+ }
+
+ return super.parseSubscript(base, startPos, startLoc, noCalls, state);
+ }
+
+ parseNewArguments(node) {
+ if (this.isRelational("<")) {
+ const typeParameters = this.tsTryParseAndCatch(() => {
+ const args = this.tsParseTypeArguments();
+ if (!this.match(types.parenL)) this.unexpected();
+ return args;
+ });
+
+ if (typeParameters) {
+ node.typeParameters = typeParameters;
+ }
+ }
+
+ super.parseNewArguments(node);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
+ if (nonNull(types._in.binop) > minPrec && !this.hasPrecedingLineBreak() && this.isContextual("as")) {
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.expression = left;
+
+ const _const = this.tsTryNextParseConstantContext();
+
+ if (_const) {
+ node.typeAnnotation = _const;
+ } else {
+ node.typeAnnotation = this.tsNextThenParseType();
+ }
+
+ this.finishNode(node, "TSAsExpression");
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
+ }
+
+ return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn);
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {}
+
+ checkDuplicateExports() {}
+
+ parseImport(node) {
+ if (this.match(types.name) && this.lookahead().type === types.eq) {
+ return this.tsParseImportEqualsDeclaration(node);
+ }
+
+ return super.parseImport(node);
+ }
+
+ parseExport(node) {
+ if (this.match(types._import)) {
+ this.expect(types._import);
+ return this.tsParseImportEqualsDeclaration(node, true);
+ } else if (this.eat(types.eq)) {
+ const assign = node;
+ assign.expression = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(assign, "TSExportAssignment");
+ } else if (this.eatContextual("as")) {
+ const decl = node;
+ this.expectContextual("namespace");
+ decl.id = this.parseIdentifier();
+ this.semicolon();
+ return this.finishNode(decl, "TSNamespaceExportDeclaration");
+ } else {
+ return super.parseExport(node);
+ }
+ }
+
+ isAbstractClass() {
+ return this.isContextual("abstract") && this.lookahead().type === types._class;
+ }
+
+ parseExportDefaultExpression() {
+ if (this.isAbstractClass()) {
+ const cls = this.startNode();
+ this.next();
+ this.parseClass(cls, true, true);
+ cls.abstract = true;
+ return cls;
+ }
+
+ if (this.state.value === "interface") {
+ const result = this.tsParseDeclaration(this.startNode(), this.state.value, true);
+ if (result) return result;
+ }
+
+ return super.parseExportDefaultExpression();
+ }
+
+ parseStatementContent(context, topLevel) {
+ if (this.state.type === types._const) {
+ const ahead = this.lookahead();
+
+ if (ahead.type === types.name && ahead.value === "enum") {
+ const node = this.startNode();
+ this.expect(types._const);
+ this.expectContextual("enum");
+ return this.tsParseEnumDeclaration(node, true);
+ }
+ }
+
+ return super.parseStatementContent(context, topLevel);
+ }
+
+ parseAccessModifier() {
+ return this.tsParseModifier(["public", "protected", "private"]);
+ }
+
+ parseClassMember(classBody, member, state, constructorAllowsSuper) {
+ this.tsParseModifiers(member, ["declare"]);
+ const accessibility = this.parseAccessModifier();
+ if (accessibility) member.accessibility = accessibility;
+ this.tsParseModifiers(member, ["declare"]);
+ super.parseClassMember(classBody, member, state, constructorAllowsSuper);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) {
+ this.tsParseModifiers(member, ["abstract", "readonly", "declare"]);
+ const idx = this.tsTryParseIndexSignature(member);
+
+ if (idx) {
+ classBody.body.push(idx);
+
+ if (member.abstract) {
+ this.raise(member.start, "Index signatures cannot have the 'abstract' modifier");
+ }
+
+ if (isStatic) {
+ this.raise(member.start, "Index signatures cannot have the 'static' modifier");
+ }
+
+ if (member.accessibility) {
+ this.raise(member.start, `Index signatures cannot have an accessibility modifier ('${member.accessibility}')`);
+ }
+
+ return;
+ }
+
+ super.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {
+ const optional = this.eat(types.question);
+ if (optional) methodOrProp.optional = true;
+
+ if (methodOrProp.readonly && this.match(types.parenL)) {
+ this.raise(methodOrProp.start, "Class methods cannot have the 'readonly' modifier");
+ }
+
+ if (methodOrProp.declare && this.match(types.parenL)) {
+ this.raise(methodOrProp.start, "Class methods cannot have the 'declare' modifier");
+ }
+ }
+
+ parseExpressionStatement(node, expr) {
+ const decl = expr.type === "Identifier" ? this.tsParseExpressionStatement(node, expr) : undefined;
+ return decl || super.parseExpressionStatement(node, expr);
+ }
+
+ shouldParseExportDeclaration() {
+ if (this.tsIsDeclarationStart()) return true;
+ return super.shouldParseExportDeclaration();
+ }
+
+ parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
+ if (!refNeedsArrowPos || !this.match(types.question)) {
+ return super.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
+ }
+
+ const result = this.tryParse(() => super.parseConditional(expr, noIn, startPos, startLoc));
+
+ if (!result.node) {
+ refNeedsArrowPos.start = result.error.pos || this.state.start;
+ return expr;
+ }
+
+ if (result.error) this.state = result.failState;
+ return result.node;
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ node = super.parseParenItem(node, startPos, startLoc);
+
+ if (this.eat(types.question)) {
+ node.optional = true;
+ this.resetEndLocation(node);
+ }
+
+ if (this.match(types.colon)) {
+ const typeCastNode = this.startNodeAt(startPos, startLoc);
+ typeCastNode.expression = node;
+ typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();
+ return this.finishNode(typeCastNode, "TSTypeCastExpression");
+ }
+
+ return node;
+ }
+
+ parseExportDeclaration(node) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const isDeclare = this.eatContextual("declare");
+ let declaration;
+
+ if (this.match(types.name)) {
+ declaration = this.tsTryParseExportDeclaration();
+ }
+
+ if (!declaration) {
+ declaration = super.parseExportDeclaration(node);
+ }
+
+ if (declaration && isDeclare) {
+ this.resetStartLocation(declaration, startPos, startLoc);
+ declaration.declare = true;
+ }
+
+ return declaration;
+ }
+
+ parseClassId(node, isStatement, optionalId) {
+ if ((!isStatement || optionalId) && this.isContextual("implements")) {
+ return;
+ }
+
+ super.parseClassId(node, isStatement, optionalId, node.declare ? BIND_TS_AMBIENT : BIND_CLASS);
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ }
+
+ parseClassPropertyAnnotation(node) {
+ if (!node.optional && this.eat(types.bang)) {
+ node.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) node.typeAnnotation = type;
+ }
+
+ parseClassProperty(node) {
+ this.parseClassPropertyAnnotation(node);
+
+ if (node.declare && this.match(types.equal)) {
+ this.raise(this.state.start, "'declare' class fields cannot have an initializer");
+ }
+
+ return super.parseClassProperty(node);
+ }
+
+ parseClassPrivateProperty(node) {
+ if (node.abstract) {
+ this.raise(node.start, "Private elements cannot have the 'abstract' modifier.");
+ }
+
+ if (node.accessibility) {
+ this.raise(node.start, `Private elements cannot have an accessibility modifier ('${node.accessibility}')`);
+ }
+
+ this.parseClassPropertyAnnotation(node);
+ return super.parseClassPrivateProperty(node);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) method.typeParameters = typeParameters;
+ super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
+ }
+
+ parseClassSuper(node) {
+ super.parseClassSuper(node);
+
+ if (node.superClass && this.isRelational("<")) {
+ node.superTypeParameters = this.tsParseTypeArguments();
+ }
+
+ if (this.eatContextual("implements")) {
+ node.implements = this.tsParseHeritageClause("implements");
+ }
+ }
+
+ parseObjPropValue(prop, ...args) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) prop.typeParameters = typeParameters;
+ super.parseObjPropValue(prop, ...args);
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const typeParameters = this.tsTryParseTypeParameters();
+ if (typeParameters) node.typeParameters = typeParameters;
+ super.parseFunctionParams(node, allowModifiers);
+ }
+
+ parseVarId(decl, kind) {
+ super.parseVarId(decl, kind);
+
+ if (decl.id.type === "Identifier" && this.eat(types.bang)) {
+ decl.definite = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+
+ if (type) {
+ decl.id.typeAnnotation = type;
+ this.resetEndLocation(decl.id);
+ }
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ if (this.match(types.colon)) {
+ node.returnType = this.tsParseTypeAnnotation();
+ }
+
+ return super.parseAsyncArrowFromCallExpression(node, call);
+ }
+
+ parseMaybeAssign(...args) {
+ let state;
+ let jsx;
+ let typeCast;
+
+ if (this.match(types.jsxTagStart)) {
+ state = this.state.clone();
+ jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!jsx.error) return jsx.node;
+ const {
+ context
+ } = this.state;
+
+ if (context[context.length - 1] === types$1.j_oTag) {
+ context.length -= 2;
+ } else if (context[context.length - 1] === types$1.j_expr) {
+ context.length -= 1;
+ }
+ }
+
+ if (!(jsx && jsx.error) && !this.isRelational("<")) {
+ return super.parseMaybeAssign(...args);
+ }
+
+ let typeParameters;
+ state = state || this.state.clone();
+ const arrow = this.tryParse(abort => {
+ typeParameters = this.tsParseTypeParameters();
+ const expr = super.parseMaybeAssign(...args);
+
+ if (expr.type !== "ArrowFunctionExpression" || expr.extra && expr.extra.parenthesized) {
+ abort();
+ }
+
+ if (typeParameters && typeParameters.params.length !== 0) {
+ this.resetStartLocationFromNode(expr, typeParameters);
+ }
+
+ expr.typeParameters = typeParameters;
+ return expr;
+ }, state);
+ if (!arrow.error && !arrow.aborted) return arrow.node;
+
+ if (!jsx) {
+ assert(!this.hasPlugin("jsx"));
+ typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);
+ if (!typeCast.error) return typeCast.node;
+ }
+
+ if (jsx && jsx.node) {
+ this.state = jsx.failState;
+ return jsx.node;
+ }
+
+ if (arrow.node) {
+ this.state = arrow.failState;
+ return arrow.node;
+ }
+
+ if (typeCast && typeCast.node) {
+ this.state = typeCast.failState;
+ return typeCast.node;
+ }
+
+ if (jsx && jsx.thrown) throw jsx.error;
+ if (arrow.thrown) throw arrow.error;
+ if (typeCast && typeCast.thrown) throw typeCast.error;
+ throw jsx && jsx.error || arrow.error || typeCast && typeCast.error;
+ }
+
+ parseMaybeUnary(refExpressionErrors) {
+ if (!this.hasPlugin("jsx") && this.isRelational("<")) {
+ return this.tsParseTypeAssertion();
+ } else {
+ return super.parseMaybeUnary(refExpressionErrors);
+ }
+ }
+
+ parseArrow(node) {
+ if (this.match(types.colon)) {
+ const result = this.tryParse(abort => {
+ const returnType = this.tsParseTypeOrTypePredicateAnnotation(types.colon);
+ if (this.canInsertSemicolon() || !this.match(types.arrow)) abort();
+ return returnType;
+ });
+ if (result.aborted) return;
+
+ if (!result.thrown) {
+ if (result.error) this.state = result.failState;
+ node.returnType = result.node;
+ }
+ }
+
+ return super.parseArrow(node);
+ }
+
+ parseAssignableListItemTypes(param) {
+ if (this.eat(types.question)) {
+ if (param.type !== "Identifier") {
+ this.raise(param.start, "A binding pattern parameter cannot be optional in an implementation signature.");
+ }
+
+ param.optional = true;
+ }
+
+ const type = this.tsTryParseTypeAnnotation();
+ if (type) param.typeAnnotation = type;
+ this.resetEndLocation(param);
+ return param;
+ }
+
+ toAssignable(node) {
+ switch (node.type) {
+ case "TSTypeCastExpression":
+ return super.toAssignable(this.typeCastToParameter(node));
+
+ case "TSParameterProperty":
+ return super.toAssignable(node);
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ node.expression = this.toAssignable(node.expression);
+ return node;
+
+ default:
+ return super.toAssignable(node);
+ }
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription) {
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ return;
+
+ case "TSParameterProperty":
+ this.checkLVal(expr.parameter, bindingType, checkClashes, "parameter property");
+ return;
+
+ case "TSAsExpression":
+ case "TSNonNullExpression":
+ case "TSTypeAssertion":
+ this.checkLVal(expr.expression, bindingType, checkClashes, contextDescription);
+ return;
+
+ default:
+ super.checkLVal(expr, bindingType, checkClashes, contextDescription);
+ return;
+ }
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case types._this:
+ return this.parseIdentifier(true);
+
+ default:
+ return super.parseBindingAtom();
+ }
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsParseTypeArguments();
+
+ if (this.match(types.parenL)) {
+ const call = super.parseMaybeDecoratorArguments(expr);
+ call.typeParameters = typeArguments;
+ return call;
+ }
+
+ this.unexpected(this.state.start, types.parenL);
+ }
+
+ return super.parseMaybeDecoratorArguments(expr);
+ }
+
+ isClassMethod() {
+ return this.isRelational("<") || super.isClassMethod();
+ }
+
+ isClassProperty() {
+ return this.match(types.bang) || this.match(types.colon) || super.isClassProperty();
+ }
+
+ parseMaybeDefault(...args) {
+ const node = super.parseMaybeDefault(...args);
+
+ if (node.type === "AssignmentPattern" && node.typeAnnotation && node.right.start < node.typeAnnotation.start) {
+ this.raise(node.typeAnnotation.start, "Type annotations must come before default assignments, " + "e.g. instead of `age = 25: number` use `age: number = 25`");
+ }
+
+ return node;
+ }
+
+ getTokenFromCode(code) {
+ if (this.state.inType && (code === 62 || code === 60)) {
+ return this.finishOp(types.relational, 1);
+ } else {
+ return super.getTokenFromCode(code);
+ }
+ }
+
+ toAssignableList(exprList) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+ if (!expr) continue;
+
+ switch (expr.type) {
+ case "TSTypeCastExpression":
+ exprList[i] = this.typeCastToParameter(expr);
+ break;
+
+ case "TSAsExpression":
+ case "TSTypeAssertion":
+ if (!this.state.maybeInArrowParameters) {
+ exprList[i] = this.typeCastToParameter(expr);
+ } else {
+ this.raise(expr.start, "Unexpected type cast in parameter position.");
+ }
+
+ break;
+ }
+ }
+
+ return super.toAssignableList(...arguments);
+ }
+
+ typeCastToParameter(node) {
+ node.expression.typeAnnotation = node.typeAnnotation;
+ this.resetEndLocation(node.expression, node.typeAnnotation.end, node.typeAnnotation.loc.end);
+ return node.expression;
+ }
+
+ toReferencedList(exprList, isInParens) {
+ for (let i = 0; i < exprList.length; i++) {
+ const expr = exprList[i];
+
+ if (expr && expr.type === "TSTypeCastExpression") {
+ this.raise(expr.start, "Did not expect a type annotation here.");
+ }
+ }
+
+ return exprList;
+ }
+
+ shouldParseArrow() {
+ return this.match(types.colon) || super.shouldParseArrow();
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(types.colon) || super.shouldParseAsyncArrow();
+ }
+
+ canHaveLeadingDecorator() {
+ return super.canHaveLeadingDecorator() || this.isAbstractClass();
+ }
+
+ jsxParseOpeningElementAfterName(node) {
+ if (this.isRelational("<")) {
+ const typeArguments = this.tsTryParseAndCatch(() => this.tsParseTypeArguments());
+ if (typeArguments) node.typeParameters = typeArguments;
+ }
+
+ return super.jsxParseOpeningElementAfterName(node);
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ const baseCount = super.getGetterSetterExpectedParamCount(method);
+ const firstParam = method.params[0];
+ const hasContextParam = firstParam && firstParam.type === "Identifier" && firstParam.name === "this";
+ return hasContextParam ? baseCount + 1 : baseCount;
+ }
+
+});
+
+types.placeholder = new TokenType("%%", {
+ startsExpr: true
+});
+var placeholders = (superClass => class extends superClass {
+ parsePlaceholder(expectedNode) {
+ if (this.match(types.placeholder)) {
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace("Unexpected space in placeholder.");
+ node.name = super.parseIdentifier(true);
+ this.assertNoSpace("Unexpected space in placeholder.");
+ this.expect(types.placeholder);
+ return this.finishPlaceholder(node, expectedNode);
+ }
+ }
+
+ finishPlaceholder(node, expectedNode) {
+ const isFinished = !!(node.expectedNode && node.type === "Placeholder");
+ node.expectedNode = expectedNode;
+ return isFinished ? node : this.finishNode(node, "Placeholder");
+ }
+
+ getTokenFromCode(code) {
+ if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) {
+ return this.finishOp(types.placeholder, 2);
+ }
+
+ return super.getTokenFromCode(...arguments);
+ }
+
+ parseExprAtom() {
+ return this.parsePlaceholder("Expression") || super.parseExprAtom(...arguments);
+ }
+
+ parseIdentifier() {
+ return this.parsePlaceholder("Identifier") || super.parseIdentifier(...arguments);
+ }
+
+ checkReservedWord(word) {
+ if (word !== undefined) super.checkReservedWord(...arguments);
+ }
+
+ parseBindingAtom() {
+ return this.parsePlaceholder("Pattern") || super.parseBindingAtom(...arguments);
+ }
+
+ checkLVal(expr) {
+ if (expr.type !== "Placeholder") super.checkLVal(...arguments);
+ }
+
+ toAssignable(node) {
+ if (node && node.type === "Placeholder" && node.expectedNode === "Expression") {
+ node.expectedNode = "Pattern";
+ return node;
+ }
+
+ return super.toAssignable(...arguments);
+ }
+
+ verifyBreakContinue(node) {
+ if (node.label && node.label.type === "Placeholder") return;
+ super.verifyBreakContinue(...arguments);
+ }
+
+ parseExpressionStatement(node, expr) {
+ if (expr.type !== "Placeholder" || expr.extra && expr.extra.parenthesized) {
+ return super.parseExpressionStatement(...arguments);
+ }
+
+ if (this.match(types.colon)) {
+ const stmt = node;
+ stmt.label = this.finishPlaceholder(expr, "Identifier");
+ this.next();
+ stmt.body = this.parseStatement("label");
+ return this.finishNode(stmt, "LabeledStatement");
+ }
+
+ this.semicolon();
+ node.name = expr.name;
+ return this.finishPlaceholder(node, "Statement");
+ }
+
+ parseBlock() {
+ return this.parsePlaceholder("BlockStatement") || super.parseBlock(...arguments);
+ }
+
+ parseFunctionId() {
+ return this.parsePlaceholder("Identifier") || super.parseFunctionId(...arguments);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ const type = isStatement ? "ClassDeclaration" : "ClassExpression";
+ this.next();
+ this.takeDecorators(node);
+ const placeholder = this.parsePlaceholder("Identifier");
+
+ if (placeholder) {
+ if (this.match(types._extends) || this.match(types.placeholder) || this.match(types.braceL)) {
+ node.id = placeholder;
+ } else if (optionalId || !isStatement) {
+ node.id = null;
+ node.body = this.finishPlaceholder(placeholder, "ClassBody");
+ return this.finishNode(node, type);
+ } else {
+ this.unexpected(null, "A class name is required");
+ }
+ } else {
+ this.parseClassId(node, isStatement, optionalId);
+ }
+
+ this.parseClassSuper(node);
+ node.body = this.parsePlaceholder("ClassBody") || this.parseClassBody(!!node.superClass);
+ return this.finishNode(node, type);
+ }
+
+ parseExport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseExport(...arguments);
+
+ if (!this.isContextual("from") && !this.match(types.comma)) {
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.finishPlaceholder(placeholder, "Declaration");
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = placeholder;
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return super.parseExport(node);
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (node.specifiers && node.specifiers.length > 0) {
+ return true;
+ }
+
+ return super.maybeParseExportDefaultSpecifier(...arguments);
+ }
+
+ checkExport(node) {
+ const {
+ specifiers
+ } = node;
+
+ if (specifiers && specifiers.length) {
+ node.specifiers = specifiers.filter(node => node.exported.type === "Placeholder");
+ }
+
+ super.checkExport(node);
+ node.specifiers = specifiers;
+ }
+
+ parseImport(node) {
+ const placeholder = this.parsePlaceholder("Identifier");
+ if (!placeholder) return super.parseImport(...arguments);
+ node.specifiers = [];
+
+ if (!this.isContextual("from") && !this.match(types.comma)) {
+ node.source = this.finishPlaceholder(placeholder, "StringLiteral");
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ const specifier = this.startNodeAtNode(placeholder);
+ specifier.local = placeholder;
+ this.finishNode(specifier, "ImportDefaultSpecifier");
+ node.specifiers.push(specifier);
+
+ if (this.eat(types.comma)) {
+ const hasStarImport = this.maybeParseStarImportSpecifier(node);
+ if (!hasStarImport) this.parseNamedImportSpecifiers(node);
+ }
+
+ this.expectContextual("from");
+ node.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ return this.parsePlaceholder("StringLiteral") || super.parseImportSource(...arguments);
+ }
+
+});
+
+var v8intrinsic = (superClass => class extends superClass {
+ parseV8Intrinsic() {
+ if (this.match(types.modulo)) {
+ const v8IntrinsicStart = this.state.start;
+ const node = this.startNode();
+ this.eat(types.modulo);
+
+ if (this.match(types.name)) {
+ const name = this.parseIdentifierName(this.state.start);
+ const identifier = this.createIdentifier(node, name);
+ identifier.type = "V8IntrinsicIdentifier";
+
+ if (this.match(types.parenL)) {
+ return identifier;
+ }
+ }
+
+ this.unexpected(v8IntrinsicStart);
+ }
+ }
+
+ parseExprAtom() {
+ return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);
+ }
+
+});
+
+function hasPlugin(plugins, name) {
+ return plugins.some(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+}
+function getPluginOption(plugins, name, option) {
+ const plugin = plugins.find(plugin => {
+ if (Array.isArray(plugin)) {
+ return plugin[0] === name;
+ } else {
+ return plugin === name;
+ }
+ });
+
+ if (plugin && Array.isArray(plugin)) {
+ return plugin[1][option];
+ }
+
+ return null;
+}
+const PIPELINE_PROPOSALS = ["minimal", "smart", "fsharp"];
+function validatePlugins(plugins) {
+ if (hasPlugin(plugins, "decorators")) {
+ if (hasPlugin(plugins, "decorators-legacy")) {
+ throw new Error("Cannot use the decorators and decorators-legacy plugin together");
+ }
+
+ const decoratorsBeforeExport = getPluginOption(plugins, "decorators", "decoratorsBeforeExport");
+
+ if (decoratorsBeforeExport == null) {
+ throw new Error("The 'decorators' plugin requires a 'decoratorsBeforeExport' option," + " whose value must be a boolean. If you are migrating from" + " Babylon/Babel 6 or want to use the old decorators proposal, you" + " should use the 'decorators-legacy' plugin instead of 'decorators'.");
+ } else if (typeof decoratorsBeforeExport !== "boolean") {
+ throw new Error("'decoratorsBeforeExport' must be a boolean.");
+ }
+ }
+
+ if (hasPlugin(plugins, "flow") && hasPlugin(plugins, "typescript")) {
+ throw new Error("Cannot combine flow and typescript plugins.");
+ }
+
+ if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) {
+ throw new Error("Cannot combine placeholders and v8intrinsic plugins.");
+ }
+
+ if (hasPlugin(plugins, "pipelineOperator") && !PIPELINE_PROPOSALS.includes(getPluginOption(plugins, "pipelineOperator", "proposal"))) {
+ throw new Error("'pipelineOperator' requires 'proposal' option whose value should be one of: " + PIPELINE_PROPOSALS.map(p => `'${p}'`).join(", "));
+ }
+}
+const mixinPlugins = {
+ estree,
+ jsx,
+ flow,
+ typescript,
+ v8intrinsic,
+ placeholders
+};
+const mixinPluginNames = Object.keys(mixinPlugins);
+
+const defaultOptions = {
+ sourceType: "script",
+ sourceFilename: undefined,
+ startLine: 1,
+ allowAwaitOutsideFunction: false,
+ allowReturnOutsideFunction: false,
+ allowImportExportEverywhere: false,
+ allowSuperOutsideMethod: false,
+ allowUndeclaredExports: false,
+ plugins: [],
+ strictMode: null,
+ ranges: false,
+ tokens: false,
+ createParenthesizedExpressions: false,
+ errorRecovery: false
+};
+function getOptions(opts) {
+ const options = {};
+
+ for (let _i = 0, _Object$keys = Object.keys(defaultOptions); _i < _Object$keys.length; _i++) {
+ const key = _Object$keys[_i];
+ options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];
+ }
+
+ return options;
+}
+
+class Position {
+ constructor(line, col) {
+ this.line = line;
+ this.column = col;
+ }
+
+}
+class SourceLocation {
+ constructor(start, end) {
+ this.start = start;
+ this.end = end;
+ }
+
+}
+function getLineInfo(input, offset) {
+ let line = 1;
+ let lineStart = 0;
+ let match;
+ lineBreakG.lastIndex = 0;
+
+ while ((match = lineBreakG.exec(input)) && match.index < offset) {
+ line++;
+ lineStart = lineBreakG.lastIndex;
+ }
+
+ return new Position(line, offset - lineStart);
+}
+
+class BaseParser {
+ constructor() {
+ this.sawUnambiguousESM = false;
+ this.ambiguousScriptDifferentAst = false;
+ }
+
+ hasPlugin(name) {
+ return this.plugins.has(name);
+ }
+
+ getPluginOption(plugin, name) {
+ if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];
+ }
+
+}
+
+function last(stack) {
+ return stack[stack.length - 1];
+}
+
+class CommentsParser extends BaseParser {
+ addComment(comment) {
+ if (this.filename) comment.loc.filename = this.filename;
+ this.state.trailingComments.push(comment);
+ this.state.leadingComments.push(comment);
+ }
+
+ adjustCommentsAfterTrailingComma(node, elements, takeAllComments) {
+ if (this.state.leadingComments.length === 0) {
+ return;
+ }
+
+ let lastElement = null;
+ let i = elements.length;
+
+ while (lastElement === null && i > 0) {
+ lastElement = elements[--i];
+ }
+
+ if (lastElement === null) {
+ return;
+ }
+
+ for (let j = 0; j < this.state.leadingComments.length; j++) {
+ if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
+ this.state.leadingComments.splice(j, 1);
+ j--;
+ }
+ }
+
+ const newTrailingComments = [];
+
+ for (let i = 0; i < this.state.leadingComments.length; i++) {
+ const leadingComment = this.state.leadingComments[i];
+
+ if (leadingComment.end < node.end) {
+ newTrailingComments.push(leadingComment);
+
+ if (!takeAllComments) {
+ this.state.leadingComments.splice(i, 1);
+ i--;
+ }
+ } else {
+ if (node.trailingComments === undefined) {
+ node.trailingComments = [];
+ }
+
+ node.trailingComments.push(leadingComment);
+ }
+ }
+
+ if (takeAllComments) this.state.leadingComments = [];
+
+ if (newTrailingComments.length > 0) {
+ lastElement.trailingComments = newTrailingComments;
+ } else if (lastElement.trailingComments !== undefined) {
+ lastElement.trailingComments = [];
+ }
+ }
+
+ processComment(node) {
+ if (node.type === "Program" && node.body.length > 0) return;
+ const stack = this.state.commentStack;
+ let firstChild, lastChild, trailingComments, i, j;
+
+ if (this.state.trailingComments.length > 0) {
+ if (this.state.trailingComments[0].start >= node.end) {
+ trailingComments = this.state.trailingComments;
+ this.state.trailingComments = [];
+ } else {
+ this.state.trailingComments.length = 0;
+ }
+ } else if (stack.length > 0) {
+ const lastInStack = last(stack);
+
+ if (lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) {
+ trailingComments = lastInStack.trailingComments;
+ delete lastInStack.trailingComments;
+ }
+ }
+
+ if (stack.length > 0 && last(stack).start >= node.start) {
+ firstChild = stack.pop();
+ }
+
+ while (stack.length > 0 && last(stack).start >= node.start) {
+ lastChild = stack.pop();
+ }
+
+ if (!lastChild && firstChild) lastChild = firstChild;
+
+ if (firstChild) {
+ switch (node.type) {
+ case "ObjectExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.properties);
+ break;
+
+ case "ObjectPattern":
+ this.adjustCommentsAfterTrailingComma(node, node.properties, true);
+ break;
+
+ case "CallExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.arguments);
+ break;
+
+ case "ArrayExpression":
+ this.adjustCommentsAfterTrailingComma(node, node.elements);
+ break;
+
+ case "ArrayPattern":
+ this.adjustCommentsAfterTrailingComma(node, node.elements, true);
+ break;
+ }
+ } else if (this.state.commentPreviousNode && (this.state.commentPreviousNode.type === "ImportSpecifier" && node.type !== "ImportSpecifier" || this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) {
+ this.adjustCommentsAfterTrailingComma(node, [this.state.commentPreviousNode]);
+ }
+
+ if (lastChild) {
+ if (lastChild.leadingComments) {
+ if (lastChild !== node && lastChild.leadingComments.length > 0 && last(lastChild.leadingComments).end <= node.start) {
+ node.leadingComments = lastChild.leadingComments;
+ delete lastChild.leadingComments;
+ } else {
+ for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {
+ if (lastChild.leadingComments[i].end <= node.start) {
+ node.leadingComments = lastChild.leadingComments.splice(0, i + 1);
+ break;
+ }
+ }
+ }
+ }
+ } else if (this.state.leadingComments.length > 0) {
+ if (last(this.state.leadingComments).end <= node.start) {
+ if (this.state.commentPreviousNode) {
+ for (j = 0; j < this.state.leadingComments.length; j++) {
+ if (this.state.leadingComments[j].end < this.state.commentPreviousNode.end) {
+ this.state.leadingComments.splice(j, 1);
+ j--;
+ }
+ }
+ }
+
+ if (this.state.leadingComments.length > 0) {
+ node.leadingComments = this.state.leadingComments;
+ this.state.leadingComments = [];
+ }
+ } else {
+ for (i = 0; i < this.state.leadingComments.length; i++) {
+ if (this.state.leadingComments[i].end > node.start) {
+ break;
+ }
+ }
+
+ const leadingComments = this.state.leadingComments.slice(0, i);
+
+ if (leadingComments.length) {
+ node.leadingComments = leadingComments;
+ }
+
+ trailingComments = this.state.leadingComments.slice(i);
+
+ if (trailingComments.length === 0) {
+ trailingComments = null;
+ }
+ }
+ }
+
+ this.state.commentPreviousNode = node;
+
+ if (trailingComments) {
+ if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) {
+ node.innerComments = trailingComments;
+ } else {
+ node.trailingComments = trailingComments;
+ }
+ }
+
+ stack.push(node);
+ }
+
+}
+
+class LocationParser extends CommentsParser {
+ getLocationForPosition(pos) {
+ let loc;
+ if (pos === this.state.start) loc = this.state.startLoc;else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;else if (pos === this.state.end) loc = this.state.endLoc;else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;else loc = getLineInfo(this.input, pos);
+ return loc;
+ }
+
+ raise(pos, message, {
+ missingPluginNames,
+ code
+ } = {}) {
+ const loc = this.getLocationForPosition(pos);
+ message += ` (${loc.line}:${loc.column})`;
+ const err = new SyntaxError(message);
+ err.pos = pos;
+ err.loc = loc;
+
+ if (missingPluginNames) {
+ err.missingPlugin = missingPluginNames;
+ }
+
+ if (code !== undefined) {
+ err.code = code;
+ }
+
+ if (this.options.errorRecovery) {
+ if (!this.isLookahead) this.state.errors.push(err);
+ return err;
+ } else {
+ throw err;
+ }
+ }
+
+}
+
+class State {
+ constructor() {
+ this.errors = [];
+ this.potentialArrowAt = -1;
+ this.noArrowAt = [];
+ this.noArrowParamsConversionAt = [];
+ this.inParameters = false;
+ this.maybeInArrowParameters = false;
+ this.inPipeline = false;
+ this.inType = false;
+ this.noAnonFunctionType = false;
+ this.inPropertyName = false;
+ this.hasFlowComment = false;
+ this.isIterator = false;
+ this.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+ this.soloAwait = false;
+ this.inFSharpPipelineDirectBody = false;
+ this.labels = [];
+ this.decoratorStack = [[]];
+ this.yieldPos = -1;
+ this.awaitPos = -1;
+ this.comments = [];
+ this.trailingComments = [];
+ this.leadingComments = [];
+ this.commentStack = [];
+ this.commentPreviousNode = null;
+ this.pos = 0;
+ this.lineStart = 0;
+ this.type = types.eof;
+ this.value = null;
+ this.start = 0;
+ this.end = 0;
+ this.lastTokEndLoc = null;
+ this.lastTokStartLoc = null;
+ this.lastTokStart = 0;
+ this.lastTokEnd = 0;
+ this.context = [types$1.braceStatement];
+ this.exprAllowed = true;
+ this.containsEsc = false;
+ this.containsOctal = false;
+ this.octalPosition = null;
+ this.exportedIdentifiers = [];
+ this.tokensLength = 0;
+ }
+
+ init(options) {
+ this.strict = options.strictMode === false ? false : options.sourceType === "module";
+ this.curLine = options.startLine;
+ this.startLoc = this.endLoc = this.curPosition();
+ }
+
+ curPosition() {
+ return new Position(this.curLine, this.pos - this.lineStart);
+ }
+
+ clone(skipArrays) {
+ const state = new State();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+ let val = this[key];
+
+ if (!skipArrays && Array.isArray(val)) {
+ val = val.slice();
+ }
+
+ state[key] = val;
+ }
+
+ return state;
+ }
+
+}
+
+var _isDigit = function isDigit(code) {
+ return code >= 48 && code <= 57;
+};
+const VALID_REGEX_FLAGS = new Set(["g", "m", "s", "i", "y", "u"]);
+const forbiddenNumericSeparatorSiblings = {
+ decBinOct: [46, 66, 69, 79, 95, 98, 101, 111],
+ hex: [46, 88, 95, 120]
+};
+const allowedNumericSeparatorSiblings = {};
+allowedNumericSeparatorSiblings.bin = [48, 49];
+allowedNumericSeparatorSiblings.oct = [...allowedNumericSeparatorSiblings.bin, 50, 51, 52, 53, 54, 55];
+allowedNumericSeparatorSiblings.dec = [...allowedNumericSeparatorSiblings.oct, 56, 57];
+allowedNumericSeparatorSiblings.hex = [...allowedNumericSeparatorSiblings.dec, 65, 66, 67, 68, 69, 70, 97, 98, 99, 100, 101, 102];
+class Token {
+ constructor(state) {
+ this.type = state.type;
+ this.value = state.value;
+ this.start = state.start;
+ this.end = state.end;
+ this.loc = new SourceLocation(state.startLoc, state.endLoc);
+ }
+
+}
+class Tokenizer extends LocationParser {
+ constructor(options, input) {
+ super();
+ this.tokens = [];
+ this.state = new State();
+ this.state.init(options);
+ this.input = input;
+ this.length = input.length;
+ this.isLookahead = false;
+ }
+
+ pushToken(token) {
+ this.tokens.length = this.state.tokensLength;
+ this.tokens.push(token);
+ ++this.state.tokensLength;
+ }
+
+ next() {
+ if (!this.isLookahead) {
+ this.checkKeywordEscapes();
+
+ if (this.options.tokens) {
+ this.pushToken(new Token(this.state));
+ }
+ }
+
+ this.state.lastTokEnd = this.state.end;
+ this.state.lastTokStart = this.state.start;
+ this.state.lastTokEndLoc = this.state.endLoc;
+ this.state.lastTokStartLoc = this.state.startLoc;
+ this.nextToken();
+ }
+
+ eat(type) {
+ if (this.match(type)) {
+ this.next();
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ match(type) {
+ return this.state.type === type;
+ }
+
+ lookahead() {
+ const old = this.state;
+ this.state = old.clone(true);
+ this.isLookahead = true;
+ this.next();
+ this.isLookahead = false;
+ const curr = this.state;
+ this.state = old;
+ return curr;
+ }
+
+ nextTokenStart() {
+ const thisTokEnd = this.state.pos;
+ skipWhiteSpace.lastIndex = thisTokEnd;
+ const skip = skipWhiteSpace.exec(this.input);
+ return thisTokEnd + skip[0].length;
+ }
+
+ lookaheadCharCode() {
+ return this.input.charCodeAt(this.nextTokenStart());
+ }
+
+ setStrict(strict) {
+ this.state.strict = strict;
+ if (!this.match(types.num) && !this.match(types.string)) return;
+ this.state.pos = this.state.start;
+
+ while (this.state.pos < this.state.lineStart) {
+ this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1;
+ --this.state.curLine;
+ }
+
+ this.nextToken();
+ }
+
+ curContext() {
+ return this.state.context[this.state.context.length - 1];
+ }
+
+ nextToken() {
+ const curContext = this.curContext();
+ if (!curContext || !curContext.preserveSpace) this.skipSpace();
+ this.state.containsOctal = false;
+ this.state.octalPosition = null;
+ this.state.start = this.state.pos;
+ this.state.startLoc = this.state.curPosition();
+
+ if (this.state.pos >= this.length) {
+ this.finishToken(types.eof);
+ return;
+ }
+
+ if (curContext.override) {
+ curContext.override(this);
+ } else {
+ this.getTokenFromCode(this.input.codePointAt(this.state.pos));
+ }
+ }
+
+ pushComment(block, text, start, end, startLoc, endLoc) {
+ const comment = {
+ type: block ? "CommentBlock" : "CommentLine",
+ value: text,
+ start: start,
+ end: end,
+ loc: new SourceLocation(startLoc, endLoc)
+ };
+ if (this.options.tokens) this.pushToken(comment);
+ this.state.comments.push(comment);
+ this.addComment(comment);
+ }
+
+ skipBlockComment() {
+ const startLoc = this.state.curPosition();
+ const start = this.state.pos;
+ const end = this.input.indexOf("*/", this.state.pos + 2);
+ if (end === -1) throw this.raise(start, "Unterminated comment");
+ this.state.pos = end + 2;
+ lineBreakG.lastIndex = start;
+ let match;
+
+ while ((match = lineBreakG.exec(this.input)) && match.index < this.state.pos) {
+ ++this.state.curLine;
+ this.state.lineStart = match.index + match[0].length;
+ }
+
+ if (this.isLookahead) return;
+ this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition());
+ }
+
+ skipLineComment(startSkip) {
+ const start = this.state.pos;
+ const startLoc = this.state.curPosition();
+ let ch = this.input.charCodeAt(this.state.pos += startSkip);
+
+ if (this.state.pos < this.length) {
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+ }
+
+ if (this.isLookahead) return;
+ this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition());
+ }
+
+ skipSpace() {
+ loop: while (this.state.pos < this.length) {
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ switch (ch) {
+ case 32:
+ case 160:
+ case 9:
+ ++this.state.pos;
+ break;
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos + 1) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ case 8232:
+ case 8233:
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ break;
+
+ case 47:
+ switch (this.input.charCodeAt(this.state.pos + 1)) {
+ case 42:
+ this.skipBlockComment();
+ break;
+
+ case 47:
+ this.skipLineComment(2);
+ break;
+
+ default:
+ break loop;
+ }
+
+ break;
+
+ default:
+ if (isWhitespace(ch)) {
+ ++this.state.pos;
+ } else {
+ break loop;
+ }
+
+ }
+ }
+ }
+
+ finishToken(type, val) {
+ this.state.end = this.state.pos;
+ this.state.endLoc = this.state.curPosition();
+ const prevType = this.state.type;
+ this.state.type = type;
+ this.state.value = val;
+ if (!this.isLookahead) this.updateContext(prevType);
+ }
+
+ readToken_numberSign() {
+ if (this.state.pos === 0 && this.readToken_interpreter()) {
+ return;
+ }
+
+ const nextPos = this.state.pos + 1;
+ const next = this.input.charCodeAt(nextPos);
+
+ if (next >= 48 && next <= 57) {
+ throw this.raise(this.state.pos, "Unexpected digit after hash token");
+ }
+
+ if (this.hasPlugin("classPrivateProperties") || this.hasPlugin("classPrivateMethods") || this.getPluginOption("pipelineOperator", "proposal") === "smart") {
+ this.finishOp(types.hash, 1);
+ } else {
+ throw this.raise(this.state.pos, "Unexpected character '#'");
+ }
+ }
+
+ readToken_dot() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next >= 48 && next <= 57) {
+ this.readNumber(true);
+ return;
+ }
+
+ if (next === 46 && this.input.charCodeAt(this.state.pos + 2) === 46) {
+ this.state.pos += 3;
+ this.finishToken(types.ellipsis);
+ } else {
+ ++this.state.pos;
+ this.finishToken(types.dot);
+ }
+ }
+
+ readToken_slash() {
+ if (this.state.exprAllowed && !this.state.inType) {
+ ++this.state.pos;
+ this.readRegexp();
+ return;
+ }
+
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(types.assign, 2);
+ } else {
+ this.finishOp(types.slash, 1);
+ }
+ }
+
+ readToken_interpreter() {
+ if (this.state.pos !== 0 || this.length < 2) return false;
+ const start = this.state.pos;
+ this.state.pos += 1;
+ let ch = this.input.charCodeAt(this.state.pos);
+ if (ch !== 33) return false;
+
+ while (!isNewLine(ch) && ++this.state.pos < this.length) {
+ ch = this.input.charCodeAt(this.state.pos);
+ }
+
+ const value = this.input.slice(start + 2, this.state.pos);
+ this.finishToken(types.interpreterDirective, value);
+ return true;
+ }
+
+ readToken_mult_modulo(code) {
+ let type = code === 42 ? types.star : types.modulo;
+ let width = 1;
+ let next = this.input.charCodeAt(this.state.pos + 1);
+ const exprAllowed = this.state.exprAllowed;
+
+ if (code === 42 && next === 42) {
+ width++;
+ next = this.input.charCodeAt(this.state.pos + 2);
+ type = types.exponent;
+ }
+
+ if (next === 61 && !exprAllowed) {
+ width++;
+ type = types.assign;
+ }
+
+ this.finishOp(type, width);
+ }
+
+ readToken_pipe_amp(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ if (this.input.charCodeAt(this.state.pos + 2) === 61) {
+ this.finishOp(types.assign, 3);
+ } else {
+ this.finishOp(code === 124 ? types.logicalOR : types.logicalAND, 2);
+ }
+
+ return;
+ }
+
+ if (code === 124) {
+ if (next === 62) {
+ this.finishOp(types.pipeline, 2);
+ return;
+ }
+ }
+
+ if (next === 61) {
+ this.finishOp(types.assign, 2);
+ return;
+ }
+
+ this.finishOp(code === 124 ? types.bitwiseOR : types.bitwiseAND, 1);
+ }
+
+ readToken_caret() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(types.assign, 2);
+ } else {
+ this.finishOp(types.bitwiseXOR, 1);
+ }
+ }
+
+ readToken_plus_min(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === code) {
+ if (next === 45 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 62 && (this.state.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos)))) {
+ this.skipLineComment(3);
+ this.skipSpace();
+ this.nextToken();
+ return;
+ }
+
+ this.finishOp(types.incDec, 2);
+ return;
+ }
+
+ if (next === 61) {
+ this.finishOp(types.assign, 2);
+ } else {
+ this.finishOp(types.plusMin, 1);
+ }
+ }
+
+ readToken_lt_gt(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ let size = 1;
+
+ if (next === code) {
+ size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2;
+
+ if (this.input.charCodeAt(this.state.pos + size) === 61) {
+ this.finishOp(types.assign, size + 1);
+ return;
+ }
+
+ this.finishOp(types.bitShift, size);
+ return;
+ }
+
+ if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) {
+ this.skipLineComment(4);
+ this.skipSpace();
+ this.nextToken();
+ return;
+ }
+
+ if (next === 61) {
+ size = 2;
+ }
+
+ this.finishOp(types.relational, size);
+ }
+
+ readToken_eq_excl(code) {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 61) {
+ this.finishOp(types.equality, this.input.charCodeAt(this.state.pos + 2) === 61 ? 3 : 2);
+ return;
+ }
+
+ if (code === 61 && next === 62) {
+ this.state.pos += 2;
+ this.finishToken(types.arrow);
+ return;
+ }
+
+ this.finishOp(code === 61 ? types.eq : types.bang, 1);
+ }
+
+ readToken_question() {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+ const next2 = this.input.charCodeAt(this.state.pos + 2);
+
+ if (next === 63 && !this.state.inType) {
+ if (next2 === 61) {
+ this.finishOp(types.assign, 3);
+ } else {
+ this.finishOp(types.nullishCoalescing, 2);
+ }
+ } else if (next === 46 && !(next2 >= 48 && next2 <= 57)) {
+ this.state.pos += 2;
+ this.finishToken(types.questionDot);
+ } else {
+ ++this.state.pos;
+ this.finishToken(types.question);
+ }
+ }
+
+ getTokenFromCode(code) {
+ switch (code) {
+ case 46:
+ this.readToken_dot();
+ return;
+
+ case 40:
+ ++this.state.pos;
+ this.finishToken(types.parenL);
+ return;
+
+ case 41:
+ ++this.state.pos;
+ this.finishToken(types.parenR);
+ return;
+
+ case 59:
+ ++this.state.pos;
+ this.finishToken(types.semi);
+ return;
+
+ case 44:
+ ++this.state.pos;
+ this.finishToken(types.comma);
+ return;
+
+ case 91:
+ ++this.state.pos;
+ this.finishToken(types.bracketL);
+ return;
+
+ case 93:
+ ++this.state.pos;
+ this.finishToken(types.bracketR);
+ return;
+
+ case 123:
+ ++this.state.pos;
+ this.finishToken(types.braceL);
+ return;
+
+ case 125:
+ ++this.state.pos;
+ this.finishToken(types.braceR);
+ return;
+
+ case 58:
+ if (this.hasPlugin("functionBind") && this.input.charCodeAt(this.state.pos + 1) === 58) {
+ this.finishOp(types.doubleColon, 2);
+ } else {
+ ++this.state.pos;
+ this.finishToken(types.colon);
+ }
+
+ return;
+
+ case 63:
+ this.readToken_question();
+ return;
+
+ case 96:
+ ++this.state.pos;
+ this.finishToken(types.backQuote);
+ return;
+
+ case 48:
+ {
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (next === 120 || next === 88) {
+ this.readRadixNumber(16);
+ return;
+ }
+
+ if (next === 111 || next === 79) {
+ this.readRadixNumber(8);
+ return;
+ }
+
+ if (next === 98 || next === 66) {
+ this.readRadixNumber(2);
+ return;
+ }
+ }
+
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ this.readNumber(false);
+ return;
+
+ case 34:
+ case 39:
+ this.readString(code);
+ return;
+
+ case 47:
+ this.readToken_slash();
+ return;
+
+ case 37:
+ case 42:
+ this.readToken_mult_modulo(code);
+ return;
+
+ case 124:
+ case 38:
+ this.readToken_pipe_amp(code);
+ return;
+
+ case 94:
+ this.readToken_caret();
+ return;
+
+ case 43:
+ case 45:
+ this.readToken_plus_min(code);
+ return;
+
+ case 60:
+ case 62:
+ this.readToken_lt_gt(code);
+ return;
+
+ case 61:
+ case 33:
+ this.readToken_eq_excl(code);
+ return;
+
+ case 126:
+ this.finishOp(types.tilde, 1);
+ return;
+
+ case 64:
+ ++this.state.pos;
+ this.finishToken(types.at);
+ return;
+
+ case 35:
+ this.readToken_numberSign();
+ return;
+
+ case 92:
+ this.readWord();
+ return;
+
+ default:
+ if (isIdentifierStart(code)) {
+ this.readWord();
+ return;
+ }
+
+ }
+
+ throw this.raise(this.state.pos, `Unexpected character '${String.fromCodePoint(code)}'`);
+ }
+
+ finishOp(type, size) {
+ const str = this.input.slice(this.state.pos, this.state.pos + size);
+ this.state.pos += size;
+ this.finishToken(type, str);
+ }
+
+ readRegexp() {
+ const start = this.state.pos;
+ let escaped, inClass;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(start, "Unterminated regular expression");
+ }
+
+ const ch = this.input.charAt(this.state.pos);
+
+ if (lineBreak.test(ch)) {
+ throw this.raise(start, "Unterminated regular expression");
+ }
+
+ if (escaped) {
+ escaped = false;
+ } else {
+ if (ch === "[") {
+ inClass = true;
+ } else if (ch === "]" && inClass) {
+ inClass = false;
+ } else if (ch === "/" && !inClass) {
+ break;
+ }
+
+ escaped = ch === "\\";
+ }
+
+ ++this.state.pos;
+ }
+
+ const content = this.input.slice(start, this.state.pos);
+ ++this.state.pos;
+ let mods = "";
+
+ while (this.state.pos < this.length) {
+ const char = this.input[this.state.pos];
+ const charCode = this.input.codePointAt(this.state.pos);
+
+ if (VALID_REGEX_FLAGS.has(char)) {
+ if (mods.indexOf(char) > -1) {
+ this.raise(this.state.pos + 1, "Duplicate regular expression flag");
+ }
+ } else if (isIdentifierChar(charCode) || charCode === 92) {
+ this.raise(this.state.pos + 1, "Invalid regular expression flag");
+ } else {
+ break;
+ }
+
+ ++this.state.pos;
+ mods += char;
+ }
+
+ this.finishToken(types.regexp, {
+ pattern: content,
+ flags: mods
+ });
+ }
+
+ readInt(radix, len, forceLen, allowNumSeparator = true) {
+ const start = this.state.pos;
+ const forbiddenSiblings = radix === 16 ? forbiddenNumericSeparatorSiblings.hex : forbiddenNumericSeparatorSiblings.decBinOct;
+ const allowedSiblings = radix === 16 ? allowedNumericSeparatorSiblings.hex : radix === 10 ? allowedNumericSeparatorSiblings.dec : radix === 8 ? allowedNumericSeparatorSiblings.oct : allowedNumericSeparatorSiblings.bin;
+ let invalid = false;
+ let total = 0;
+
+ for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {
+ const code = this.input.charCodeAt(this.state.pos);
+ let val;
+
+ if (this.hasPlugin("numericSeparator")) {
+ if (code === 95) {
+ const prev = this.input.charCodeAt(this.state.pos - 1);
+ const next = this.input.charCodeAt(this.state.pos + 1);
+
+ if (allowedSiblings.indexOf(next) === -1) {
+ this.raise(this.state.pos, "A numeric separator is only allowed between two digits");
+ } else if (forbiddenSiblings.indexOf(prev) > -1 || forbiddenSiblings.indexOf(next) > -1 || Number.isNaN(next)) {
+ this.raise(this.state.pos, "A numeric separator is only allowed between two digits");
+ }
+
+ if (!allowNumSeparator) {
+ this.raise(this.state.pos, "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences");
+ }
+
+ ++this.state.pos;
+ continue;
+ }
+ }
+
+ if (code >= 97) {
+ val = code - 97 + 10;
+ } else if (code >= 65) {
+ val = code - 65 + 10;
+ } else if (_isDigit(code)) {
+ val = code - 48;
+ } else {
+ val = Infinity;
+ }
+
+ if (val >= radix) {
+ if (this.options.errorRecovery && val <= 9) {
+ val = 0;
+ this.raise(this.state.start + i + 2, "Expected number in radix " + radix);
+ } else if (forceLen) {
+ val = 0;
+ invalid = true;
+ } else {
+ break;
+ }
+ }
+
+ ++this.state.pos;
+ total = total * radix + val;
+ }
+
+ if (this.state.pos === start || len != null && this.state.pos - start !== len || invalid) {
+ return null;
+ }
+
+ return total;
+ }
+
+ readRadixNumber(radix) {
+ const start = this.state.pos;
+ let isBigInt = false;
+ this.state.pos += 2;
+ const val = this.readInt(radix);
+
+ if (val == null) {
+ this.raise(this.state.start + 2, "Expected number in radix " + radix);
+ }
+
+ if (this.hasPlugin("bigInt")) {
+ if (this.input.charCodeAt(this.state.pos) === 110) {
+ ++this.state.pos;
+ isBigInt = true;
+ }
+ }
+
+ if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
+ throw this.raise(this.state.pos, "Identifier directly after number");
+ }
+
+ if (isBigInt) {
+ const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
+ this.finishToken(types.bigint, str);
+ return;
+ }
+
+ this.finishToken(types.num, val);
+ }
+
+ readNumber(startsWithDot) {
+ const start = this.state.pos;
+ let isFloat = false;
+ let isBigInt = false;
+ let isNonOctalDecimalInt = false;
+
+ if (!startsWithDot && this.readInt(10) === null) {
+ this.raise(start, "Invalid number");
+ }
+
+ let octal = this.state.pos - start >= 2 && this.input.charCodeAt(start) === 48;
+
+ if (octal) {
+ if (this.state.strict) {
+ this.raise(start, "Legacy octal literals are not allowed in strict mode");
+ }
+
+ if (/[89]/.test(this.input.slice(start, this.state.pos))) {
+ octal = false;
+ isNonOctalDecimalInt = true;
+ }
+ }
+
+ let next = this.input.charCodeAt(this.state.pos);
+
+ if (next === 46 && !octal) {
+ ++this.state.pos;
+ this.readInt(10);
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if ((next === 69 || next === 101) && !octal) {
+ next = this.input.charCodeAt(++this.state.pos);
+
+ if (next === 43 || next === 45) {
+ ++this.state.pos;
+ }
+
+ if (this.readInt(10) === null) this.raise(start, "Invalid number");
+ isFloat = true;
+ next = this.input.charCodeAt(this.state.pos);
+ }
+
+ if (this.hasPlugin("numericSeparator") && (octal || isNonOctalDecimalInt)) {
+ const underscorePos = this.input.slice(start, this.state.pos).indexOf("_");
+
+ if (underscorePos > 0) {
+ this.raise(underscorePos + start, "Numeric separator can not be used after leading 0");
+ }
+ }
+
+ if (this.hasPlugin("bigInt")) {
+ if (next === 110) {
+ if (isFloat || octal || isNonOctalDecimalInt) {
+ this.raise(start, "Invalid BigIntLiteral");
+ }
+
+ ++this.state.pos;
+ isBigInt = true;
+ }
+ }
+
+ if (isIdentifierStart(this.input.codePointAt(this.state.pos))) {
+ throw this.raise(this.state.pos, "Identifier directly after number");
+ }
+
+ const str = this.input.slice(start, this.state.pos).replace(/[_n]/g, "");
+
+ if (isBigInt) {
+ this.finishToken(types.bigint, str);
+ return;
+ }
+
+ const val = octal ? parseInt(str, 8) : parseFloat(str);
+ this.finishToken(types.num, val);
+ }
+
+ readCodePoint(throwOnInvalid) {
+ const ch = this.input.charCodeAt(this.state.pos);
+ let code;
+
+ if (ch === 123) {
+ const codePos = ++this.state.pos;
+ code = this.readHexChar(this.input.indexOf("}", this.state.pos) - this.state.pos, true, throwOnInvalid);
+ ++this.state.pos;
+
+ if (code !== null && code > 0x10ffff) {
+ if (throwOnInvalid) {
+ this.raise(codePos, "Code point out of bounds");
+ } else {
+ return null;
+ }
+ }
+ } else {
+ code = this.readHexChar(4, false, throwOnInvalid);
+ }
+
+ return code;
+ }
+
+ readString(quote) {
+ let out = "",
+ chunkStart = ++this.state.pos;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, "Unterminated string constant");
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+ if (ch === quote) break;
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ out += this.readEscapedChar(false);
+ chunkStart = this.state.pos;
+ } else if (ch === 8232 || ch === 8233) {
+ ++this.state.pos;
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ throw this.raise(this.state.start, "Unterminated string constant");
+ } else {
+ ++this.state.pos;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos++);
+ this.finishToken(types.string, out);
+ }
+
+ readTmplToken() {
+ let out = "",
+ chunkStart = this.state.pos,
+ containsInvalid = false;
+
+ for (;;) {
+ if (this.state.pos >= this.length) {
+ throw this.raise(this.state.start, "Unterminated template");
+ }
+
+ const ch = this.input.charCodeAt(this.state.pos);
+
+ if (ch === 96 || ch === 36 && this.input.charCodeAt(this.state.pos + 1) === 123) {
+ if (this.state.pos === this.state.start && this.match(types.template)) {
+ if (ch === 36) {
+ this.state.pos += 2;
+ this.finishToken(types.dollarBraceL);
+ return;
+ } else {
+ ++this.state.pos;
+ this.finishToken(types.backQuote);
+ return;
+ }
+ }
+
+ out += this.input.slice(chunkStart, this.state.pos);
+ this.finishToken(types.template, containsInvalid ? null : out);
+ return;
+ }
+
+ if (ch === 92) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ const escaped = this.readEscapedChar(true);
+
+ if (escaped === null) {
+ containsInvalid = true;
+ } else {
+ out += escaped;
+ }
+
+ chunkStart = this.state.pos;
+ } else if (isNewLine(ch)) {
+ out += this.input.slice(chunkStart, this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ out += "\n";
+ break;
+
+ default:
+ out += String.fromCharCode(ch);
+ break;
+ }
+
+ ++this.state.curLine;
+ this.state.lineStart = this.state.pos;
+ chunkStart = this.state.pos;
+ } else {
+ ++this.state.pos;
+ }
+ }
+ }
+
+ readEscapedChar(inTemplate) {
+ const throwOnInvalid = !inTemplate;
+ const ch = this.input.charCodeAt(++this.state.pos);
+ ++this.state.pos;
+
+ switch (ch) {
+ case 110:
+ return "\n";
+
+ case 114:
+ return "\r";
+
+ case 120:
+ {
+ const code = this.readHexChar(2, false, throwOnInvalid);
+ return code === null ? null : String.fromCharCode(code);
+ }
+
+ case 117:
+ {
+ const code = this.readCodePoint(throwOnInvalid);
+ return code === null ? null : String.fromCodePoint(code);
+ }
+
+ case 116:
+ return "\t";
+
+ case 98:
+ return "\b";
+
+ case 118:
+ return "\u000b";
+
+ case 102:
+ return "\f";
+
+ case 13:
+ if (this.input.charCodeAt(this.state.pos) === 10) {
+ ++this.state.pos;
+ }
+
+ case 10:
+ this.state.lineStart = this.state.pos;
+ ++this.state.curLine;
+
+ case 8232:
+ case 8233:
+ return "";
+
+ case 56:
+ case 57:
+ if (inTemplate) {
+ return null;
+ }
+
+ default:
+ if (ch >= 48 && ch <= 55) {
+ const codePos = this.state.pos - 1;
+ let octalStr = this.input.substr(this.state.pos - 1, 3).match(/^[0-7]+/)[0];
+ let octal = parseInt(octalStr, 8);
+
+ if (octal > 255) {
+ octalStr = octalStr.slice(0, -1);
+ octal = parseInt(octalStr, 8);
+ }
+
+ this.state.pos += octalStr.length - 1;
+ const next = this.input.charCodeAt(this.state.pos);
+
+ if (octalStr !== "0" || next === 56 || next === 57) {
+ if (inTemplate) {
+ return null;
+ } else if (this.state.strict) {
+ this.raise(codePos, "Octal literal in strict mode");
+ } else if (!this.state.containsOctal) {
+ this.state.containsOctal = true;
+ this.state.octalPosition = codePos;
+ }
+ }
+
+ return String.fromCharCode(octal);
+ }
+
+ return String.fromCharCode(ch);
+ }
+ }
+
+ readHexChar(len, forceLen, throwOnInvalid) {
+ const codePos = this.state.pos;
+ const n = this.readInt(16, len, forceLen, false);
+
+ if (n === null) {
+ if (throwOnInvalid) {
+ this.raise(codePos, "Bad character escape sequence");
+ } else {
+ this.state.pos = codePos - 1;
+ }
+ }
+
+ return n;
+ }
+
+ readWord1() {
+ let word = "";
+ this.state.containsEsc = false;
+ const start = this.state.pos;
+ let chunkStart = this.state.pos;
+
+ while (this.state.pos < this.length) {
+ const ch = this.input.codePointAt(this.state.pos);
+
+ if (isIdentifierChar(ch)) {
+ this.state.pos += ch <= 0xffff ? 1 : 2;
+ } else if (this.state.isIterator && ch === 64) {
+ ++this.state.pos;
+ } else if (ch === 92) {
+ this.state.containsEsc = true;
+ word += this.input.slice(chunkStart, this.state.pos);
+ const escStart = this.state.pos;
+ const identifierCheck = this.state.pos === start ? isIdentifierStart : isIdentifierChar;
+
+ if (this.input.charCodeAt(++this.state.pos) !== 117) {
+ this.raise(this.state.pos, "Expecting Unicode escape sequence \\uXXXX");
+ continue;
+ }
+
+ ++this.state.pos;
+ const esc = this.readCodePoint(true);
+
+ if (esc !== null) {
+ if (!identifierCheck(esc)) {
+ this.raise(escStart, "Invalid Unicode escape");
+ }
+
+ word += String.fromCodePoint(esc);
+ }
+
+ chunkStart = this.state.pos;
+ } else {
+ break;
+ }
+ }
+
+ return word + this.input.slice(chunkStart, this.state.pos);
+ }
+
+ isIterator(word) {
+ return word === "@@iterator" || word === "@@asyncIterator";
+ }
+
+ readWord() {
+ const word = this.readWord1();
+ const type = keywords.get(word) || types.name;
+
+ if (this.state.isIterator && (!this.isIterator(word) || !this.state.inType)) {
+ this.raise(this.state.pos, `Invalid identifier ${word}`);
+ }
+
+ this.finishToken(type, word);
+ }
+
+ checkKeywordEscapes() {
+ const kw = this.state.type.keyword;
+
+ if (kw && this.state.containsEsc) {
+ this.raise(this.state.start, `Escape sequence in keyword ${kw}`);
+ }
+ }
+
+ braceIsBlock(prevType) {
+ const parent = this.curContext();
+
+ if (parent === types$1.functionExpression || parent === types$1.functionStatement) {
+ return true;
+ }
+
+ if (prevType === types.colon && (parent === types$1.braceStatement || parent === types$1.braceExpression)) {
+ return !parent.isExpr;
+ }
+
+ if (prevType === types._return || prevType === types.name && this.state.exprAllowed) {
+ return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+ }
+
+ if (prevType === types._else || prevType === types.semi || prevType === types.eof || prevType === types.parenR || prevType === types.arrow) {
+ return true;
+ }
+
+ if (prevType === types.braceL) {
+ return parent === types$1.braceStatement;
+ }
+
+ if (prevType === types._var || prevType === types._const || prevType === types.name) {
+ return false;
+ }
+
+ if (prevType === types.relational) {
+ return true;
+ }
+
+ return !this.state.exprAllowed;
+ }
+
+ updateContext(prevType) {
+ const type = this.state.type;
+ let update;
+
+ if (type.keyword && (prevType === types.dot || prevType === types.questionDot)) {
+ this.state.exprAllowed = false;
+ } else if (update = type.updateContext) {
+ update.call(this, prevType);
+ } else {
+ this.state.exprAllowed = type.beforeExpr;
+ }
+ }
+
+}
+
+const literal = /^('|")((?:\\?.)*?)\1/;
+class UtilParser extends Tokenizer {
+ addExtra(node, key, val) {
+ if (!node) return;
+ const extra = node.extra = node.extra || {};
+ extra[key] = val;
+ }
+
+ isRelational(op) {
+ return this.match(types.relational) && this.state.value === op;
+ }
+
+ isLookaheadRelational(op) {
+ const next = this.nextTokenStart();
+
+ if (this.input.charAt(next) === op) {
+ if (next + 1 === this.input.length) {
+ return true;
+ }
+
+ const afterNext = this.input.charCodeAt(next + 1);
+ return afterNext !== op.charCodeAt(0) && afterNext !== 61;
+ }
+
+ return false;
+ }
+
+ expectRelational(op) {
+ if (this.isRelational(op)) {
+ this.next();
+ } else {
+ this.unexpected(null, types.relational);
+ }
+ }
+
+ isContextual(name) {
+ return this.match(types.name) && this.state.value === name && !this.state.containsEsc;
+ }
+
+ isUnparsedContextual(nameStart, name) {
+ const nameEnd = nameStart + name.length;
+ return this.input.slice(nameStart, nameEnd) === name && (nameEnd === this.input.length || !isIdentifierChar(this.input.charCodeAt(nameEnd)));
+ }
+
+ isLookaheadContextual(name) {
+ const next = this.nextTokenStart();
+ return this.isUnparsedContextual(next, name);
+ }
+
+ eatContextual(name) {
+ return this.isContextual(name) && this.eat(types.name);
+ }
+
+ expectContextual(name, message) {
+ if (!this.eatContextual(name)) this.unexpected(null, message);
+ }
+
+ canInsertSemicolon() {
+ return this.match(types.eof) || this.match(types.braceR) || this.hasPrecedingLineBreak();
+ }
+
+ hasPrecedingLineBreak() {
+ return lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start));
+ }
+
+ isLineTerminator() {
+ return this.eat(types.semi) || this.canInsertSemicolon();
+ }
+
+ semicolon() {
+ if (!this.isLineTerminator()) this.unexpected(null, types.semi);
+ }
+
+ expect(type, pos) {
+ this.eat(type) || this.unexpected(pos, type);
+ }
+
+ assertNoSpace(message = "Unexpected space.") {
+ if (this.state.start > this.state.lastTokEnd) {
+ this.raise(this.state.lastTokEnd, message);
+ }
+ }
+
+ unexpected(pos, messageOrType = "Unexpected token") {
+ if (typeof messageOrType !== "string") {
+ messageOrType = `Unexpected token, expected "${messageOrType.label}"`;
+ }
+
+ throw this.raise(pos != null ? pos : this.state.start, messageOrType);
+ }
+
+ expectPlugin(name, pos) {
+ if (!this.hasPlugin(name)) {
+ throw this.raise(pos != null ? pos : this.state.start, `This experimental syntax requires enabling the parser plugin: '${name}'`, {
+ missingPluginNames: [name]
+ });
+ }
+
+ return true;
+ }
+
+ expectOnePlugin(names, pos) {
+ if (!names.some(n => this.hasPlugin(n))) {
+ throw this.raise(pos != null ? pos : this.state.start, `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join(", ")}'`, {
+ missingPluginNames: names
+ });
+ }
+ }
+
+ checkYieldAwaitInDefaultParams() {
+ if (this.state.yieldPos !== -1 && (this.state.awaitPos === -1 || this.state.yieldPos < this.state.awaitPos)) {
+ this.raise(this.state.yieldPos, "Yield cannot be used as name inside a generator function");
+ }
+
+ if (this.state.awaitPos !== -1) {
+ this.raise(this.state.awaitPos, "Await cannot be used as name inside an async function");
+ }
+ }
+
+ strictDirective(start) {
+ for (;;) {
+ skipWhiteSpace.lastIndex = start;
+ start += skipWhiteSpace.exec(this.input)[0].length;
+ const match = literal.exec(this.input.slice(start));
+ if (!match) break;
+ if (match[2] === "use strict") return true;
+ start += match[0].length;
+ skipWhiteSpace.lastIndex = start;
+ start += skipWhiteSpace.exec(this.input)[0].length;
+
+ if (this.input[start] === ";") {
+ start++;
+ }
+ }
+
+ return false;
+ }
+
+ tryParse(fn, oldState = this.state.clone()) {
+ const abortSignal = {
+ node: null
+ };
+
+ try {
+ const node = fn((node = null) => {
+ abortSignal.node = node;
+ throw abortSignal;
+ });
+
+ if (this.state.errors.length > oldState.errors.length) {
+ const failState = this.state;
+ this.state = oldState;
+ return {
+ node,
+ error: failState.errors[oldState.errors.length],
+ thrown: false,
+ aborted: false,
+ failState
+ };
+ }
+
+ return {
+ node,
+ error: null,
+ thrown: false,
+ aborted: false,
+ failState: null
+ };
+ } catch (error) {
+ const failState = this.state;
+ this.state = oldState;
+
+ if (error instanceof SyntaxError) {
+ return {
+ node: null,
+ error,
+ thrown: true,
+ aborted: false,
+ failState
+ };
+ }
+
+ if (error === abortSignal) {
+ return {
+ node: abortSignal.node,
+ error: null,
+ thrown: false,
+ aborted: true,
+ failState
+ };
+ }
+
+ throw error;
+ }
+ }
+
+ checkExpressionErrors(refExpressionErrors, andThrow) {
+ if (!refExpressionErrors) return false;
+ const {
+ shorthandAssign,
+ doubleProto
+ } = refExpressionErrors;
+ if (!andThrow) return shorthandAssign >= 0 || doubleProto >= 0;
+
+ if (shorthandAssign >= 0) {
+ this.unexpected(shorthandAssign);
+ }
+
+ if (doubleProto >= 0) {
+ this.raise(doubleProto, "Redefinition of __proto__ property");
+ }
+ }
+
+}
+class ExpressionErrors {
+ constructor() {
+ this.shorthandAssign = -1;
+ this.doubleProto = -1;
+ }
+
+}
+
+class Node {
+ constructor(parser, pos, loc) {
+ this.type = "";
+ this.start = pos;
+ this.end = 0;
+ this.loc = new SourceLocation(loc);
+ if (parser && parser.options.ranges) this.range = [pos, 0];
+ if (parser && parser.filename) this.loc.filename = parser.filename;
+ }
+
+ __clone() {
+ const newNode = new Node();
+ const keys = Object.keys(this);
+
+ for (let i = 0, length = keys.length; i < length; i++) {
+ const key = keys[i];
+
+ if (key !== "leadingComments" && key !== "trailingComments" && key !== "innerComments") {
+ newNode[key] = this[key];
+ }
+ }
+
+ return newNode;
+ }
+
+}
+
+class NodeUtils extends UtilParser {
+ startNode() {
+ return new Node(this, this.state.start, this.state.startLoc);
+ }
+
+ startNodeAt(pos, loc) {
+ return new Node(this, pos, loc);
+ }
+
+ startNodeAtNode(type) {
+ return this.startNodeAt(type.start, type.loc.start);
+ }
+
+ finishNode(node, type) {
+ return this.finishNodeAt(node, type, this.state.lastTokEnd, this.state.lastTokEndLoc);
+ }
+
+ finishNodeAt(node, type, pos, loc) {
+
+ node.type = type;
+ node.end = pos;
+ node.loc.end = loc;
+ if (this.options.ranges) node.range[1] = pos;
+ this.processComment(node);
+ return node;
+ }
+
+ resetStartLocation(node, start, startLoc) {
+ node.start = start;
+ node.loc.start = startLoc;
+ if (this.options.ranges) node.range[0] = start;
+ }
+
+ resetEndLocation(node, end = this.state.lastTokEnd, endLoc = this.state.lastTokEndLoc) {
+ node.end = end;
+ node.loc.end = endLoc;
+ if (this.options.ranges) node.range[1] = end;
+ }
+
+ resetStartLocationFromNode(node, locationNode) {
+ this.resetStartLocation(node, locationNode.start, locationNode.loc.start);
+ }
+
+}
+
+const unwrapParenthesizedExpression = node => {
+ return node.type === "ParenthesizedExpression" ? unwrapParenthesizedExpression(node.expression) : node;
+};
+
+class LValParser extends NodeUtils {
+ toAssignable(node) {
+ var _node$extra, _node$extra3;
+
+ let parenthesized = undefined;
+
+ if (node.type === "ParenthesizedExpression" || ((_node$extra = node.extra) == null ? void 0 : _node$extra.parenthesized)) {
+ parenthesized = unwrapParenthesizedExpression(node);
+
+ if (parenthesized.type !== "Identifier" && parenthesized.type !== "MemberExpression") {
+ this.raise(node.start, "Invalid parenthesized assignment pattern");
+ }
+ }
+
+ switch (node.type) {
+ case "Identifier":
+ case "ObjectPattern":
+ case "ArrayPattern":
+ case "AssignmentPattern":
+ break;
+
+ case "ObjectExpression":
+ node.type = "ObjectPattern";
+
+ for (let i = 0, length = node.properties.length, last = length - 1; i < length; i++) {
+ var _node$extra2;
+
+ const prop = node.properties[i];
+ const isLast = i === last;
+ this.toAssignableObjectExpressionProp(prop, isLast);
+
+ if (isLast && prop.type === "RestElement" && ((_node$extra2 = node.extra) == null ? void 0 : _node$extra2.trailingComma)) {
+ this.raiseRestNotLast(node.extra.trailingComma);
+ }
+ }
+
+ break;
+
+ case "ObjectProperty":
+ this.toAssignable(node.value);
+ break;
+
+ case "SpreadElement":
+ {
+ this.checkToRestConversion(node);
+ node.type = "RestElement";
+ const arg = node.argument;
+ this.toAssignable(arg);
+ break;
+ }
+
+ case "ArrayExpression":
+ node.type = "ArrayPattern";
+ this.toAssignableList(node.elements, (_node$extra3 = node.extra) == null ? void 0 : _node$extra3.trailingComma);
+ break;
+
+ case "AssignmentExpression":
+ if (node.operator !== "=") {
+ this.raise(node.left.end, "Only '=' operator can be used for specifying default value.");
+ }
+
+ node.type = "AssignmentPattern";
+ delete node.operator;
+ this.toAssignable(node.left);
+ break;
+
+ case "ParenthesizedExpression":
+ this.toAssignable(parenthesized);
+ break;
+ }
+
+ return node;
+ }
+
+ toAssignableObjectExpressionProp(prop, isLast) {
+ if (prop.type === "ObjectMethod") {
+ const error = prop.kind === "get" || prop.kind === "set" ? "Object pattern can't contain getter or setter" : "Object pattern can't contain methods";
+ this.raise(prop.key.start, error);
+ } else if (prop.type === "SpreadElement" && !isLast) {
+ this.raiseRestNotLast(prop.start);
+ } else {
+ this.toAssignable(prop);
+ }
+ }
+
+ toAssignableList(exprList, trailingCommaPos) {
+ let end = exprList.length;
+
+ if (end) {
+ const last = exprList[end - 1];
+
+ if (last && last.type === "RestElement") {
+ --end;
+ } else if (last && last.type === "SpreadElement") {
+ last.type = "RestElement";
+ const arg = last.argument;
+ this.toAssignable(arg);
+
+ if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern" && arg.type !== "ObjectPattern") {
+ this.unexpected(arg.start);
+ }
+
+ if (trailingCommaPos) {
+ this.raiseTrailingCommaAfterRest(trailingCommaPos);
+ }
+
+ --end;
+ }
+ }
+
+ for (let i = 0; i < end; i++) {
+ const elt = exprList[i];
+
+ if (elt) {
+ this.toAssignable(elt);
+
+ if (elt.type === "RestElement") {
+ this.raiseRestNotLast(elt.start);
+ }
+ }
+ }
+
+ return exprList;
+ }
+
+ toReferencedList(exprList, isParenthesizedExpr) {
+ return exprList;
+ }
+
+ toReferencedListDeep(exprList, isParenthesizedExpr) {
+ this.toReferencedList(exprList, isParenthesizedExpr);
+
+ for (let _i = 0; _i < exprList.length; _i++) {
+ const expr = exprList[_i];
+
+ if (expr && expr.type === "ArrayExpression") {
+ this.toReferencedListDeep(expr.elements);
+ }
+ }
+ }
+
+ parseSpread(refExpressionErrors, refNeedsArrowPos) {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseMaybeAssign(false, refExpressionErrors, undefined, refNeedsArrowPos);
+ return this.finishNode(node, "SpreadElement");
+ }
+
+ parseRestBinding() {
+ const node = this.startNode();
+ this.next();
+ node.argument = this.parseBindingAtom();
+ return this.finishNode(node, "RestElement");
+ }
+
+ parseBindingAtom() {
+ switch (this.state.type) {
+ case types.bracketL:
+ {
+ const node = this.startNode();
+ this.next();
+ node.elements = this.parseBindingList(types.bracketR, 93, true);
+ return this.finishNode(node, "ArrayPattern");
+ }
+
+ case types.braceL:
+ return this.parseObj(true);
+ }
+
+ return this.parseIdentifier();
+ }
+
+ parseBindingList(close, closeCharCode, allowEmpty, allowModifiers) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma);
+ }
+
+ if (allowEmpty && this.match(types.comma)) {
+ elts.push(null);
+ } else if (this.eat(close)) {
+ break;
+ } else if (this.match(types.ellipsis)) {
+ elts.push(this.parseAssignableListItemTypes(this.parseRestBinding()));
+ this.checkCommaAfterRest(closeCharCode);
+ this.expect(close);
+ break;
+ } else {
+ const decorators = [];
+
+ if (this.match(types.at) && this.hasPlugin("decorators")) {
+ this.raise(this.state.start, "Stage 2 decorators cannot be used to decorate parameters");
+ }
+
+ while (this.match(types.at)) {
+ decorators.push(this.parseDecorator());
+ }
+
+ elts.push(this.parseAssignableListItem(allowModifiers, decorators));
+ }
+ }
+
+ return elts;
+ }
+
+ parseAssignableListItem(allowModifiers, decorators) {
+ const left = this.parseMaybeDefault();
+ this.parseAssignableListItemTypes(left);
+ const elt = this.parseMaybeDefault(left.start, left.loc.start, left);
+
+ if (decorators.length) {
+ left.decorators = decorators;
+ }
+
+ return elt;
+ }
+
+ parseAssignableListItemTypes(param) {
+ return param;
+ }
+
+ parseMaybeDefault(startPos, startLoc, left) {
+ startLoc = startLoc || this.state.startLoc;
+ startPos = startPos || this.state.start;
+ left = left || this.parseBindingAtom();
+ if (!this.eat(types.eq)) return left;
+ const node = this.startNodeAt(startPos, startLoc);
+ node.left = left;
+ node.right = this.parseMaybeAssign();
+ return this.finishNode(node, "AssignmentPattern");
+ }
+
+ checkLVal(expr, bindingType = BIND_NONE, checkClashes, contextDescription, disallowLetBinding, strictModeChanged = false) {
+ switch (expr.type) {
+ case "Identifier":
+ if (this.state.strict && (strictModeChanged ? isStrictBindReservedWord(expr.name, this.inModule) : isStrictBindOnlyReservedWord(expr.name))) {
+ this.raise(expr.start, `${bindingType === BIND_NONE ? "Assigning to" : "Binding"} '${expr.name}' in strict mode`);
+ }
+
+ if (checkClashes) {
+ const key = `_${expr.name}`;
+
+ if (checkClashes[key]) {
+ this.raise(expr.start, "Argument name clash");
+ } else {
+ checkClashes[key] = true;
+ }
+ }
+
+ if (disallowLetBinding && expr.name === "let") {
+ this.raise(expr.start, "'let' is not allowed to be used as a name in 'let' or 'const' declarations.");
+ }
+
+ if (!(bindingType & BIND_NONE)) {
+ this.scope.declareName(expr.name, bindingType, expr.start);
+ }
+
+ break;
+
+ case "MemberExpression":
+ if (bindingType !== BIND_NONE) {
+ this.raise(expr.start, "Binding member expression");
+ }
+
+ break;
+
+ case "ObjectPattern":
+ for (let _i2 = 0, _expr$properties = expr.properties; _i2 < _expr$properties.length; _i2++) {
+ let prop = _expr$properties[_i2];
+ if (prop.type === "ObjectProperty") prop = prop.value;else if (prop.type === "ObjectMethod") continue;
+ this.checkLVal(prop, bindingType, checkClashes, "object destructuring pattern", disallowLetBinding);
+ }
+
+ break;
+
+ case "ArrayPattern":
+ for (let _i3 = 0, _expr$elements = expr.elements; _i3 < _expr$elements.length; _i3++) {
+ const elem = _expr$elements[_i3];
+
+ if (elem) {
+ this.checkLVal(elem, bindingType, checkClashes, "array destructuring pattern", disallowLetBinding);
+ }
+ }
+
+ break;
+
+ case "AssignmentPattern":
+ this.checkLVal(expr.left, bindingType, checkClashes, "assignment pattern");
+ break;
+
+ case "RestElement":
+ this.checkLVal(expr.argument, bindingType, checkClashes, "rest element");
+ break;
+
+ case "ParenthesizedExpression":
+ this.checkLVal(expr.expression, bindingType, checkClashes, "parenthesized expression");
+ break;
+
+ default:
+ {
+ const message = (bindingType === BIND_NONE ? "Invalid" : "Binding invalid") + " left-hand side" + (contextDescription ? " in " + contextDescription : "expression");
+ this.raise(expr.start, message);
+ }
+ }
+ }
+
+ checkToRestConversion(node) {
+ if (node.argument.type !== "Identifier" && node.argument.type !== "MemberExpression") {
+ this.raise(node.argument.start, "Invalid rest operator's argument");
+ }
+ }
+
+ checkCommaAfterRest(close) {
+ if (this.match(types.comma)) {
+ if (this.lookaheadCharCode() === close) {
+ this.raiseTrailingCommaAfterRest(this.state.start);
+ } else {
+ this.raiseRestNotLast(this.state.start);
+ }
+ }
+ }
+
+ raiseRestNotLast(pos) {
+ throw this.raise(pos, `Rest element must be last element`);
+ }
+
+ raiseTrailingCommaAfterRest(pos) {
+ this.raise(pos, `Unexpected trailing comma after rest element`);
+ }
+
+}
+
+class ExpressionParser extends LValParser {
+ checkDuplicatedProto(prop, protoRef, refExpressionErrors) {
+ if (prop.type === "SpreadElement" || prop.computed || prop.kind || prop.shorthand) {
+ return;
+ }
+
+ const key = prop.key;
+ const name = key.type === "Identifier" ? key.name : String(key.value);
+
+ if (name === "__proto__") {
+ if (protoRef.used) {
+ if (refExpressionErrors) {
+ if (refExpressionErrors.doubleProto === -1) {
+ refExpressionErrors.doubleProto = key.start;
+ }
+ } else {
+ this.raise(key.start, "Redefinition of __proto__ property");
+ }
+ }
+
+ protoRef.used = true;
+ }
+ }
+
+ getExpression() {
+ let paramFlags = PARAM;
+
+ if (this.hasPlugin("topLevelAwait") && this.inModule) {
+ paramFlags |= PARAM_AWAIT;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM);
+ this.prodParam.enter(paramFlags);
+ this.nextToken();
+ const expr = this.parseExpression();
+
+ if (!this.match(types.eof)) {
+ this.unexpected();
+ }
+
+ expr.comments = this.state.comments;
+ expr.errors = this.state.errors;
+ return expr;
+ }
+
+ parseExpression(noIn, refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const expr = this.parseMaybeAssign(noIn, refExpressionErrors);
+
+ if (this.match(types.comma)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.expressions = [expr];
+
+ while (this.eat(types.comma)) {
+ node.expressions.push(this.parseMaybeAssign(noIn, refExpressionErrors));
+ }
+
+ this.toReferencedList(node.expressions);
+ return this.finishNode(node, "SequenceExpression");
+ }
+
+ return expr;
+ }
+
+ parseMaybeAssign(noIn, refExpressionErrors, afterLeftParse, refNeedsArrowPos) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ if (this.isContextual("yield")) {
+ if (this.prodParam.hasYield) {
+ let left = this.parseYield(noIn);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ return left;
+ } else {
+ this.state.exprAllowed = false;
+ }
+ }
+
+ let ownExpressionErrors;
+
+ if (refExpressionErrors) {
+ ownExpressionErrors = false;
+ } else {
+ refExpressionErrors = new ExpressionErrors();
+ ownExpressionErrors = true;
+ }
+
+ if (this.match(types.parenL) || this.match(types.name)) {
+ this.state.potentialArrowAt = this.state.start;
+ }
+
+ let left = this.parseMaybeConditional(noIn, refExpressionErrors, refNeedsArrowPos);
+
+ if (afterLeftParse) {
+ left = afterLeftParse.call(this, left, startPos, startLoc);
+ }
+
+ if (this.state.type.isAssign) {
+ const node = this.startNodeAt(startPos, startLoc);
+ const operator = this.state.value;
+ node.operator = operator;
+
+ if (operator === "??=") {
+ this.expectPlugin("logicalAssignment");
+ }
+
+ if (operator === "||=" || operator === "&&=") {
+ this.expectPlugin("logicalAssignment");
+ }
+
+ if (this.match(types.eq)) {
+ node.left = this.toAssignable(left);
+ refExpressionErrors.doubleProto = -1;
+ } else {
+ node.left = left;
+ }
+
+ if (refExpressionErrors.shorthandAssign >= node.left.start) {
+ refExpressionErrors.shorthandAssign = -1;
+ }
+
+ this.checkLVal(left, undefined, undefined, "assignment expression");
+ this.next();
+ node.right = this.parseMaybeAssign(noIn);
+ return this.finishNode(node, "AssignmentExpression");
+ } else if (ownExpressionErrors) {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ return left;
+ }
+
+ parseMaybeConditional(noIn, refExpressionErrors, refNeedsArrowPos) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprOps(noIn, refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+ return this.parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos);
+ }
+
+ parseConditional(expr, noIn, startPos, startLoc, refNeedsArrowPos) {
+ if (this.eat(types.question)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.test = expr;
+ node.consequent = this.parseMaybeAssign();
+ this.expect(types.colon);
+ node.alternate = this.parseMaybeAssign(noIn);
+ return this.finishNode(node, "ConditionalExpression");
+ }
+
+ return expr;
+ }
+
+ parseExprOps(noIn, refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseMaybeUnary(refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ if (this.checkExpressionErrors(refExpressionErrors, false)) {
+ return expr;
+ }
+
+ return this.parseExprOp(expr, startPos, startLoc, -1, noIn);
+ }
+
+ parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn) {
+ let prec = this.state.type.binop;
+
+ if (prec != null && (!noIn || !this.match(types._in))) {
+ if (prec > minPrec) {
+ const operator = this.state.value;
+
+ if (operator === "|>" && this.state.inFSharpPipelineDirectBody) {
+ return left;
+ }
+
+ const node = this.startNodeAt(leftStartPos, leftStartLoc);
+ node.left = left;
+ node.operator = operator;
+
+ if (operator === "**" && left.type === "UnaryExpression" && (this.options.createParenthesizedExpressions || !(left.extra && left.extra.parenthesized))) {
+ this.raise(left.argument.start, "Illegal expression. Wrap left hand side or entire exponentiation in parentheses.");
+ }
+
+ const op = this.state.type;
+ const logical = op === types.logicalOR || op === types.logicalAND;
+ const coalesce = op === types.nullishCoalescing;
+
+ if (op === types.pipeline) {
+ this.expectPlugin("pipelineOperator");
+ this.state.inPipeline = true;
+ this.checkPipelineAtInfixOperator(left, leftStartPos);
+ } else if (coalesce) {
+ prec = types.logicalAND.binop;
+ }
+
+ this.next();
+
+ if (op === types.pipeline && this.getPluginOption("pipelineOperator", "proposal") === "minimal") {
+ if (this.match(types.name) && this.state.value === "await" && this.prodParam.hasAwait) {
+ throw this.raise(this.state.start, `Unexpected "await" after pipeline body; await must have parentheses in minimal proposal`);
+ }
+ }
+
+ node.right = this.parseExprOpRightExpr(op, prec, noIn);
+ this.finishNode(node, logical || coalesce ? "LogicalExpression" : "BinaryExpression");
+ const nextOp = this.state.type;
+
+ if (coalesce && (nextOp === types.logicalOR || nextOp === types.logicalAND) || logical && nextOp === types.nullishCoalescing) {
+ throw this.raise(this.state.start, `Nullish coalescing operator(??) requires parens when mixing with logical operators`);
+ }
+
+ return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn);
+ }
+ }
+
+ return left;
+ }
+
+ parseExprOpRightExpr(op, prec, noIn) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+
+ switch (op) {
+ case types.pipeline:
+ switch (this.getPluginOption("pipelineOperator", "proposal")) {
+ case "smart":
+ return this.withTopicPermittingContext(() => {
+ return this.parseSmartPipelineBody(this.parseExprOpBaseRightExpr(op, prec, noIn), startPos, startLoc);
+ });
+
+ case "fsharp":
+ return this.withSoloAwaitPermittingContext(() => {
+ return this.parseFSharpPipelineBody(prec, noIn);
+ });
+ }
+
+ default:
+ return this.parseExprOpBaseRightExpr(op, prec, noIn);
+ }
+ }
+
+ parseExprOpBaseRightExpr(op, prec, noIn) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn);
+ }
+
+ parseMaybeUnary(refExpressionErrors) {
+ if (this.isContextual("await") && this.isAwaitAllowed()) {
+ return this.parseAwait();
+ } else if (this.state.type.prefix) {
+ const node = this.startNode();
+ const update = this.match(types.incDec);
+ node.operator = this.state.value;
+ node.prefix = true;
+
+ if (node.operator === "throw") {
+ this.expectPlugin("throwExpressions");
+ }
+
+ this.next();
+ node.argument = this.parseMaybeUnary();
+ this.checkExpressionErrors(refExpressionErrors, true);
+
+ if (update) {
+ this.checkLVal(node.argument, undefined, undefined, "prefix operation");
+ } else if (this.state.strict && node.operator === "delete") {
+ const arg = node.argument;
+
+ if (arg.type === "Identifier") {
+ this.raise(node.start, "Deleting local variable in strict mode");
+ } else if (arg.type === "MemberExpression" && arg.property.type === "PrivateName") {
+ this.raise(node.start, "Deleting a private field is not allowed");
+ }
+ }
+
+ return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
+ }
+
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr = this.parseExprSubscripts(refExpressionErrors);
+ if (this.checkExpressionErrors(refExpressionErrors, false)) return expr;
+
+ while (this.state.type.postfix && !this.canInsertSemicolon()) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.operator = this.state.value;
+ node.prefix = false;
+ node.argument = expr;
+ this.checkLVal(expr, undefined, undefined, "postfix operation");
+ this.next();
+ expr = this.finishNode(node, "UpdateExpression");
+ }
+
+ return expr;
+ }
+
+ parseExprSubscripts(refExpressionErrors) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ const potentialArrowAt = this.state.potentialArrowAt;
+ const expr = this.parseExprAtom(refExpressionErrors);
+
+ if (expr.type === "ArrowFunctionExpression" && expr.start === potentialArrowAt) {
+ return expr;
+ }
+
+ return this.parseSubscripts(expr, startPos, startLoc);
+ }
+
+ parseSubscripts(base, startPos, startLoc, noCalls) {
+ const state = {
+ optionalChainMember: false,
+ maybeAsyncArrow: this.atPossibleAsync(base),
+ stop: false
+ };
+
+ do {
+ base = this.parseSubscript(base, startPos, startLoc, noCalls, state);
+ state.maybeAsyncArrow = false;
+ } while (!state.stop);
+
+ return base;
+ }
+
+ parseSubscript(base, startPos, startLoc, noCalls, state) {
+ if (!noCalls && this.eat(types.doubleColon)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.callee = this.parseNoCallExpr();
+ state.stop = true;
+ return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls);
+ }
+
+ let optional = false;
+
+ if (this.match(types.questionDot)) {
+ state.optionalChainMember = optional = true;
+
+ if (noCalls && this.lookaheadCharCode() === 40) {
+ state.stop = true;
+ return base;
+ }
+
+ this.next();
+ }
+
+ const computed = this.eat(types.bracketL);
+
+ if (optional && !this.match(types.parenL) && !this.match(types.backQuote) || computed || this.eat(types.dot)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = base;
+ node.property = computed ? this.parseExpression() : optional ? this.parseIdentifier(true) : this.parseMaybePrivateName(true);
+ node.computed = computed;
+
+ if (node.property.type === "PrivateName") {
+ if (node.object.type === "Super") {
+ this.raise(startPos, "Private fields can't be accessed on super");
+ }
+
+ this.classScope.usePrivateName(node.property.id.name, node.property.start);
+ }
+
+ if (computed) {
+ this.expect(types.bracketR);
+ }
+
+ if (state.optionalChainMember) {
+ node.optional = optional;
+ return this.finishNode(node, "OptionalMemberExpression");
+ } else {
+ return this.finishNode(node, "MemberExpression");
+ }
+ } else if (!noCalls && this.match(types.parenL)) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.next();
+ let node = this.startNodeAt(startPos, startLoc);
+ node.callee = base;
+
+ if (optional) {
+ node.optional = true;
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ } else {
+ node.arguments = this.parseCallExpressionArguments(types.parenR, state.maybeAsyncArrow, base.type === "Import", base.type !== "Super", node);
+ }
+
+ this.finishCallExpression(node, state.optionalChainMember);
+
+ if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) {
+ state.stop = true;
+ node = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node);
+ this.checkYieldAwaitInDefaultParams();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ } else {
+ this.toReferencedListDeep(node.arguments);
+ if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
+
+ if (!this.isAwaitAllowed() && !oldMaybeInArrowParameters || oldAwaitPos !== -1) {
+ this.state.awaitPos = oldAwaitPos;
+ }
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ return node;
+ } else if (this.match(types.backQuote)) {
+ return this.parseTaggedTemplateExpression(startPos, startLoc, base, state);
+ } else {
+ state.stop = true;
+ return base;
+ }
+ }
+
+ parseTaggedTemplateExpression(startPos, startLoc, base, state, typeArguments) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.tag = base;
+ node.quasi = this.parseTemplate(true);
+ if (typeArguments) node.typeParameters = typeArguments;
+
+ if (state.optionalChainMember) {
+ this.raise(startPos, "Tagged Template Literals are not allowed in optionalChain");
+ }
+
+ return this.finishNode(node, "TaggedTemplateExpression");
+ }
+
+ atPossibleAsync(base) {
+ return base.type === "Identifier" && base.name === "async" && this.state.lastTokEnd === base.end && !this.canInsertSemicolon() && this.input.slice(base.start, base.end) === "async";
+ }
+
+ finishCallExpression(node, optional) {
+ if (node.callee.type === "Import") {
+ if (node.arguments.length !== 1) {
+ this.raise(node.start, "import() requires exactly one argument");
+ } else {
+ const importArg = node.arguments[0];
+
+ if (importArg && importArg.type === "SpreadElement") {
+ this.raise(importArg.start, "... is not allowed in import()");
+ }
+ }
+ }
+
+ return this.finishNode(node, optional ? "OptionalCallExpression" : "CallExpression");
+ }
+
+ parseCallExpressionArguments(close, possibleAsyncArrow, dynamicImport, allowPlaceholder, nodeForExtra) {
+ const elts = [];
+ let innerParenStart;
+ let first = true;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma);
+
+ if (this.match(close)) {
+ if (dynamicImport) {
+ this.raise(this.state.lastTokStart, "Trailing comma is disallowed inside import(...) arguments");
+ }
+
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ if (this.match(types.parenL) && !innerParenStart) {
+ innerParenStart = this.state.start;
+ }
+
+ elts.push(this.parseExprListItem(false, possibleAsyncArrow ? new ExpressionErrors() : undefined, possibleAsyncArrow ? {
+ start: 0
+ } : undefined, allowPlaceholder));
+ }
+
+ if (possibleAsyncArrow && innerParenStart && this.shouldParseAsyncArrow()) {
+ this.unexpected();
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return elts;
+ }
+
+ shouldParseAsyncArrow() {
+ return this.match(types.arrow) && !this.canInsertSemicolon();
+ }
+
+ parseAsyncArrowFromCallExpression(node, call) {
+ var _call$extra;
+
+ this.expect(types.arrow);
+ this.parseArrowExpression(node, call.arguments, true, (_call$extra = call.extra) == null ? void 0 : _call$extra.trailingComma);
+ return node;
+ }
+
+ parseNoCallExpr() {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true);
+ }
+
+ parseExprAtom(refExpressionErrors) {
+ if (this.state.type === types.slash) this.readRegexp();
+ const canBeArrow = this.state.potentialArrowAt === this.state.start;
+ let node;
+
+ switch (this.state.type) {
+ case types._super:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(types.parenL) && !this.scope.allowDirectSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, "super() is only valid inside a class constructor of a subclass. " + "Maybe a typo in the method name ('constructor') or not extending another class?");
+ } else if (!this.scope.allowSuper && !this.options.allowSuperOutsideMethod) {
+ this.raise(node.start, "super is only allowed in object methods and classes");
+ }
+
+ if (!this.match(types.parenL) && !this.match(types.bracketL) && !this.match(types.dot)) {
+ this.raise(node.start, "super can only be used with function calls (i.e. super()) or " + "in property accesses (i.e. super.prop or super[prop])");
+ }
+
+ return this.finishNode(node, "Super");
+
+ case types._import:
+ node = this.startNode();
+ this.next();
+
+ if (this.match(types.dot)) {
+ return this.parseImportMetaProperty(node);
+ }
+
+ if (!this.match(types.parenL)) {
+ this.raise(this.state.lastTokStart, "import can only be used in import() or import.meta");
+ }
+
+ return this.finishNode(node, "Import");
+
+ case types._this:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "ThisExpression");
+
+ case types.name:
+ {
+ node = this.startNode();
+ const containsEsc = this.state.containsEsc;
+ const id = this.parseIdentifier();
+
+ if (!containsEsc && id.name === "async" && this.match(types._function) && !this.canInsertSemicolon()) {
+ const last = this.state.context.length - 1;
+
+ if (this.state.context[last] !== types$1.functionStatement) {
+ throw new Error("Internal error");
+ }
+
+ this.state.context[last] = types$1.functionExpression;
+ this.next();
+ return this.parseFunction(node, undefined, true);
+ } else if (canBeArrow && !containsEsc && id.name === "async" && this.match(types.name) && !this.canInsertSemicolon()) {
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ const params = [this.parseIdentifier()];
+ this.expect(types.arrow);
+ this.checkYieldAwaitInDefaultParams();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ this.parseArrowExpression(node, params, true);
+ return node;
+ }
+
+ if (canBeArrow && this.match(types.arrow) && !this.canInsertSemicolon()) {
+ this.next();
+ this.parseArrowExpression(node, [id], false);
+ return node;
+ }
+
+ return id;
+ }
+
+ case types._do:
+ {
+ this.expectPlugin("doExpressions");
+ const node = this.startNode();
+ this.next();
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ node.body = this.parseBlock();
+ this.state.labels = oldLabels;
+ return this.finishNode(node, "DoExpression");
+ }
+
+ case types.regexp:
+ {
+ const value = this.state.value;
+ node = this.parseLiteral(value.value, "RegExpLiteral");
+ node.pattern = value.pattern;
+ node.flags = value.flags;
+ return node;
+ }
+
+ case types.num:
+ return this.parseLiteral(this.state.value, "NumericLiteral");
+
+ case types.bigint:
+ return this.parseLiteral(this.state.value, "BigIntLiteral");
+
+ case types.string:
+ return this.parseLiteral(this.state.value, "StringLiteral");
+
+ case types._null:
+ node = this.startNode();
+ this.next();
+ return this.finishNode(node, "NullLiteral");
+
+ case types._true:
+ case types._false:
+ return this.parseBooleanLiteral();
+
+ case types.parenL:
+ return this.parseParenAndDistinguishExpression(canBeArrow);
+
+ case types.bracketL:
+ {
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ node = this.startNode();
+ this.next();
+ node.elements = this.parseExprList(types.bracketR, true, refExpressionErrors, node);
+
+ if (!this.state.maybeInArrowParameters) {
+ this.toReferencedList(node.elements);
+ }
+
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return this.finishNode(node, "ArrayExpression");
+ }
+
+ case types.braceL:
+ {
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = false;
+ const ret = this.parseObj(false, refExpressionErrors);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+ case types._function:
+ return this.parseFunctionExpression();
+
+ case types.at:
+ this.parseDecorators();
+
+ case types._class:
+ node = this.startNode();
+ this.takeDecorators(node);
+ return this.parseClass(node, false);
+
+ case types._new:
+ return this.parseNew();
+
+ case types.backQuote:
+ return this.parseTemplate(false);
+
+ case types.doubleColon:
+ {
+ node = this.startNode();
+ this.next();
+ node.object = null;
+ const callee = node.callee = this.parseNoCallExpr();
+
+ if (callee.type === "MemberExpression") {
+ return this.finishNode(node, "BindExpression");
+ } else {
+ throw this.raise(callee.start, "Binding should be performed on object property.");
+ }
+ }
+
+ case types.hash:
+ {
+ if (this.state.inPipeline) {
+ node = this.startNode();
+
+ if (this.getPluginOption("pipelineOperator", "proposal") !== "smart") {
+ this.raise(node.start, "Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option.");
+ }
+
+ this.next();
+
+ if (!this.primaryTopicReferenceIsAllowedInCurrentTopicContext()) {
+ this.raise(node.start, `Topic reference was used in a lexical context without topic binding`);
+ }
+
+ this.registerTopicReference();
+ return this.finishNode(node, "PipelinePrimaryTopicReference");
+ }
+ }
+
+ default:
+ throw this.unexpected();
+ }
+ }
+
+ parseBooleanLiteral() {
+ const node = this.startNode();
+ node.value = this.match(types._true);
+ this.next();
+ return this.finishNode(node, "BooleanLiteral");
+ }
+
+ parseMaybePrivateName(isPrivateNameAllowed) {
+ const isPrivate = this.match(types.hash);
+
+ if (isPrivate) {
+ this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]);
+
+ if (!isPrivateNameAllowed) {
+ this.raise(this.state.pos, "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).");
+ }
+
+ const node = this.startNode();
+ this.next();
+ this.assertNoSpace("Unexpected space between # and identifier");
+ node.id = this.parseIdentifier(true);
+ return this.finishNode(node, "PrivateName");
+ } else {
+ return this.parseIdentifier(true);
+ }
+ }
+
+ parseFunctionExpression() {
+ const node = this.startNode();
+ let meta = this.startNode();
+ this.next();
+ meta = this.createIdentifier(meta, "function");
+
+ if (this.prodParam.hasYield && this.eat(types.dot)) {
+ return this.parseMetaProperty(node, meta, "sent");
+ }
+
+ return this.parseFunction(node);
+ }
+
+ parseMetaProperty(node, meta, propertyName) {
+ node.meta = meta;
+
+ if (meta.name === "function" && propertyName === "sent") {
+ if (this.isContextual(propertyName)) {
+ this.expectPlugin("functionSent");
+ } else if (!this.hasPlugin("functionSent")) {
+ this.unexpected();
+ }
+ }
+
+ const containsEsc = this.state.containsEsc;
+ node.property = this.parseIdentifier(true);
+
+ if (node.property.name !== propertyName || containsEsc) {
+ this.raise(node.property.start, `The only valid meta property for ${meta.name} is ${meta.name}.${propertyName}`);
+ }
+
+ return this.finishNode(node, "MetaProperty");
+ }
+
+ parseImportMetaProperty(node) {
+ const id = this.createIdentifier(this.startNodeAtNode(node), "import");
+ this.expect(types.dot);
+
+ if (this.isContextual("meta")) {
+ this.expectPlugin("importMeta");
+
+ if (!this.inModule) {
+ this.raise(id.start, `import.meta may appear only with 'sourceType: "module"'`, {
+ code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+ });
+ }
+
+ this.sawUnambiguousESM = true;
+ } else if (!this.hasPlugin("importMeta")) {
+ this.raise(id.start, `Dynamic imports require a parameter: import('a.js')`);
+ }
+
+ return this.parseMetaProperty(node, id, "meta");
+ }
+
+ parseLiteral(value, type, startPos, startLoc) {
+ startPos = startPos || this.state.start;
+ startLoc = startLoc || this.state.startLoc;
+ const node = this.startNodeAt(startPos, startLoc);
+ this.addExtra(node, "rawValue", value);
+ this.addExtra(node, "raw", this.input.slice(startPos, this.state.end));
+ node.value = value;
+ this.next();
+ return this.finishNode(node, type);
+ }
+
+ parseParenAndDistinguishExpression(canBeArrow) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let val;
+ this.expect(types.parenL);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.maybeInArrowParameters = true;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.state.inFSharpPipelineDirectBody = false;
+ const innerStartPos = this.state.start;
+ const innerStartLoc = this.state.startLoc;
+ const exprList = [];
+ const refExpressionErrors = new ExpressionErrors();
+ const refNeedsArrowPos = {
+ start: 0
+ };
+ let first = true;
+ let spreadStart;
+ let optionalCommaStart;
+
+ while (!this.match(types.parenR)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma, refNeedsArrowPos.start || null);
+
+ if (this.match(types.parenR)) {
+ optionalCommaStart = this.state.start;
+ break;
+ }
+ }
+
+ if (this.match(types.ellipsis)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ spreadStart = this.state.start;
+ exprList.push(this.parseParenItem(this.parseRestBinding(), spreadNodeStartPos, spreadNodeStartLoc));
+ this.checkCommaAfterRest(41);
+ break;
+ } else {
+ exprList.push(this.parseMaybeAssign(false, refExpressionErrors, this.parseParenItem, refNeedsArrowPos));
+ }
+ }
+
+ const innerEndPos = this.state.start;
+ const innerEndLoc = this.state.startLoc;
+ this.expect(types.parenR);
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ let arrowNode = this.startNodeAt(startPos, startLoc);
+
+ if (canBeArrow && this.shouldParseArrow() && (arrowNode = this.parseArrow(arrowNode))) {
+ this.checkYieldAwaitInDefaultParams();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+
+ for (let _i = 0; _i < exprList.length; _i++) {
+ const param = exprList[_i];
+
+ if (param.extra && param.extra.parenthesized) {
+ this.unexpected(param.extra.parenStart);
+ }
+ }
+
+ this.parseArrowExpression(arrowNode, exprList, false);
+ return arrowNode;
+ }
+
+ if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos;
+ if (oldAwaitPos !== -1) this.state.awaitPos = oldAwaitPos;
+
+ if (!exprList.length) {
+ this.unexpected(this.state.lastTokStart);
+ }
+
+ if (optionalCommaStart) this.unexpected(optionalCommaStart);
+ if (spreadStart) this.unexpected(spreadStart);
+ this.checkExpressionErrors(refExpressionErrors, true);
+ if (refNeedsArrowPos.start) this.unexpected(refNeedsArrowPos.start);
+ this.toReferencedListDeep(exprList, true);
+
+ if (exprList.length > 1) {
+ val = this.startNodeAt(innerStartPos, innerStartLoc);
+ val.expressions = exprList;
+ this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
+ } else {
+ val = exprList[0];
+ }
+
+ if (!this.options.createParenthesizedExpressions) {
+ this.addExtra(val, "parenthesized", true);
+ this.addExtra(val, "parenStart", startPos);
+ return val;
+ }
+
+ const parenExpression = this.startNodeAt(startPos, startLoc);
+ parenExpression.expression = val;
+ this.finishNode(parenExpression, "ParenthesizedExpression");
+ return parenExpression;
+ }
+
+ shouldParseArrow() {
+ return !this.canInsertSemicolon();
+ }
+
+ parseArrow(node) {
+ if (this.eat(types.arrow)) {
+ return node;
+ }
+ }
+
+ parseParenItem(node, startPos, startLoc) {
+ return node;
+ }
+
+ parseNew() {
+ const node = this.startNode();
+ let meta = this.startNode();
+ this.next();
+ meta = this.createIdentifier(meta, "new");
+
+ if (this.eat(types.dot)) {
+ const metaProp = this.parseMetaProperty(node, meta, "target");
+
+ if (!this.scope.inNonArrowFunction && !this.scope.inClass) {
+ let error = "new.target can only be used in functions";
+
+ if (this.hasPlugin("classProperties")) {
+ error += " or class properties";
+ }
+
+ this.raise(metaProp.start, error);
+ }
+
+ return metaProp;
+ }
+
+ node.callee = this.parseNoCallExpr();
+
+ if (node.callee.type === "Import") {
+ this.raise(node.callee.start, "Cannot use new with import(...)");
+ } else if (node.callee.type === "OptionalMemberExpression" || node.callee.type === "OptionalCallExpression") {
+ this.raise(this.state.lastTokEnd, "constructors in/after an Optional Chain are not allowed");
+ } else if (this.eat(types.questionDot)) {
+ this.raise(this.state.start, "constructors in/after an Optional Chain are not allowed");
+ }
+
+ this.parseNewArguments(node);
+ return this.finishNode(node, "NewExpression");
+ }
+
+ parseNewArguments(node) {
+ if (this.eat(types.parenL)) {
+ const args = this.parseExprList(types.parenR);
+ this.toReferencedList(args);
+ node.arguments = args;
+ } else {
+ node.arguments = [];
+ }
+ }
+
+ parseTemplateElement(isTagged) {
+ const elem = this.startNode();
+
+ if (this.state.value === null) {
+ if (!isTagged) {
+ this.raise(this.state.start + 1, "Invalid escape sequence in template");
+ }
+ }
+
+ elem.value = {
+ raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"),
+ cooked: this.state.value
+ };
+ this.next();
+ elem.tail = this.match(types.backQuote);
+ return this.finishNode(elem, "TemplateElement");
+ }
+
+ parseTemplate(isTagged) {
+ const node = this.startNode();
+ this.next();
+ node.expressions = [];
+ let curElt = this.parseTemplateElement(isTagged);
+ node.quasis = [curElt];
+
+ while (!curElt.tail) {
+ this.expect(types.dollarBraceL);
+ node.expressions.push(this.parseExpression());
+ this.expect(types.braceR);
+ node.quasis.push(curElt = this.parseTemplateElement(isTagged));
+ }
+
+ this.next();
+ return this.finishNode(node, "TemplateLiteral");
+ }
+
+ parseObj(isPattern, refExpressionErrors) {
+ const propHash = Object.create(null);
+ let first = true;
+ const node = this.startNode();
+ node.properties = [];
+ this.next();
+
+ while (!this.eat(types.braceR)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma);
+
+ if (this.match(types.braceR)) {
+ this.addExtra(node, "trailingComma", this.state.lastTokStart);
+ this.next();
+ break;
+ }
+ }
+
+ const prop = this.parseObjectMember(isPattern, refExpressionErrors);
+
+ if (!isPattern) {
+ this.checkDuplicatedProto(prop, propHash, refExpressionErrors);
+ }
+
+ if (prop.shorthand) {
+ this.addExtra(prop, "shorthand", true);
+ }
+
+ node.properties.push(prop);
+ }
+
+ return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression");
+ }
+
+ isAsyncProp(prop) {
+ return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" && (this.match(types.name) || this.match(types.num) || this.match(types.string) || this.match(types.bracketL) || this.state.type.keyword || this.match(types.star)) && !this.hasPrecedingLineBreak();
+ }
+
+ parseObjectMember(isPattern, refExpressionErrors) {
+ let decorators = [];
+
+ if (this.match(types.at)) {
+ if (this.hasPlugin("decorators")) {
+ this.raise(this.state.start, "Stage 2 decorators disallow object literal property decorators");
+ }
+
+ while (this.match(types.at)) {
+ decorators.push(this.parseDecorator());
+ }
+ }
+
+ const prop = this.startNode();
+ let isGenerator = false;
+ let isAsync = false;
+ let startPos;
+ let startLoc;
+
+ if (this.match(types.ellipsis)) {
+ if (decorators.length) this.unexpected();
+
+ if (isPattern) {
+ this.next();
+ prop.argument = this.parseIdentifier();
+ this.checkCommaAfterRest(125);
+ return this.finishNode(prop, "RestElement");
+ }
+
+ return this.parseSpread();
+ }
+
+ if (decorators.length) {
+ prop.decorators = decorators;
+ decorators = [];
+ }
+
+ prop.method = false;
+
+ if (isPattern || refExpressionErrors) {
+ startPos = this.state.start;
+ startLoc = this.state.startLoc;
+ }
+
+ if (!isPattern) {
+ isGenerator = this.eat(types.star);
+ }
+
+ const containsEsc = this.state.containsEsc;
+ this.parsePropertyName(prop, false);
+
+ if (!isPattern && !containsEsc && !isGenerator && this.isAsyncProp(prop)) {
+ isAsync = true;
+ isGenerator = this.eat(types.star);
+ this.parsePropertyName(prop, false);
+ } else {
+ isAsync = false;
+ }
+
+ this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc);
+ return prop;
+ }
+
+ isGetterOrSetterMethod(prop, isPattern) {
+ return !isPattern && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.match(types.string) || this.match(types.num) || this.match(types.bracketL) || this.match(types.name) || !!this.state.type.keyword);
+ }
+
+ getGetterSetterExpectedParamCount(method) {
+ return method.kind === "get" ? 0 : 1;
+ }
+
+ checkGetterSetterParams(method) {
+ const paramCount = this.getGetterSetterExpectedParamCount(method);
+ const start = method.start;
+
+ if (method.params.length !== paramCount) {
+ if (method.kind === "get") {
+ this.raise(start, "getter must not have any formal parameters");
+ } else {
+ this.raise(start, "setter must have exactly one formal parameter");
+ }
+ }
+
+ if (method.kind === "set" && method.params[method.params.length - 1].type === "RestElement") {
+ this.raise(start, "setter function argument must not be a rest parameter");
+ }
+ }
+
+ parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
+ if (isAsync || isGenerator || this.match(types.parenL)) {
+ if (isPattern) this.unexpected();
+ prop.kind = "method";
+ prop.method = true;
+ return this.parseMethod(prop, isGenerator, isAsync, false, false, "ObjectMethod");
+ }
+
+ if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) {
+ if (isGenerator || isAsync) this.unexpected();
+ prop.kind = prop.key.name;
+ this.parsePropertyName(prop, false);
+ this.parseMethod(prop, false, false, false, false, "ObjectMethod");
+ this.checkGetterSetterParams(prop);
+ return prop;
+ }
+ }
+
+ parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors) {
+ prop.shorthand = false;
+
+ if (this.eat(types.colon)) {
+ prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refExpressionErrors);
+ return this.finishNode(prop, "ObjectProperty");
+ }
+
+ if (!prop.computed && prop.key.type === "Identifier") {
+ this.checkReservedWord(prop.key.name, prop.key.start, true, true);
+
+ if (isPattern) {
+ prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
+ } else if (this.match(types.eq) && refExpressionErrors) {
+ if (refExpressionErrors.shorthandAssign === -1) {
+ refExpressionErrors.shorthandAssign = this.state.start;
+ }
+
+ prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone());
+ } else {
+ prop.value = prop.key.__clone();
+ }
+
+ prop.shorthand = true;
+ return this.finishNode(prop, "ObjectProperty");
+ }
+ }
+
+ parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refExpressionErrors, containsEsc) {
+ const node = this.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) || this.parseObjectProperty(prop, startPos, startLoc, isPattern, refExpressionErrors);
+ if (!node) this.unexpected();
+ return node;
+ }
+
+ parsePropertyName(prop, isPrivateNameAllowed) {
+ if (this.eat(types.bracketL)) {
+ prop.computed = true;
+ prop.key = this.parseMaybeAssign();
+ this.expect(types.bracketR);
+ } else {
+ const oldInPropertyName = this.state.inPropertyName;
+ this.state.inPropertyName = true;
+ prop.key = this.match(types.num) || this.match(types.string) || this.match(types.bigint) ? this.parseExprAtom() : this.parseMaybePrivateName(isPrivateNameAllowed);
+
+ if (prop.key.type !== "PrivateName") {
+ prop.computed = false;
+ }
+
+ this.state.inPropertyName = oldInPropertyName;
+ }
+
+ return prop.key;
+ }
+
+ initFunction(node, isAsync) {
+ node.id = null;
+ node.generator = false;
+ node.async = !!isAsync;
+ }
+
+ parseMethod(node, isGenerator, isAsync, isConstructor, allowDirectSuper, type, inClassScope = false) {
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.initFunction(node, isAsync);
+ node.generator = !!isGenerator;
+ const allowModifiers = isConstructor;
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_SUPER | (inClassScope ? SCOPE_CLASS : 0) | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+ this.parseFunctionParams(node, allowModifiers);
+ this.parseFunctionBodyAndFinish(node, type, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return node;
+ }
+
+ parseArrowExpression(node, params, isAsync, trailingCommaPos) {
+ this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);
+ this.prodParam.enter(functionFlags(isAsync, false));
+ this.initFunction(node, isAsync);
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+
+ if (params) {
+ this.state.maybeInArrowParameters = true;
+ this.setArrowFunctionParameters(node, params, trailingCommaPos);
+ }
+
+ this.state.maybeInArrowParameters = false;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.parseFunctionBody(node, true);
+ this.prodParam.exit();
+ this.scope.exit();
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return this.finishNode(node, "ArrowFunctionExpression");
+ }
+
+ setArrowFunctionParameters(node, params, trailingCommaPos) {
+ node.params = this.toAssignableList(params, trailingCommaPos);
+ }
+
+ parseFunctionBodyAndFinish(node, type, isMethod = false) {
+ this.parseFunctionBody(node, false, isMethod);
+ this.finishNode(node, type);
+ }
+
+ parseFunctionBody(node, allowExpression, isMethod = false) {
+ const isExpression = allowExpression && !this.match(types.braceL);
+ const oldStrict = this.state.strict;
+ let useStrict = false;
+ const oldInParameters = this.state.inParameters;
+ this.state.inParameters = false;
+
+ if (isExpression) {
+ node.body = this.parseMaybeAssign();
+ this.checkParams(node, false, allowExpression, false);
+ } else {
+ const nonSimple = !this.isSimpleParamList(node.params);
+
+ if (!oldStrict || nonSimple) {
+ useStrict = this.strictDirective(this.state.end);
+
+ if (useStrict && nonSimple) {
+ const errorPos = (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.end : node.start;
+ this.raise(errorPos, "Illegal 'use strict' directive in function with non-simple parameter list");
+ }
+ }
+
+ const oldLabels = this.state.labels;
+ this.state.labels = [];
+ if (useStrict) this.state.strict = true;
+ this.checkParams(node, !oldStrict && !useStrict && !allowExpression && !isMethod && !nonSimple, allowExpression, !oldStrict && useStrict);
+ this.prodParam.enter(this.prodParam.currentFlags() | PARAM_RETURN);
+ node.body = this.parseBlock(true, false);
+ this.prodParam.exit();
+ this.state.labels = oldLabels;
+ }
+
+ this.state.inParameters = oldInParameters;
+
+ if (this.state.strict && node.id) {
+ this.checkLVal(node.id, BIND_OUTSIDE, undefined, "function name", undefined, !oldStrict && useStrict);
+ }
+
+ this.state.strict = oldStrict;
+ }
+
+ isSimpleParamList(params) {
+ for (let i = 0, len = params.length; i < len; i++) {
+ if (params[i].type !== "Identifier") return false;
+ }
+
+ return true;
+ }
+
+ checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged = true) {
+ const nameHash = Object.create(null);
+
+ for (let i = 0; i < node.params.length; i++) {
+ this.checkLVal(node.params[i], BIND_VAR, allowDuplicates ? null : nameHash, "function parameter list", undefined, strictModeChanged);
+ }
+ }
+
+ parseExprList(close, allowEmpty, refExpressionErrors, nodeForExtra) {
+ const elts = [];
+ let first = true;
+
+ while (!this.eat(close)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma);
+
+ if (this.match(close)) {
+ if (nodeForExtra) {
+ this.addExtra(nodeForExtra, "trailingComma", this.state.lastTokStart);
+ }
+
+ this.next();
+ break;
+ }
+ }
+
+ elts.push(this.parseExprListItem(allowEmpty, refExpressionErrors));
+ }
+
+ return elts;
+ }
+
+ parseExprListItem(allowEmpty, refExpressionErrors, refNeedsArrowPos, allowPlaceholder) {
+ let elt;
+
+ if (allowEmpty && this.match(types.comma)) {
+ elt = null;
+ } else if (this.match(types.ellipsis)) {
+ const spreadNodeStartPos = this.state.start;
+ const spreadNodeStartLoc = this.state.startLoc;
+ elt = this.parseParenItem(this.parseSpread(refExpressionErrors, refNeedsArrowPos), spreadNodeStartPos, spreadNodeStartLoc);
+ } else if (this.match(types.question)) {
+ this.expectPlugin("partialApplication");
+
+ if (!allowPlaceholder) {
+ this.raise(this.state.start, "Unexpected argument placeholder");
+ }
+
+ const node = this.startNode();
+ this.next();
+ elt = this.finishNode(node, "ArgumentPlaceholder");
+ } else {
+ elt = this.parseMaybeAssign(false, refExpressionErrors, this.parseParenItem, refNeedsArrowPos);
+ }
+
+ return elt;
+ }
+
+ parseIdentifier(liberal) {
+ const node = this.startNode();
+ const name = this.parseIdentifierName(node.start, liberal);
+ return this.createIdentifier(node, name);
+ }
+
+ createIdentifier(node, name) {
+ node.name = name;
+ node.loc.identifierName = name;
+ return this.finishNode(node, "Identifier");
+ }
+
+ parseIdentifierName(pos, liberal) {
+ let name;
+
+ if (this.match(types.name)) {
+ name = this.state.value;
+ } else if (this.state.type.keyword) {
+ name = this.state.type.keyword;
+
+ if ((name === "class" || name === "function") && (this.state.lastTokEnd !== this.state.lastTokStart + 1 || this.input.charCodeAt(this.state.lastTokStart) !== 46)) {
+ this.state.context.pop();
+ }
+ } else {
+ throw this.unexpected();
+ }
+
+ if (liberal) {
+ this.state.type = types.name;
+ } else {
+ this.checkReservedWord(name, this.state.start, !!this.state.type.keyword, false);
+ }
+
+ this.next();
+ return name;
+ }
+
+ checkReservedWord(word, startLoc, checkKeywords, isBinding) {
+ if (this.prodParam.hasYield && word === "yield") {
+ this.raise(startLoc, "Can not use 'yield' as identifier inside a generator");
+ return;
+ }
+
+ if (word === "await") {
+ if (this.prodParam.hasAwait) {
+ this.raise(startLoc, "Can not use 'await' as identifier inside an async function");
+ return;
+ }
+
+ if (this.state.awaitPos === -1 && (this.state.maybeInArrowParameters || this.isAwaitAllowed())) {
+ this.state.awaitPos = this.state.start;
+ }
+ }
+
+ if (this.scope.inClass && !this.scope.inNonArrowFunction && word === "arguments") {
+ this.raise(startLoc, "'arguments' is not allowed in class field initializer");
+ return;
+ }
+
+ if (checkKeywords && isKeyword(word)) {
+ this.raise(startLoc, `Unexpected keyword '${word}'`);
+ return;
+ }
+
+ const reservedTest = !this.state.strict ? isReservedWord : isBinding ? isStrictBindReservedWord : isStrictReservedWord;
+
+ if (reservedTest(word, this.inModule)) {
+ if (!this.prodParam.hasAwait && word === "await") {
+ this.raise(startLoc, "Can not use keyword 'await' outside an async function");
+ } else {
+ this.raise(startLoc, `Unexpected reserved word '${word}'`);
+ }
+ }
+ }
+
+ isAwaitAllowed() {
+ if (this.scope.inFunction) return this.prodParam.hasAwait;
+ if (this.options.allowAwaitOutsideFunction) return true;
+
+ if (this.hasPlugin("topLevelAwait")) {
+ return this.inModule && this.prodParam.hasAwait;
+ }
+
+ return false;
+ }
+
+ parseAwait() {
+ const node = this.startNode();
+ this.next();
+
+ if (this.state.inParameters) {
+ this.raise(node.start, "await is not allowed in async function parameters");
+ } else if (this.state.awaitPos === -1) {
+ this.state.awaitPos = node.start;
+ }
+
+ if (this.eat(types.star)) {
+ this.raise(node.start, "await* has been removed from the async functions proposal. Use Promise.all() instead.");
+ }
+
+ if (!this.scope.inFunction && !this.options.allowAwaitOutsideFunction) {
+ if (this.hasPrecedingLineBreak() || this.match(types.plusMin) || this.match(types.parenL) || this.match(types.bracketL) || this.match(types.backQuote) || this.match(types.regexp) || this.match(types.slash) || this.hasPlugin("v8intrinsic") && this.match(types.modulo)) {
+ this.ambiguousScriptDifferentAst = true;
+ } else {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ if (!this.state.soloAwait) {
+ node.argument = this.parseMaybeUnary();
+ }
+
+ return this.finishNode(node, "AwaitExpression");
+ }
+
+ parseYield(noIn) {
+ const node = this.startNode();
+
+ if (this.state.inParameters) {
+ this.raise(node.start, "yield is not allowed in generator parameters");
+ } else if (this.state.yieldPos === -1) {
+ this.state.yieldPos = node.start;
+ }
+
+ this.next();
+
+ if (this.match(types.semi) || !this.match(types.star) && !this.state.type.startsExpr || this.hasPrecedingLineBreak()) {
+ node.delegate = false;
+ node.argument = null;
+ } else {
+ node.delegate = this.eat(types.star);
+ node.argument = this.parseMaybeAssign(noIn);
+ }
+
+ return this.finishNode(node, "YieldExpression");
+ }
+
+ checkPipelineAtInfixOperator(left, leftStartPos) {
+ if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
+ if (left.type === "SequenceExpression") {
+ this.raise(leftStartPos, `Pipeline head should not be a comma-separated sequence expression`);
+ }
+ }
+ }
+
+ parseSmartPipelineBody(childExpression, startPos, startLoc) {
+ const pipelineStyle = this.checkSmartPipelineBodyStyle(childExpression);
+ this.checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos);
+ return this.parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc);
+ }
+
+ checkSmartPipelineBodyEarlyErrors(childExpression, pipelineStyle, startPos) {
+ if (this.match(types.arrow)) {
+ throw this.raise(this.state.start, `Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized`);
+ } else if (pipelineStyle === "PipelineTopicExpression" && childExpression.type === "SequenceExpression") {
+ this.raise(startPos, `Pipeline body may not be a comma-separated sequence expression`);
+ }
+ }
+
+ parseSmartPipelineBodyInStyle(childExpression, pipelineStyle, startPos, startLoc) {
+ const bodyNode = this.startNodeAt(startPos, startLoc);
+
+ switch (pipelineStyle) {
+ case "PipelineBareFunction":
+ bodyNode.callee = childExpression;
+ break;
+
+ case "PipelineBareConstructor":
+ bodyNode.callee = childExpression.callee;
+ break;
+
+ case "PipelineBareAwaitedFunction":
+ bodyNode.callee = childExpression.argument;
+ break;
+
+ case "PipelineTopicExpression":
+ if (!this.topicReferenceWasUsedInCurrentTopicContext()) {
+ this.raise(startPos, `Pipeline is in topic style but does not use topic reference`);
+ }
+
+ bodyNode.expression = childExpression;
+ break;
+
+ default:
+ throw new Error(`Internal @babel/parser error: Unknown pipeline style (${pipelineStyle})`);
+ }
+
+ return this.finishNode(bodyNode, pipelineStyle);
+ }
+
+ checkSmartPipelineBodyStyle(expression) {
+ switch (expression.type) {
+ default:
+ return this.isSimpleReference(expression) ? "PipelineBareFunction" : "PipelineTopicExpression";
+ }
+ }
+
+ isSimpleReference(expression) {
+ switch (expression.type) {
+ case "MemberExpression":
+ return !expression.computed && this.isSimpleReference(expression.object);
+
+ case "Identifier":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ withTopicPermittingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 1,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+
+ withTopicForbiddingContext(callback) {
+ const outerContextTopicState = this.state.topicContext;
+ this.state.topicContext = {
+ maxNumOfResolvableTopics: 0,
+ maxTopicIndex: null
+ };
+
+ try {
+ return callback();
+ } finally {
+ this.state.topicContext = outerContextTopicState;
+ }
+ }
+
+ withSoloAwaitPermittingContext(callback) {
+ const outerContextSoloAwaitState = this.state.soloAwait;
+ this.state.soloAwait = true;
+
+ try {
+ return callback();
+ } finally {
+ this.state.soloAwait = outerContextSoloAwaitState;
+ }
+ }
+
+ registerTopicReference() {
+ this.state.topicContext.maxTopicIndex = 0;
+ }
+
+ primaryTopicReferenceIsAllowedInCurrentTopicContext() {
+ return this.state.topicContext.maxNumOfResolvableTopics >= 1;
+ }
+
+ topicReferenceWasUsedInCurrentTopicContext() {
+ return this.state.topicContext.maxTopicIndex != null && this.state.topicContext.maxTopicIndex >= 0;
+ }
+
+ parseFSharpPipelineBody(prec, noIn) {
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ this.state.potentialArrowAt = this.state.start;
+ const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
+ this.state.inFSharpPipelineDirectBody = true;
+ const ret = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn);
+ this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
+ return ret;
+ }
+
+}
+
+const loopLabel = {
+ kind: "loop"
+},
+ switchLabel = {
+ kind: "switch"
+};
+const FUNC_NO_FLAGS = 0b000,
+ FUNC_STATEMENT = 0b001,
+ FUNC_HANGING_STATEMENT = 0b010,
+ FUNC_NULLABLE_ID = 0b100;
+class StatementParser extends ExpressionParser {
+ parseTopLevel(file, program) {
+ program.sourceType = this.options.sourceType;
+ program.interpreter = this.parseInterpreterDirective();
+ this.parseBlockBody(program, true, true, types.eof);
+
+ if (this.inModule && !this.options.allowUndeclaredExports && this.scope.undefinedExports.size > 0) {
+ for (let _i = 0, _Array$from = Array.from(this.scope.undefinedExports); _i < _Array$from.length; _i++) {
+ const [name] = _Array$from[_i];
+ const pos = this.scope.undefinedExports.get(name);
+ this.raise(pos, `Export '${name}' is not defined`);
+ }
+ }
+
+ file.program = this.finishNode(program, "Program");
+ file.comments = this.state.comments;
+ if (this.options.tokens) file.tokens = this.tokens;
+ return this.finishNode(file, "File");
+ }
+
+ stmtToDirective(stmt) {
+ const expr = stmt.expression;
+ const directiveLiteral = this.startNodeAt(expr.start, expr.loc.start);
+ const directive = this.startNodeAt(stmt.start, stmt.loc.start);
+ const raw = this.input.slice(expr.start, expr.end);
+ const val = directiveLiteral.value = raw.slice(1, -1);
+ this.addExtra(directiveLiteral, "raw", raw);
+ this.addExtra(directiveLiteral, "rawValue", val);
+ directive.value = this.finishNodeAt(directiveLiteral, "DirectiveLiteral", expr.end, expr.loc.end);
+ return this.finishNodeAt(directive, "Directive", stmt.end, stmt.loc.end);
+ }
+
+ parseInterpreterDirective() {
+ if (!this.match(types.interpreterDirective)) {
+ return null;
+ }
+
+ const node = this.startNode();
+ node.value = this.state.value;
+ this.next();
+ return this.finishNode(node, "InterpreterDirective");
+ }
+
+ isLet(context) {
+ if (!this.isContextual("let")) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ const nextCh = this.input.charCodeAt(next);
+ if (nextCh === 91) return true;
+ if (context) return false;
+ if (nextCh === 123) return true;
+
+ if (isIdentifierStart(nextCh)) {
+ let pos = next + 1;
+
+ while (isIdentifierChar(this.input.charCodeAt(pos))) {
+ ++pos;
+ }
+
+ const ident = this.input.slice(next, pos);
+ if (!keywordRelationalOperator.test(ident)) return true;
+ }
+
+ return false;
+ }
+
+ parseStatement(context, topLevel) {
+ if (this.match(types.at)) {
+ this.parseDecorators(true);
+ }
+
+ return this.parseStatementContent(context, topLevel);
+ }
+
+ parseStatementContent(context, topLevel) {
+ let starttype = this.state.type;
+ const node = this.startNode();
+ let kind;
+
+ if (this.isLet(context)) {
+ starttype = types._var;
+ kind = "let";
+ }
+
+ switch (starttype) {
+ case types._break:
+ case types._continue:
+ return this.parseBreakContinueStatement(node, starttype.keyword);
+
+ case types._debugger:
+ return this.parseDebuggerStatement(node);
+
+ case types._do:
+ return this.parseDoStatement(node);
+
+ case types._for:
+ return this.parseForStatement(node);
+
+ case types._function:
+ if (this.lookaheadCharCode() === 46) break;
+
+ if (context) {
+ if (this.state.strict) {
+ this.raise(this.state.start, "In strict mode code, functions can only be declared at top level or inside a block");
+ } else if (context !== "if" && context !== "label") {
+ this.raise(this.state.start, "In non-strict mode code, functions can only be declared at top level, " + "inside a block, or as the body of an if statement");
+ }
+ }
+
+ return this.parseFunctionStatement(node, false, !context);
+
+ case types._class:
+ if (context) this.unexpected();
+ return this.parseClass(node, true);
+
+ case types._if:
+ return this.parseIfStatement(node);
+
+ case types._return:
+ return this.parseReturnStatement(node);
+
+ case types._switch:
+ return this.parseSwitchStatement(node);
+
+ case types._throw:
+ return this.parseThrowStatement(node);
+
+ case types._try:
+ return this.parseTryStatement(node);
+
+ case types._const:
+ case types._var:
+ kind = kind || this.state.value;
+
+ if (context && kind !== "var") {
+ this.raise(this.state.start, "Lexical declaration cannot appear in a single-statement context");
+ }
+
+ return this.parseVarStatement(node, kind);
+
+ case types._while:
+ return this.parseWhileStatement(node);
+
+ case types._with:
+ return this.parseWithStatement(node);
+
+ case types.braceL:
+ return this.parseBlock();
+
+ case types.semi:
+ return this.parseEmptyStatement(node);
+
+ case types._export:
+ case types._import:
+ {
+ const nextTokenCharCode = this.lookaheadCharCode();
+
+ if (nextTokenCharCode === 40 || nextTokenCharCode === 46) {
+ break;
+ }
+
+ if (!this.options.allowImportExportEverywhere && !topLevel) {
+ this.raise(this.state.start, "'import' and 'export' may only appear at the top level");
+ }
+
+ this.next();
+ let result;
+
+ if (starttype === types._import) {
+ result = this.parseImport(node);
+
+ if (result.type === "ImportDeclaration" && (!result.importKind || result.importKind === "value")) {
+ this.sawUnambiguousESM = true;
+ }
+ } else {
+ result = this.parseExport(node);
+
+ if (result.type === "ExportNamedDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportAllDeclaration" && (!result.exportKind || result.exportKind === "value") || result.type === "ExportDefaultDeclaration") {
+ this.sawUnambiguousESM = true;
+ }
+ }
+
+ this.assertModuleNodeAllowed(node);
+ return result;
+ }
+
+ default:
+ {
+ if (this.isAsyncFunction()) {
+ if (context) {
+ this.raise(this.state.start, "Async functions can only be declared at the top level or inside a block");
+ }
+
+ this.next();
+ return this.parseFunctionStatement(node, true, !context);
+ }
+ }
+ }
+
+ const maybeName = this.state.value;
+ const expr = this.parseExpression();
+
+ if (starttype === types.name && expr.type === "Identifier" && this.eat(types.colon)) {
+ return this.parseLabeledStatement(node, maybeName, expr, context);
+ } else {
+ return this.parseExpressionStatement(node, expr);
+ }
+ }
+
+ assertModuleNodeAllowed(node) {
+ if (!this.options.allowImportExportEverywhere && !this.inModule) {
+ this.raise(node.start, `'import' and 'export' may appear only with 'sourceType: "module"'`, {
+ code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED"
+ });
+ }
+ }
+
+ takeDecorators(node) {
+ const decorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (decorators.length) {
+ node.decorators = decorators;
+ this.resetStartLocationFromNode(node, decorators[0]);
+ this.state.decoratorStack[this.state.decoratorStack.length - 1] = [];
+ }
+ }
+
+ canHaveLeadingDecorator() {
+ return this.match(types._class);
+ }
+
+ parseDecorators(allowExport) {
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ while (this.match(types.at)) {
+ const decorator = this.parseDecorator();
+ currentContextDecorators.push(decorator);
+ }
+
+ if (this.match(types._export)) {
+ if (!allowExport) {
+ this.unexpected();
+ }
+
+ if (this.hasPlugin("decorators") && !this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, "Using the export keyword between a decorator and a class is not allowed. " + "Please use `export @dec class` instead.");
+ }
+ } else if (!this.canHaveLeadingDecorator()) {
+ throw this.raise(this.state.start, "Leading decorators must be attached to a class declaration");
+ }
+ }
+
+ parseDecorator() {
+ this.expectOnePlugin(["decorators-legacy", "decorators"]);
+ const node = this.startNode();
+ this.next();
+
+ if (this.hasPlugin("decorators")) {
+ this.state.decoratorStack.push([]);
+ const startPos = this.state.start;
+ const startLoc = this.state.startLoc;
+ let expr;
+
+ if (this.eat(types.parenL)) {
+ expr = this.parseExpression();
+ this.expect(types.parenR);
+ } else {
+ expr = this.parseIdentifier(false);
+
+ while (this.eat(types.dot)) {
+ const node = this.startNodeAt(startPos, startLoc);
+ node.object = expr;
+ node.property = this.parseIdentifier(true);
+ node.computed = false;
+ expr = this.finishNode(node, "MemberExpression");
+ }
+ }
+
+ node.expression = this.parseMaybeDecoratorArguments(expr);
+ this.state.decoratorStack.pop();
+ } else {
+ node.expression = this.parseExprSubscripts();
+ }
+
+ return this.finishNode(node, "Decorator");
+ }
+
+ parseMaybeDecoratorArguments(expr) {
+ if (this.eat(types.parenL)) {
+ const node = this.startNodeAtNode(expr);
+ node.callee = expr;
+ node.arguments = this.parseCallExpressionArguments(types.parenR, false);
+ this.toReferencedList(node.arguments);
+ return this.finishNode(node, "CallExpression");
+ }
+
+ return expr;
+ }
+
+ parseBreakContinueStatement(node, keyword) {
+ const isBreak = keyword === "break";
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.label = null;
+ } else {
+ node.label = this.parseIdentifier();
+ this.semicolon();
+ }
+
+ this.verifyBreakContinue(node, keyword);
+ return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement");
+ }
+
+ verifyBreakContinue(node, keyword) {
+ const isBreak = keyword === "break";
+ let i;
+
+ for (i = 0; i < this.state.labels.length; ++i) {
+ const lab = this.state.labels[i];
+
+ if (node.label == null || lab.name === node.label.name) {
+ if (lab.kind != null && (isBreak || lab.kind === "loop")) break;
+ if (node.label && isBreak) break;
+ }
+ }
+
+ if (i === this.state.labels.length) {
+ this.raise(node.start, "Unsyntactic " + keyword);
+ }
+ }
+
+ parseDebuggerStatement(node) {
+ this.next();
+ this.semicolon();
+ return this.finishNode(node, "DebuggerStatement");
+ }
+
+ parseHeaderExpression() {
+ this.expect(types.parenL);
+ const val = this.parseExpression();
+ this.expect(types.parenR);
+ return val;
+ }
+
+ parseDoStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("do"));
+ this.state.labels.pop();
+ this.expect(types._while);
+ node.test = this.parseHeaderExpression();
+ this.eat(types.semi);
+ return this.finishNode(node, "DoWhileStatement");
+ }
+
+ parseForStatement(node) {
+ this.next();
+ this.state.labels.push(loopLabel);
+ let awaitAt = -1;
+
+ if (this.isAwaitAllowed() && this.eatContextual("await")) {
+ awaitAt = this.state.lastTokStart;
+ }
+
+ this.scope.enter(SCOPE_OTHER);
+ this.expect(types.parenL);
+
+ if (this.match(types.semi)) {
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, null);
+ }
+
+ const isLet = this.isLet();
+
+ if (this.match(types._var) || this.match(types._const) || isLet) {
+ const init = this.startNode();
+ const kind = isLet ? "let" : this.state.value;
+ this.next();
+ this.parseVar(init, true, kind);
+ this.finishNode(init, "VariableDeclaration");
+
+ if ((this.match(types._in) || this.isContextual("of")) && init.declarations.length === 1) {
+ return this.parseForIn(node, init, awaitAt);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ const refExpressionErrors = new ExpressionErrors();
+ const init = this.parseExpression(true, refExpressionErrors);
+
+ if (this.match(types._in) || this.isContextual("of")) {
+ this.toAssignable(init);
+ const description = this.isContextual("of") ? "for-of statement" : "for-in statement";
+ this.checkLVal(init, undefined, undefined, description);
+ return this.parseForIn(node, init, awaitAt);
+ } else {
+ this.checkExpressionErrors(refExpressionErrors, true);
+ }
+
+ if (awaitAt > -1) {
+ this.unexpected(awaitAt);
+ }
+
+ return this.parseFor(node, init);
+ }
+
+ parseFunctionStatement(node, isAsync, declarationPosition) {
+ this.next();
+ return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), isAsync);
+ }
+
+ parseIfStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ node.consequent = this.parseStatement("if");
+ node.alternate = this.eat(types._else) ? this.parseStatement("if") : null;
+ return this.finishNode(node, "IfStatement");
+ }
+
+ parseReturnStatement(node) {
+ if (!this.prodParam.hasReturn && !this.options.allowReturnOutsideFunction) {
+ this.raise(this.state.start, "'return' outside of function");
+ }
+
+ this.next();
+
+ if (this.isLineTerminator()) {
+ node.argument = null;
+ } else {
+ node.argument = this.parseExpression();
+ this.semicolon();
+ }
+
+ return this.finishNode(node, "ReturnStatement");
+ }
+
+ parseSwitchStatement(node) {
+ this.next();
+ node.discriminant = this.parseHeaderExpression();
+ const cases = node.cases = [];
+ this.expect(types.braceL);
+ this.state.labels.push(switchLabel);
+ this.scope.enter(SCOPE_OTHER);
+ let cur;
+
+ for (let sawDefault; !this.match(types.braceR);) {
+ if (this.match(types._case) || this.match(types._default)) {
+ const isCase = this.match(types._case);
+ if (cur) this.finishNode(cur, "SwitchCase");
+ cases.push(cur = this.startNode());
+ cur.consequent = [];
+ this.next();
+
+ if (isCase) {
+ cur.test = this.parseExpression();
+ } else {
+ if (sawDefault) {
+ this.raise(this.state.lastTokStart, "Multiple default clauses");
+ }
+
+ sawDefault = true;
+ cur.test = null;
+ }
+
+ this.expect(types.colon);
+ } else {
+ if (cur) {
+ cur.consequent.push(this.parseStatement(null));
+ } else {
+ this.unexpected();
+ }
+ }
+ }
+
+ this.scope.exit();
+ if (cur) this.finishNode(cur, "SwitchCase");
+ this.next();
+ this.state.labels.pop();
+ return this.finishNode(node, "SwitchStatement");
+ }
+
+ parseThrowStatement(node) {
+ this.next();
+
+ if (lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) {
+ this.raise(this.state.lastTokEnd, "Illegal newline after throw");
+ }
+
+ node.argument = this.parseExpression();
+ this.semicolon();
+ return this.finishNode(node, "ThrowStatement");
+ }
+
+ parseTryStatement(node) {
+ this.next();
+ node.block = this.parseBlock();
+ node.handler = null;
+
+ if (this.match(types._catch)) {
+ const clause = this.startNode();
+ this.next();
+
+ if (this.match(types.parenL)) {
+ this.expect(types.parenL);
+ clause.param = this.parseBindingAtom();
+ const simple = clause.param.type === "Identifier";
+ this.scope.enter(simple ? SCOPE_SIMPLE_CATCH : 0);
+ this.checkLVal(clause.param, BIND_LEXICAL, null, "catch clause");
+ this.expect(types.parenR);
+ } else {
+ clause.param = null;
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ clause.body = this.withTopicForbiddingContext(() => this.parseBlock(false, false));
+ this.scope.exit();
+ node.handler = this.finishNode(clause, "CatchClause");
+ }
+
+ node.finalizer = this.eat(types._finally) ? this.parseBlock() : null;
+
+ if (!node.handler && !node.finalizer) {
+ this.raise(node.start, "Missing catch or finally clause");
+ }
+
+ return this.finishNode(node, "TryStatement");
+ }
+
+ parseVarStatement(node, kind) {
+ this.next();
+ this.parseVar(node, false, kind);
+ this.semicolon();
+ return this.finishNode(node, "VariableDeclaration");
+ }
+
+ parseWhileStatement(node) {
+ this.next();
+ node.test = this.parseHeaderExpression();
+ this.state.labels.push(loopLabel);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("while"));
+ this.state.labels.pop();
+ return this.finishNode(node, "WhileStatement");
+ }
+
+ parseWithStatement(node) {
+ if (this.state.strict) {
+ this.raise(this.state.start, "'with' in strict mode");
+ }
+
+ this.next();
+ node.object = this.parseHeaderExpression();
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("with"));
+ return this.finishNode(node, "WithStatement");
+ }
+
+ parseEmptyStatement(node) {
+ this.next();
+ return this.finishNode(node, "EmptyStatement");
+ }
+
+ parseLabeledStatement(node, maybeName, expr, context) {
+ for (let _i2 = 0, _this$state$labels = this.state.labels; _i2 < _this$state$labels.length; _i2++) {
+ const label = _this$state$labels[_i2];
+
+ if (label.name === maybeName) {
+ this.raise(expr.start, `Label '${maybeName}' is already declared`);
+ }
+ }
+
+ const kind = this.state.type.isLoop ? "loop" : this.match(types._switch) ? "switch" : null;
+
+ for (let i = this.state.labels.length - 1; i >= 0; i--) {
+ const label = this.state.labels[i];
+
+ if (label.statementStart === node.start) {
+ label.statementStart = this.state.start;
+ label.kind = kind;
+ } else {
+ break;
+ }
+ }
+
+ this.state.labels.push({
+ name: maybeName,
+ kind: kind,
+ statementStart: this.state.start
+ });
+ node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
+ this.state.labels.pop();
+ node.label = expr;
+ return this.finishNode(node, "LabeledStatement");
+ }
+
+ parseExpressionStatement(node, expr) {
+ node.expression = expr;
+ this.semicolon();
+ return this.finishNode(node, "ExpressionStatement");
+ }
+
+ parseBlock(allowDirectives = false, createNewLexicalScope = true) {
+ const node = this.startNode();
+ this.expect(types.braceL);
+
+ if (createNewLexicalScope) {
+ this.scope.enter(SCOPE_OTHER);
+ }
+
+ this.parseBlockBody(node, allowDirectives, false, types.braceR);
+
+ if (createNewLexicalScope) {
+ this.scope.exit();
+ }
+
+ return this.finishNode(node, "BlockStatement");
+ }
+
+ isValidDirective(stmt) {
+ return stmt.type === "ExpressionStatement" && stmt.expression.type === "StringLiteral" && !stmt.expression.extra.parenthesized;
+ }
+
+ parseBlockBody(node, allowDirectives, topLevel, end) {
+ const body = node.body = [];
+ const directives = node.directives = [];
+ this.parseBlockOrModuleBlockBody(body, allowDirectives ? directives : undefined, topLevel, end);
+ }
+
+ parseBlockOrModuleBlockBody(body, directives, topLevel, end) {
+ let parsedNonDirective = false;
+ let oldStrict;
+ let octalPosition;
+
+ while (!this.eat(end)) {
+ if (!parsedNonDirective && this.state.containsOctal && !octalPosition) {
+ octalPosition = this.state.octalPosition;
+ }
+
+ const stmt = this.parseStatement(null, topLevel);
+
+ if (directives && !parsedNonDirective && this.isValidDirective(stmt)) {
+ const directive = this.stmtToDirective(stmt);
+ directives.push(directive);
+
+ if (oldStrict === undefined && directive.value.value === "use strict") {
+ oldStrict = this.state.strict;
+ this.setStrict(true);
+
+ if (octalPosition) {
+ this.raise(octalPosition, "Octal literal in strict mode");
+ }
+ }
+
+ continue;
+ }
+
+ parsedNonDirective = true;
+ body.push(stmt);
+ }
+
+ if (oldStrict === false) {
+ this.setStrict(false);
+ }
+ }
+
+ parseFor(node, init) {
+ node.init = init;
+ this.expect(types.semi);
+ node.test = this.match(types.semi) ? null : this.parseExpression();
+ this.expect(types.semi);
+ node.update = this.match(types.parenR) ? null : this.parseExpression();
+ this.expect(types.parenR);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, "ForStatement");
+ }
+
+ parseForIn(node, init, awaitAt) {
+ const isForIn = this.match(types._in);
+ this.next();
+
+ if (isForIn) {
+ if (awaitAt > -1) this.unexpected(awaitAt);
+ } else {
+ node.await = awaitAt > -1;
+ }
+
+ if (init.type === "VariableDeclaration" && init.declarations[0].init != null && (!isForIn || this.state.strict || init.kind !== "var" || init.declarations[0].id.type !== "Identifier")) {
+ this.raise(init.start, `${isForIn ? "for-in" : "for-of"} loop variable declaration may not have an initializer`);
+ } else if (init.type === "AssignmentPattern") {
+ this.raise(init.start, "Invalid left-hand side in for-loop");
+ }
+
+ node.left = init;
+ node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
+ this.expect(types.parenR);
+ node.body = this.withTopicForbiddingContext(() => this.parseStatement("for"));
+ this.scope.exit();
+ this.state.labels.pop();
+ return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement");
+ }
+
+ parseVar(node, isFor, kind) {
+ const declarations = node.declarations = [];
+ const isTypescript = this.hasPlugin("typescript");
+ node.kind = kind;
+
+ for (;;) {
+ const decl = this.startNode();
+ this.parseVarId(decl, kind);
+
+ if (this.eat(types.eq)) {
+ decl.init = this.parseMaybeAssign(isFor);
+ } else {
+ if (kind === "const" && !(this.match(types._in) || this.isContextual("of"))) {
+ if (!isTypescript) {
+ this.unexpected();
+ }
+ } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(types._in) || this.isContextual("of")))) {
+ this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value");
+ }
+
+ decl.init = null;
+ }
+
+ declarations.push(this.finishNode(decl, "VariableDeclarator"));
+ if (!this.eat(types.comma)) break;
+ }
+
+ return node;
+ }
+
+ parseVarId(decl, kind) {
+ decl.id = this.parseBindingAtom();
+ this.checkLVal(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, "variable declaration", kind !== "var");
+ }
+
+ parseFunction(node, statement = FUNC_NO_FLAGS, isAsync = false) {
+ const isStatement = statement & FUNC_STATEMENT;
+ const isHangingStatement = statement & FUNC_HANGING_STATEMENT;
+ const requireId = !!isStatement && !(statement & FUNC_NULLABLE_ID);
+ this.initFunction(node, isAsync);
+
+ if (this.match(types.star) && isHangingStatement) {
+ this.raise(this.state.start, "Generators can only be declared at the top level or inside a block");
+ }
+
+ node.generator = this.eat(types.star);
+
+ if (isStatement) {
+ node.id = this.parseFunctionId(requireId);
+ }
+
+ const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;
+ const oldYieldPos = this.state.yieldPos;
+ const oldAwaitPos = this.state.awaitPos;
+ this.state.maybeInArrowParameters = false;
+ this.state.yieldPos = -1;
+ this.state.awaitPos = -1;
+ this.scope.enter(SCOPE_FUNCTION);
+ this.prodParam.enter(functionFlags(isAsync, node.generator));
+
+ if (!isStatement) {
+ node.id = this.parseFunctionId();
+ }
+
+ this.parseFunctionParams(node);
+ this.withTopicForbiddingContext(() => {
+ this.parseFunctionBodyAndFinish(node, isStatement ? "FunctionDeclaration" : "FunctionExpression");
+ });
+ this.prodParam.exit();
+ this.scope.exit();
+
+ if (isStatement && !isHangingStatement) {
+ this.registerFunctionStatementId(node);
+ }
+
+ this.state.maybeInArrowParameters = oldMaybeInArrowParameters;
+ this.state.yieldPos = oldYieldPos;
+ this.state.awaitPos = oldAwaitPos;
+ return node;
+ }
+
+ parseFunctionId(requireId) {
+ return requireId || this.match(types.name) ? this.parseIdentifier() : null;
+ }
+
+ parseFunctionParams(node, allowModifiers) {
+ const oldInParameters = this.state.inParameters;
+ this.state.inParameters = true;
+ this.expect(types.parenL);
+ node.params = this.parseBindingList(types.parenR, 41, false, allowModifiers);
+ this.state.inParameters = oldInParameters;
+ this.checkYieldAwaitInDefaultParams();
+ }
+
+ registerFunctionStatementId(node) {
+ if (!node.id) return;
+ this.scope.declareName(node.id.name, this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION, node.id.start);
+ }
+
+ parseClass(node, isStatement, optionalId) {
+ this.next();
+ this.takeDecorators(node);
+ const oldStrict = this.state.strict;
+ this.state.strict = true;
+ this.parseClassId(node, isStatement, optionalId);
+ this.parseClassSuper(node);
+ node.body = this.parseClassBody(!!node.superClass);
+ this.state.strict = oldStrict;
+ return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression");
+ }
+
+ isClassProperty() {
+ return this.match(types.eq) || this.match(types.semi) || this.match(types.braceR);
+ }
+
+ isClassMethod() {
+ return this.match(types.parenL);
+ }
+
+ isNonstaticConstructor(method) {
+ return !method.computed && !method.static && (method.key.name === "constructor" || method.key.value === "constructor");
+ }
+
+ parseClassBody(constructorAllowsSuper) {
+ this.classScope.enter();
+ const state = {
+ hadConstructor: false
+ };
+ let decorators = [];
+ const classBody = this.startNode();
+ classBody.body = [];
+ this.expect(types.braceL);
+ this.withTopicForbiddingContext(() => {
+ while (!this.eat(types.braceR)) {
+ if (this.eat(types.semi)) {
+ if (decorators.length > 0) {
+ throw this.raise(this.state.lastTokEnd, "Decorators must not be followed by a semicolon");
+ }
+
+ continue;
+ }
+
+ if (this.match(types.at)) {
+ decorators.push(this.parseDecorator());
+ continue;
+ }
+
+ const member = this.startNode();
+
+ if (decorators.length) {
+ member.decorators = decorators;
+ this.resetStartLocationFromNode(member, decorators[0]);
+ decorators = [];
+ }
+
+ this.parseClassMember(classBody, member, state, constructorAllowsSuper);
+
+ if (member.kind === "constructor" && member.decorators && member.decorators.length > 0) {
+ this.raise(member.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?");
+ }
+ }
+ });
+
+ if (decorators.length) {
+ throw this.raise(this.state.start, "You have trailing decorators with no method");
+ }
+
+ this.classScope.exit();
+ return this.finishNode(classBody, "ClassBody");
+ }
+
+ parseClassMember(classBody, member, state, constructorAllowsSuper) {
+ let isStatic = false;
+ const containsEsc = this.state.containsEsc;
+
+ if (this.match(types.name) && this.state.value === "static") {
+ const key = this.parseIdentifier(true);
+
+ if (this.isClassMethod()) {
+ const method = member;
+ method.kind = "method";
+ method.computed = false;
+ method.key = key;
+ method.static = false;
+ this.pushClassMethod(classBody, method, false, false, false, false);
+ return;
+ } else if (this.isClassProperty()) {
+ const prop = member;
+ prop.computed = false;
+ prop.key = key;
+ prop.static = false;
+ classBody.body.push(this.parseClassProperty(prop));
+ return;
+ } else if (containsEsc) {
+ throw this.unexpected();
+ }
+
+ isStatic = true;
+ }
+
+ this.parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper);
+ }
+
+ parseClassMemberWithIsStatic(classBody, member, state, isStatic, constructorAllowsSuper) {
+ const publicMethod = member;
+ const privateMethod = member;
+ const publicProp = member;
+ const privateProp = member;
+ const method = publicMethod;
+ const publicMember = publicMethod;
+ member.static = isStatic;
+
+ if (this.eat(types.star)) {
+ method.kind = "method";
+ this.parseClassPropertyName(method);
+
+ if (method.key.type === "PrivateName") {
+ this.pushClassPrivateMethod(classBody, privateMethod, true, false);
+ return;
+ }
+
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, "Constructor can't be a generator");
+ }
+
+ this.pushClassMethod(classBody, publicMethod, true, false, false, false);
+ return;
+ }
+
+ const containsEsc = this.state.containsEsc;
+ const key = this.parseClassPropertyName(member);
+ const isPrivate = key.type === "PrivateName";
+ const isSimple = key.type === "Identifier";
+ const maybeQuestionTokenStart = this.state.start;
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (this.isClassMethod()) {
+ method.kind = "method";
+
+ if (isPrivate) {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ return;
+ }
+
+ const isConstructor = this.isNonstaticConstructor(publicMethod);
+ let allowsDirectSuper = false;
+
+ if (isConstructor) {
+ publicMethod.kind = "constructor";
+
+ if (state.hadConstructor && !this.hasPlugin("typescript")) {
+ this.raise(key.start, "Duplicate constructor in the same class");
+ }
+
+ state.hadConstructor = true;
+ allowsDirectSuper = constructorAllowsSuper;
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, isConstructor, allowsDirectSuper);
+ } else if (this.isClassProperty()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else if (isSimple && key.name === "async" && !containsEsc && !this.isLineTerminator()) {
+ const isGenerator = this.eat(types.star);
+
+ if (publicMember.optional) {
+ this.unexpected(maybeQuestionTokenStart);
+ }
+
+ method.kind = "method";
+ this.parseClassPropertyName(method);
+ this.parsePostMemberNameModifiers(publicMember);
+
+ if (method.key.type === "PrivateName") {
+ this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, "Constructor can't be an async function");
+ }
+
+ this.pushClassMethod(classBody, publicMethod, isGenerator, true, false, false);
+ }
+ } else if (isSimple && (key.name === "get" || key.name === "set") && !containsEsc && !(this.match(types.star) && this.isLineTerminator())) {
+ method.kind = key.name;
+ this.parseClassPropertyName(publicMethod);
+
+ if (method.key.type === "PrivateName") {
+ this.pushClassPrivateMethod(classBody, privateMethod, false, false);
+ } else {
+ if (this.isNonstaticConstructor(publicMethod)) {
+ this.raise(publicMethod.key.start, "Constructor can't have get/set modifier");
+ }
+
+ this.pushClassMethod(classBody, publicMethod, false, false, false, false);
+ }
+
+ this.checkGetterSetterParams(publicMethod);
+ } else if (this.isLineTerminator()) {
+ if (isPrivate) {
+ this.pushClassPrivateProperty(classBody, privateProp);
+ } else {
+ this.pushClassProperty(classBody, publicProp);
+ }
+ } else {
+ this.unexpected();
+ }
+ }
+
+ parseClassPropertyName(member) {
+ const key = this.parsePropertyName(member, true);
+
+ if (!member.computed && member.static && (key.name === "prototype" || key.value === "prototype")) {
+ this.raise(key.start, "Classes may not have static property named prototype");
+ }
+
+ if (key.type === "PrivateName" && key.id.name === "constructor") {
+ this.raise(key.start, "Classes may not have a private field named '#constructor'");
+ }
+
+ return key;
+ }
+
+ pushClassProperty(classBody, prop) {
+ if (!prop.computed && (prop.key.name === "constructor" || prop.key.value === "constructor")) {
+ this.raise(prop.key.start, "Classes may not have a field named 'constructor'");
+ }
+
+ classBody.body.push(this.parseClassProperty(prop));
+ }
+
+ pushClassPrivateProperty(classBody, prop) {
+ this.expectPlugin("classPrivateProperties", prop.key.start);
+ const node = this.parseClassPrivateProperty(prop);
+ classBody.body.push(node);
+ this.classScope.declarePrivateName(node.key.id.name, CLASS_ELEMENT_OTHER, node.key.start);
+ }
+
+ pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
+ classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
+ }
+
+ pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
+ this.expectPlugin("classPrivateMethods", method.key.start);
+ const node = this.parseMethod(method, isGenerator, isAsync, false, false, "ClassPrivateMethod", true);
+ classBody.body.push(node);
+ const kind = node.kind === "get" ? node.static ? CLASS_ELEMENT_STATIC_GETTER : CLASS_ELEMENT_INSTANCE_GETTER : node.kind === "set" ? node.static ? CLASS_ELEMENT_STATIC_SETTER : CLASS_ELEMENT_INSTANCE_SETTER : CLASS_ELEMENT_OTHER;
+ this.classScope.declarePrivateName(node.key.id.name, kind, node.key.start);
+ }
+
+ parsePostMemberNameModifiers(methodOrProp) {}
+
+ parseAccessModifier() {
+ return undefined;
+ }
+
+ parseClassPrivateProperty(node) {
+ this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
+ this.prodParam.enter(PARAM);
+ node.value = this.eat(types.eq) ? this.parseMaybeAssign() : null;
+ this.semicolon();
+ this.prodParam.exit();
+ this.scope.exit();
+ return this.finishNode(node, "ClassPrivateProperty");
+ }
+
+ parseClassProperty(node) {
+ if (!node.typeAnnotation) {
+ this.expectPlugin("classProperties");
+ }
+
+ this.scope.enter(SCOPE_CLASS | SCOPE_SUPER);
+ this.prodParam.enter(PARAM);
+
+ if (this.match(types.eq)) {
+ this.expectPlugin("classProperties");
+ this.next();
+ node.value = this.parseMaybeAssign();
+ } else {
+ node.value = null;
+ }
+
+ this.semicolon();
+ this.prodParam.exit();
+ this.scope.exit();
+ return this.finishNode(node, "ClassProperty");
+ }
+
+ parseClassId(node, isStatement, optionalId, bindingType = BIND_CLASS) {
+ if (this.match(types.name)) {
+ node.id = this.parseIdentifier();
+
+ if (isStatement) {
+ this.checkLVal(node.id, bindingType, undefined, "class name");
+ }
+ } else {
+ if (optionalId || !isStatement) {
+ node.id = null;
+ } else {
+ this.unexpected(null, "A class name is required");
+ }
+ }
+ }
+
+ parseClassSuper(node) {
+ node.superClass = this.eat(types._extends) ? this.parseExprSubscripts() : null;
+ }
+
+ parseExport(node) {
+ const hasDefault = this.maybeParseExportDefaultSpecifier(node);
+ const parseAfterDefault = !hasDefault || this.eat(types.comma);
+ const hasStar = parseAfterDefault && this.eatExportStar(node);
+ const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
+ const parseAfterNamespace = parseAfterDefault && (!hasNamespace || this.eat(types.comma));
+ const isFromRequired = hasDefault || hasStar;
+
+ if (hasStar && !hasNamespace) {
+ if (hasDefault) this.unexpected();
+ this.parseExportFrom(node, true);
+ return this.finishNode(node, "ExportAllDeclaration");
+ }
+
+ const hasSpecifiers = this.maybeParseExportNamedSpecifiers(node);
+
+ if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers || hasNamespace && parseAfterNamespace && !hasSpecifiers) {
+ throw this.unexpected(null, types.braceL);
+ }
+
+ let hasDeclaration;
+
+ if (isFromRequired || hasSpecifiers) {
+ hasDeclaration = false;
+ this.parseExportFrom(node, isFromRequired);
+ } else {
+ hasDeclaration = this.maybeParseExportDeclaration(node);
+ }
+
+ if (isFromRequired || hasSpecifiers || hasDeclaration) {
+ this.checkExport(node, true, false, !!node.source);
+ return this.finishNode(node, "ExportNamedDeclaration");
+ }
+
+ if (this.eat(types._default)) {
+ node.declaration = this.parseExportDefaultExpression();
+ this.checkExport(node, true, true);
+ return this.finishNode(node, "ExportDefaultDeclaration");
+ }
+
+ throw this.unexpected(null, types.braceL);
+ }
+
+ eatExportStar(node) {
+ return this.eat(types.star);
+ }
+
+ maybeParseExportDefaultSpecifier(node) {
+ if (this.isExportDefaultSpecifier()) {
+ this.expectPlugin("exportDefaultFrom");
+ const specifier = this.startNode();
+ specifier.exported = this.parseIdentifier(true);
+ node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")];
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamespaceSpecifier(node) {
+ if (this.isContextual("as")) {
+ if (!node.specifiers) node.specifiers = [];
+ const specifier = this.startNodeAt(this.state.lastTokStart, this.state.lastTokStartLoc);
+ this.next();
+ specifier.exported = this.parseIdentifier(true);
+ node.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportNamedSpecifiers(node) {
+ if (this.match(types.braceL)) {
+ if (!node.specifiers) node.specifiers = [];
+ node.specifiers.push(...this.parseExportSpecifiers());
+ node.source = null;
+ node.declaration = null;
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseExportDeclaration(node) {
+ if (this.shouldParseExportDeclaration()) {
+ if (this.isContextual("async")) {
+ const next = this.nextTokenStart();
+
+ if (!this.isUnparsedContextual(next, "function")) {
+ this.unexpected(next, `Unexpected token, expected "function"`);
+ }
+ }
+
+ node.specifiers = [];
+ node.source = null;
+ node.declaration = this.parseExportDeclaration(node);
+ return true;
+ }
+
+ return false;
+ }
+
+ isAsyncFunction() {
+ if (!this.isContextual("async")) return false;
+ const next = this.nextTokenStart();
+ return !lineBreak.test(this.input.slice(this.state.pos, next)) && this.isUnparsedContextual(next, "function");
+ }
+
+ parseExportDefaultExpression() {
+ const expr = this.startNode();
+ const isAsync = this.isAsyncFunction();
+
+ if (this.match(types._function) || isAsync) {
+ this.next();
+
+ if (isAsync) {
+ this.next();
+ }
+
+ return this.parseFunction(expr, FUNC_STATEMENT | FUNC_NULLABLE_ID, isAsync);
+ } else if (this.match(types._class)) {
+ return this.parseClass(expr, true, true);
+ } else if (this.match(types.at)) {
+ if (this.hasPlugin("decorators") && this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.raise(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax");
+ }
+
+ this.parseDecorators(false);
+ return this.parseClass(expr, true, true);
+ } else if (this.match(types._const) || this.match(types._var) || this.isLet()) {
+ throw this.raise(this.state.start, "Only expressions, functions or classes are allowed as the `default` export.");
+ } else {
+ const res = this.parseMaybeAssign();
+ this.semicolon();
+ return res;
+ }
+ }
+
+ parseExportDeclaration(node) {
+ return this.parseStatement(null);
+ }
+
+ isExportDefaultSpecifier() {
+ if (this.match(types.name)) {
+ return this.state.value !== "async" && this.state.value !== "let";
+ }
+
+ if (!this.match(types._default)) {
+ return false;
+ }
+
+ const next = this.nextTokenStart();
+ return this.input.charCodeAt(next) === 44 || this.isUnparsedContextual(next, "from");
+ }
+
+ parseExportFrom(node, expect) {
+ if (this.eatContextual("from")) {
+ node.source = this.parseImportSource();
+ this.checkExport(node);
+ } else {
+ if (expect) {
+ this.unexpected();
+ } else {
+ node.source = null;
+ }
+ }
+
+ this.semicolon();
+ }
+
+ shouldParseExportDeclaration() {
+ if (this.match(types.at)) {
+ this.expectOnePlugin(["decorators", "decorators-legacy"]);
+
+ if (this.hasPlugin("decorators")) {
+ if (this.getPluginOption("decorators", "decoratorsBeforeExport")) {
+ this.unexpected(this.state.start, "Decorators must be placed *before* the 'export' keyword." + " You can set the 'decoratorsBeforeExport' option to false to use" + " the 'export @decorator class {}' syntax");
+ } else {
+ return true;
+ }
+ }
+ }
+
+ return this.state.type.keyword === "var" || this.state.type.keyword === "const" || this.state.type.keyword === "function" || this.state.type.keyword === "class" || this.isLet() || this.isAsyncFunction();
+ }
+
+ checkExport(node, checkNames, isDefault, isFrom) {
+ if (checkNames) {
+ if (isDefault) {
+ this.checkDuplicateExports(node, "default");
+ } else if (node.specifiers && node.specifiers.length) {
+ for (let _i3 = 0, _node$specifiers = node.specifiers; _i3 < _node$specifiers.length; _i3++) {
+ const specifier = _node$specifiers[_i3];
+ this.checkDuplicateExports(specifier, specifier.exported.name);
+
+ if (!isFrom && specifier.local) {
+ this.checkReservedWord(specifier.local.name, specifier.local.start, true, false);
+ this.scope.checkLocalExport(specifier.local);
+ }
+ }
+ } else if (node.declaration) {
+ if (node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration") {
+ const id = node.declaration.id;
+ if (!id) throw new Error("Assertion failure");
+ this.checkDuplicateExports(node, id.name);
+ } else if (node.declaration.type === "VariableDeclaration") {
+ for (let _i4 = 0, _node$declaration$dec = node.declaration.declarations; _i4 < _node$declaration$dec.length; _i4++) {
+ const declaration = _node$declaration$dec[_i4];
+ this.checkDeclaration(declaration.id);
+ }
+ }
+ }
+ }
+
+ const currentContextDecorators = this.state.decoratorStack[this.state.decoratorStack.length - 1];
+
+ if (currentContextDecorators.length) {
+ const isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression");
+
+ if (!node.declaration || !isClass) {
+ throw this.raise(node.start, "You can only use decorators on an export when exporting a class");
+ }
+
+ this.takeDecorators(node.declaration);
+ }
+ }
+
+ checkDeclaration(node) {
+ if (node.type === "Identifier") {
+ this.checkDuplicateExports(node, node.name);
+ } else if (node.type === "ObjectPattern") {
+ for (let _i5 = 0, _node$properties = node.properties; _i5 < _node$properties.length; _i5++) {
+ const prop = _node$properties[_i5];
+ this.checkDeclaration(prop);
+ }
+ } else if (node.type === "ArrayPattern") {
+ for (let _i6 = 0, _node$elements = node.elements; _i6 < _node$elements.length; _i6++) {
+ const elem = _node$elements[_i6];
+
+ if (elem) {
+ this.checkDeclaration(elem);
+ }
+ }
+ } else if (node.type === "ObjectProperty") {
+ this.checkDeclaration(node.value);
+ } else if (node.type === "RestElement") {
+ this.checkDeclaration(node.argument);
+ } else if (node.type === "AssignmentPattern") {
+ this.checkDeclaration(node.left);
+ }
+ }
+
+ checkDuplicateExports(node, name) {
+ if (this.state.exportedIdentifiers.indexOf(name) > -1) {
+ this.raise(node.start, name === "default" ? "Only one default export allowed per module." : `\`${name}\` has already been exported. Exported identifiers must be unique.`);
+ }
+
+ this.state.exportedIdentifiers.push(name);
+ }
+
+ parseExportSpecifiers() {
+ const nodes = [];
+ let first = true;
+ this.expect(types.braceL);
+
+ while (!this.eat(types.braceR)) {
+ if (first) {
+ first = false;
+ } else {
+ this.expect(types.comma);
+ if (this.eat(types.braceR)) break;
+ }
+
+ const node = this.startNode();
+ node.local = this.parseIdentifier(true);
+ node.exported = this.eatContextual("as") ? this.parseIdentifier(true) : node.local.__clone();
+ nodes.push(this.finishNode(node, "ExportSpecifier"));
+ }
+
+ return nodes;
+ }
+
+ parseImport(node) {
+ node.specifiers = [];
+
+ if (!this.match(types.string)) {
+ const hasDefault = this.maybeParseDefaultImportSpecifier(node);
+ const parseNext = !hasDefault || this.eat(types.comma);
+ const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
+ if (parseNext && !hasStar) this.parseNamedImportSpecifiers(node);
+ this.expectContextual("from");
+ }
+
+ node.source = this.parseImportSource();
+ this.semicolon();
+ return this.finishNode(node, "ImportDeclaration");
+ }
+
+ parseImportSource() {
+ if (!this.match(types.string)) this.unexpected();
+ return this.parseExprAtom();
+ }
+
+ shouldParseDefaultImport(node) {
+ return this.match(types.name);
+ }
+
+ parseImportSpecifierLocal(node, specifier, type, contextDescription) {
+ specifier.local = this.parseIdentifier();
+ this.checkLVal(specifier.local, BIND_LEXICAL, undefined, contextDescription);
+ node.specifiers.push(this.finishNode(specifier, type));
+ }
+
+ maybeParseDefaultImportSpecifier(node) {
+ if (this.shouldParseDefaultImport(node)) {
+ this.parseImportSpecifierLocal(node, this.startNode(), "ImportDefaultSpecifier", "default import specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ maybeParseStarImportSpecifier(node) {
+ if (this.match(types.star)) {
+ const specifier = this.startNode();
+ this.next();
+ this.expectContextual("as");
+ this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier", "import namespace specifier");
+ return true;
+ }
+
+ return false;
+ }
+
+ parseNamedImportSpecifiers(node) {
+ let first = true;
+ this.expect(types.braceL);
+
+ while (!this.eat(types.braceR)) {
+ if (first) {
+ first = false;
+ } else {
+ if (this.eat(types.colon)) {
+ throw this.raise(this.state.start, "ES2015 named imports do not destructure. " + "Use another statement for destructuring after the import.");
+ }
+
+ this.expect(types.comma);
+ if (this.eat(types.braceR)) break;
+ }
+
+ this.parseImportSpecifier(node);
+ }
+ }
+
+ parseImportSpecifier(node) {
+ const specifier = this.startNode();
+ specifier.imported = this.parseIdentifier(true);
+
+ if (this.eatContextual("as")) {
+ specifier.local = this.parseIdentifier();
+ } else {
+ this.checkReservedWord(specifier.imported.name, specifier.start, true, true);
+ specifier.local = specifier.imported.__clone();
+ }
+
+ this.checkLVal(specifier.local, BIND_LEXICAL, undefined, "import specifier");
+ node.specifiers.push(this.finishNode(specifier, "ImportSpecifier"));
+ }
+
+}
+
+class ClassScope {
+ constructor() {
+ this.privateNames = new Set();
+ this.loneAccessors = new Map();
+ this.undefinedPrivateNames = new Map();
+ }
+
+}
+class ClassScopeHandler {
+ constructor(raise) {
+ this.stack = [];
+ this.undefinedPrivateNames = new Map();
+ this.raise = raise;
+ }
+
+ current() {
+ return this.stack[this.stack.length - 1];
+ }
+
+ enter() {
+ this.stack.push(new ClassScope());
+ }
+
+ exit() {
+ const oldClassScope = this.stack.pop();
+ const current = this.current();
+
+ for (let _i = 0, _Array$from = Array.from(oldClassScope.undefinedPrivateNames); _i < _Array$from.length; _i++) {
+ const [name, pos] = _Array$from[_i];
+
+ if (current) {
+ if (!current.undefinedPrivateNames.has(name)) {
+ current.undefinedPrivateNames.set(name, pos);
+ }
+ } else {
+ this.raiseUndeclaredPrivateName(name, pos);
+ }
+ }
+ }
+
+ declarePrivateName(name, elementType, pos) {
+ const classScope = this.current();
+ let redefined = classScope.privateNames.has(name);
+
+ if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) {
+ const accessor = redefined && classScope.loneAccessors.get(name);
+
+ if (accessor) {
+ const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC;
+ const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC;
+ const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR;
+ const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR;
+ redefined = oldKind === newKind || oldStatic !== newStatic;
+ if (!redefined) classScope.loneAccessors.delete(name);
+ } else if (!redefined) {
+ classScope.loneAccessors.set(name, elementType);
+ }
+ }
+
+ if (redefined) {
+ this.raise(pos, `Duplicate private name #${name}`);
+ }
+
+ classScope.privateNames.add(name);
+ classScope.undefinedPrivateNames.delete(name);
+ }
+
+ usePrivateName(name, pos) {
+ let classScope;
+
+ for (let _i2 = 0, _this$stack = this.stack; _i2 < _this$stack.length; _i2++) {
+ classScope = _this$stack[_i2];
+ if (classScope.privateNames.has(name)) return;
+ }
+
+ if (classScope) {
+ classScope.undefinedPrivateNames.set(name, pos);
+ } else {
+ this.raiseUndeclaredPrivateName(name, pos);
+ }
+ }
+
+ raiseUndeclaredPrivateName(name, pos) {
+ this.raise(pos, `Private name #${name} is not defined`);
+ }
+
+}
+
+class Parser extends StatementParser {
+ constructor(options, input) {
+ options = getOptions(options);
+ super(options, input);
+ const ScopeHandler = this.getScopeHandler();
+ this.options = options;
+ this.inModule = this.options.sourceType === "module";
+ this.scope = new ScopeHandler(this.raise.bind(this), this.inModule);
+ this.prodParam = new ProductionParameterHandler();
+ this.classScope = new ClassScopeHandler(this.raise.bind(this));
+ this.plugins = pluginsMap(this.options.plugins);
+ this.filename = options.sourceFilename;
+ }
+
+ getScopeHandler() {
+ return ScopeHandler;
+ }
+
+ parse() {
+ let paramFlags = PARAM;
+
+ if (this.hasPlugin("topLevelAwait") && this.inModule) {
+ paramFlags |= PARAM_AWAIT;
+ }
+
+ this.scope.enter(SCOPE_PROGRAM);
+ this.prodParam.enter(paramFlags);
+ const file = this.startNode();
+ const program = this.startNode();
+ this.nextToken();
+ file.errors = null;
+ this.parseTopLevel(file, program);
+ file.errors = this.state.errors;
+ return file;
+ }
+
+}
+
+function pluginsMap(plugins) {
+ const pluginMap = new Map();
+
+ for (let _i = 0; _i < plugins.length; _i++) {
+ const plugin = plugins[_i];
+ const [name, options] = Array.isArray(plugin) ? plugin : [plugin, {}];
+ if (!pluginMap.has(name)) pluginMap.set(name, options || {});
+ }
+
+ return pluginMap;
+}
+
+function parse(input, options) {
+ if (options && options.sourceType === "unambiguous") {
+ options = Object.assign({}, options);
+
+ try {
+ options.sourceType = "module";
+ const parser = getParser(options, input);
+ const ast = parser.parse();
+
+ if (parser.sawUnambiguousESM) {
+ return ast;
+ }
+
+ if (parser.ambiguousScriptDifferentAst) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused) {}
+ } else {
+ ast.program.sourceType = "script";
+ }
+
+ return ast;
+ } catch (moduleError) {
+ try {
+ options.sourceType = "script";
+ return getParser(options, input).parse();
+ } catch (_unused2) {}
+
+ throw moduleError;
+ }
+ } else {
+ return getParser(options, input).parse();
+ }
+}
+function parseExpression(input, options) {
+ const parser = getParser(options, input);
+
+ if (parser.options.strictMode) {
+ parser.state.strict = true;
+ }
+
+ return parser.getExpression();
+}
+
+function getParser(options, input) {
+ let cls = Parser;
+
+ if (options && options.plugins) {
+ validatePlugins(options.plugins);
+ cls = getParserClass(options.plugins);
+ }
+
+ return new cls(options, input);
+}
+
+const parserClassCache = {};
+
+function getParserClass(pluginsFromOptions) {
+ const pluginList = mixinPluginNames.filter(name => hasPlugin(pluginsFromOptions, name));
+ const key = pluginList.join("/");
+ let cls = parserClassCache[key];
+
+ if (!cls) {
+ cls = Parser;
+
+ for (let _i = 0; _i < pluginList.length; _i++) {
+ const plugin = pluginList[_i];
+ cls = mixinPlugins[plugin](cls);
+ }
+
+ parserClassCache[key] = cls;
+ }
+
+ return cls;
+}
+
+exports.parse = parse;
+exports.parseExpression = parseExpression;
+exports.tokTypes = types;
+//# sourceMappingURL=index.js.map
diff --git a/Nodejs/node_modules/@babel/parser/lib/index.js.map b/Nodejs/node_modules/@babel/parser/lib/index.js.map
new file mode 100644
index 0000000..9f1eac8
--- /dev/null
+++ b/Nodejs/node_modules/@babel/parser/lib/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sources":["../src/tokenizer/types.js","../src/util/scopeflags.js","../src/plugins/estree.js","../src/util/whitespace.js","../src/tokenizer/context.js","../src/util/identifier.js","../src/plugins/flow.js","../src/plugins/jsx/xhtml.js","../src/plugins/jsx/index.js","../src/util/scope.js","../src/plugins/typescript/scope.js","../src/util/production-parameter.js","../src/plugins/typescript/index.js","../src/plugins/placeholders.js","../src/plugins/v8intrinsic.js","../src/plugin-utils.js","../src/options.js","../src/util/location.js","../src/parser/base.js","../src/parser/comments.js","../src/parser/location.js","../src/tokenizer/state.js","../src/tokenizer/index.js","../src/parser/util.js","../src/parser/node.js","../src/parser/lval.js","../src/parser/expression.js","../src/parser/statement.js","../src/util/class-scope.js","../src/parser/index.js","../src/index.js"],"sourcesContent":["// @flow\n\n// ## Token types\n\n// The assignment of fine-grained, information-carrying type objects\n// allows the tokenizer to store the information it has about a\n// token in a way that is very cheap for the parser to look up.\n\n// All token type variables start with an underscore, to make them\n// easy to recognize.\n\n// The `beforeExpr` property is used to disambiguate between regular\n// expressions and divisions. It is set on all token types that can\n// be followed by an expression (thus, a slash after them would be a\n// regular expression).\n\n// The `startsExpr` property is used to determine whether an expression\n// may be the “argument” subexpression of a `yield` expression or\n// `yield` statement. It is set on all token types that may be at the\n// start of a subexpression.\n\n// `isLoop` marks a keyword as starting a loop, which is important\n// to know when parsing a label, in order to allow or disallow\n// continue jumps to that label.\n\nconst beforeExpr = true;\nconst startsExpr = true;\nconst isLoop = true;\nconst isAssign = true;\nconst prefix = true;\nconst postfix = true;\n\ntype TokenOptions = {\n keyword?: string,\n beforeExpr?: boolean,\n startsExpr?: boolean,\n rightAssociative?: boolean,\n isLoop?: boolean,\n isAssign?: boolean,\n prefix?: boolean,\n postfix?: boolean,\n binop?: ?number,\n};\n\nexport class TokenType {\n label: string;\n keyword: ?string;\n beforeExpr: boolean;\n startsExpr: boolean;\n rightAssociative: boolean;\n isLoop: boolean;\n isAssign: boolean;\n prefix: boolean;\n postfix: boolean;\n binop: ?number;\n updateContext: ?(prevType: TokenType) => void;\n\n constructor(label: string, conf: TokenOptions = {}) {\n this.label = label;\n this.keyword = conf.keyword;\n this.beforeExpr = !!conf.beforeExpr;\n this.startsExpr = !!conf.startsExpr;\n this.rightAssociative = !!conf.rightAssociative;\n this.isLoop = !!conf.isLoop;\n this.isAssign = !!conf.isAssign;\n this.prefix = !!conf.prefix;\n this.postfix = !!conf.postfix;\n this.binop = conf.binop != null ? conf.binop : null;\n this.updateContext = null;\n }\n}\n\nexport const keywords = new Map();\n\nfunction createKeyword(name: string, options: TokenOptions = {}): TokenType {\n options.keyword = name;\n const token = new TokenType(name, options);\n keywords.set(name, token);\n return token;\n}\n\nfunction createBinop(name: string, binop: number) {\n return new TokenType(name, { beforeExpr, binop });\n}\n\nexport const types: { [name: string]: TokenType } = {\n num: new TokenType(\"num\", { startsExpr }),\n bigint: new TokenType(\"bigint\", { startsExpr }),\n regexp: new TokenType(\"regexp\", { startsExpr }),\n string: new TokenType(\"string\", { startsExpr }),\n name: new TokenType(\"name\", { startsExpr }),\n eof: new TokenType(\"eof\"),\n\n // Punctuation token types.\n bracketL: new TokenType(\"[\", { beforeExpr, startsExpr }),\n bracketR: new TokenType(\"]\"),\n braceL: new TokenType(\"{\", { beforeExpr, startsExpr }),\n braceBarL: new TokenType(\"{|\", { beforeExpr, startsExpr }),\n braceR: new TokenType(\"}\"),\n braceBarR: new TokenType(\"|}\"),\n parenL: new TokenType(\"(\", { beforeExpr, startsExpr }),\n parenR: new TokenType(\")\"),\n comma: new TokenType(\",\", { beforeExpr }),\n semi: new TokenType(\";\", { beforeExpr }),\n colon: new TokenType(\":\", { beforeExpr }),\n doubleColon: new TokenType(\"::\", { beforeExpr }),\n dot: new TokenType(\".\"),\n question: new TokenType(\"?\", { beforeExpr }),\n questionDot: new TokenType(\"?.\"),\n arrow: new TokenType(\"=>\", { beforeExpr }),\n template: new TokenType(\"template\"),\n ellipsis: new TokenType(\"...\", { beforeExpr }),\n backQuote: new TokenType(\"`\", { startsExpr }),\n dollarBraceL: new TokenType(\"${\", { beforeExpr, startsExpr }),\n at: new TokenType(\"@\"),\n hash: new TokenType(\"#\", { startsExpr }),\n\n // Special hashbang token.\n interpreterDirective: new TokenType(\"#!...\"),\n\n // Operators. These carry several kinds of properties to help the\n // parser use them properly (the presence of these properties is\n // what categorizes them as operators).\n //\n // `binop`, when present, specifies that this operator is a binary\n // operator, and will refer to its precedence.\n //\n // `prefix` and `postfix` mark the operator as a prefix or postfix\n // unary operator.\n //\n // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as\n // binary operators with a very low precedence, that should result\n // in AssignmentExpression nodes.\n\n eq: new TokenType(\"=\", { beforeExpr, isAssign }),\n assign: new TokenType(\"_=\", { beforeExpr, isAssign }),\n incDec: new TokenType(\"++/--\", { prefix, postfix, startsExpr }),\n bang: new TokenType(\"!\", { beforeExpr, prefix, startsExpr }),\n tilde: new TokenType(\"~\", { beforeExpr, prefix, startsExpr }),\n pipeline: createBinop(\"|>\", 0),\n nullishCoalescing: createBinop(\"??\", 1),\n logicalOR: createBinop(\"||\", 1),\n logicalAND: createBinop(\"&&\", 2),\n bitwiseOR: createBinop(\"|\", 3),\n bitwiseXOR: createBinop(\"^\", 4),\n bitwiseAND: createBinop(\"&\", 5),\n equality: createBinop(\"==/!=/===/!==\", 6),\n relational: createBinop(\">/<=/>=\", 7),\n bitShift: createBinop(\"<>>/>>>\", 8),\n plusMin: new TokenType(\"+/-\", { beforeExpr, binop: 9, prefix, startsExpr }),\n // startsExpr: required by v8intrinsic plugin\n modulo: new TokenType(\"%\", { beforeExpr, binop: 10, startsExpr }),\n star: createBinop(\"*\", 10),\n slash: createBinop(\"/\", 10),\n exponent: new TokenType(\"**\", {\n beforeExpr,\n binop: 11,\n rightAssociative: true,\n }),\n\n // Keywords\n _break: createKeyword(\"break\"),\n _case: createKeyword(\"case\", { beforeExpr }),\n _catch: createKeyword(\"catch\"),\n _continue: createKeyword(\"continue\"),\n _debugger: createKeyword(\"debugger\"),\n _default: createKeyword(\"default\", { beforeExpr }),\n _do: createKeyword(\"do\", { isLoop, beforeExpr }),\n _else: createKeyword(\"else\", { beforeExpr }),\n _finally: createKeyword(\"finally\"),\n _for: createKeyword(\"for\", { isLoop }),\n _function: createKeyword(\"function\", { startsExpr }),\n _if: createKeyword(\"if\"),\n _return: createKeyword(\"return\", { beforeExpr }),\n _switch: createKeyword(\"switch\"),\n _throw: createKeyword(\"throw\", { beforeExpr, prefix, startsExpr }),\n _try: createKeyword(\"try\"),\n _var: createKeyword(\"var\"),\n _const: createKeyword(\"const\"),\n _while: createKeyword(\"while\", { isLoop }),\n _with: createKeyword(\"with\"),\n _new: createKeyword(\"new\", { beforeExpr, startsExpr }),\n _this: createKeyword(\"this\", { startsExpr }),\n _super: createKeyword(\"super\", { startsExpr }),\n _class: createKeyword(\"class\", { startsExpr }),\n _extends: createKeyword(\"extends\", { beforeExpr }),\n _export: createKeyword(\"export\"),\n _import: createKeyword(\"import\", { startsExpr }),\n _null: createKeyword(\"null\", { startsExpr }),\n _true: createKeyword(\"true\", { startsExpr }),\n _false: createKeyword(\"false\", { startsExpr }),\n _in: createKeyword(\"in\", { beforeExpr, binop: 7 }),\n _instanceof: createKeyword(\"instanceof\", { beforeExpr, binop: 7 }),\n _typeof: createKeyword(\"typeof\", { beforeExpr, prefix, startsExpr }),\n _void: createKeyword(\"void\", { beforeExpr, prefix, startsExpr }),\n _delete: createKeyword(\"delete\", { beforeExpr, prefix, startsExpr }),\n};\n","// @flow\n\n// Each scope gets a bitset that may contain these flags\n// prettier-ignore\nexport const SCOPE_OTHER = 0b00000000,\n SCOPE_PROGRAM = 0b00000001,\n SCOPE_FUNCTION = 0b00000010,\n SCOPE_ARROW = 0b00000100,\n SCOPE_SIMPLE_CATCH = 0b00001000,\n SCOPE_SUPER = 0b00010000,\n SCOPE_DIRECT_SUPER = 0b00100000,\n SCOPE_CLASS = 0b01000000,\n SCOPE_TS_MODULE = 0b10000000,\n SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE;\n\nexport type ScopeFlags =\n | typeof SCOPE_OTHER\n | typeof SCOPE_PROGRAM\n | typeof SCOPE_FUNCTION\n | typeof SCOPE_VAR\n | typeof SCOPE_ARROW\n | typeof SCOPE_SIMPLE_CATCH\n | typeof SCOPE_SUPER\n | typeof SCOPE_DIRECT_SUPER\n | typeof SCOPE_CLASS;\n\n// These flags are meant to be _only_ used inside the Scope class (or subclasses).\n// prettier-ignore\nexport const BIND_KIND_VALUE = 0b00000_0000_01,\n BIND_KIND_TYPE = 0b00000_0000_10,\n // Used in checkLVal and declareName to determine the type of a binding\n BIND_SCOPE_VAR = 0b00000_0001_00, // Var-style binding\n BIND_SCOPE_LEXICAL = 0b00000_0010_00, // Let- or const-style binding\n BIND_SCOPE_FUNCTION = 0b00000_0100_00, // Function declaration\n BIND_SCOPE_OUTSIDE = 0b00000_1000_00, // Special case for function names as\n // bound inside the function\n // Misc flags\n BIND_FLAGS_NONE = 0b00001_0000_00,\n BIND_FLAGS_CLASS = 0b00010_0000_00,\n BIND_FLAGS_TS_ENUM = 0b00100_0000_00,\n BIND_FLAGS_TS_CONST_ENUM = 0b01000_0000_00,\n BIND_FLAGS_TS_EXPORT_ONLY = 0b10000_0000_00;\n\n// These flags are meant to be _only_ used by Scope consumers\n// prettier-ignore\n/* = is value? | is type? | scope | misc flags */\nexport const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_CLASS ,\n BIND_LEXICAL = BIND_KIND_VALUE | 0 | BIND_SCOPE_LEXICAL | 0 ,\n BIND_VAR = BIND_KIND_VALUE | 0 | BIND_SCOPE_VAR | 0 ,\n BIND_FUNCTION = BIND_KIND_VALUE | 0 | BIND_SCOPE_FUNCTION | 0 ,\n BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS ,\n BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 ,\n BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM,\n BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY,\n // These bindings don't introduce anything in the scope. They are used for assignments and\n // function expressions IDs.\n BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE ,\n BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE ,\n\n BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM,\n BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY;\n\nexport type BindingTypes =\n | typeof BIND_NONE\n | typeof BIND_OUTSIDE\n | typeof BIND_VAR\n | typeof BIND_LEXICAL\n | typeof BIND_CLASS\n | typeof BIND_FUNCTION\n | typeof BIND_TS_INTERFACE\n | typeof BIND_TS_TYPE\n | typeof BIND_TS_ENUM\n | typeof BIND_TS_AMBIENT\n | typeof BIND_TS_NAMESPACE;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_FLAG_STATIC = 0b1_00,\n CLASS_ELEMENT_KIND_GETTER = 0b0_10,\n CLASS_ELEMENT_KIND_SETTER = 0b0_01,\n CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER;\n\n// prettier-ignore\nexport const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC,\n CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER,\n CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER,\n CLASS_ELEMENT_OTHER = 0;\n\nexport type ClassElementTypes =\n | typeof CLASS_ELEMENT_STATIC_GETTER\n | typeof CLASS_ELEMENT_STATIC_SETTER\n | typeof CLASS_ELEMENT_INSTANCE_GETTER\n | typeof CLASS_ELEMENT_INSTANCE_SETTER\n | typeof CLASS_ELEMENT_OTHER;\n","// @flow\n\nimport { types as tt, TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport type { ExpressionErrors } from \"../parser/util\";\nimport * as N from \"../types\";\nimport type { Position } from \"../util/location\";\nimport { type BindingTypes, BIND_NONE } from \"../util/scopeflags\";\n\nfunction isSimpleProperty(node: N.Node): boolean {\n return (\n node != null &&\n node.type === \"Property\" &&\n node.kind === \"init\" &&\n node.method === false\n );\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n estreeParseRegExpLiteral({ pattern, flags }: N.RegExpLiteral): N.Node {\n let regex = null;\n try {\n regex = new RegExp(pattern, flags);\n } catch (e) {\n // In environments that don't support these flags value will\n // be null as the regex can't be represented natively.\n }\n const node = this.estreeParseLiteral(regex);\n node.regex = { pattern, flags };\n\n return node;\n }\n\n estreeParseBigIntLiteral(value: any): N.Node {\n // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral\n // $FlowIgnore\n const bigInt = typeof BigInt !== \"undefined\" ? BigInt(value) : null;\n const node = this.estreeParseLiteral(bigInt);\n node.bigint = String(node.value || value);\n\n return node;\n }\n\n estreeParseLiteral(value: any): N.Node {\n return this.parseLiteral(value, \"Literal\");\n }\n\n directiveToStmt(directive: N.Directive): N.ExpressionStatement {\n const directiveLiteral = directive.value;\n\n const stmt = this.startNodeAt(directive.start, directive.loc.start);\n const expression = this.startNodeAt(\n directiveLiteral.start,\n directiveLiteral.loc.start,\n );\n\n expression.value = directiveLiteral.value;\n expression.raw = directiveLiteral.extra.raw;\n\n stmt.expression = this.finishNodeAt(\n expression,\n \"Literal\",\n directiveLiteral.end,\n directiveLiteral.loc.end,\n );\n stmt.directive = directiveLiteral.extra.raw.slice(1, -1);\n\n return this.finishNodeAt(\n stmt,\n \"ExpressionStatement\",\n directive.end,\n directive.loc.end,\n );\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n initFunction(\n node: N.BodilessFunctionOrMethodBase,\n isAsync: ?boolean,\n ): void {\n super.initFunction(node, isAsync);\n node.expression = false;\n }\n\n checkDeclaration(node: N.Pattern | N.ObjectProperty): void {\n if (isSimpleProperty(node)) {\n this.checkDeclaration(((node: any): N.EstreeProperty).value);\n } else {\n super.checkDeclaration(node);\n }\n }\n\n checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void {\n const prop = ((method: any): N.EstreeProperty | N.EstreeMethodDefinition);\n const paramCount = prop.kind === \"get\" ? 0 : 1;\n const start = prop.start;\n if (prop.value.params.length !== paramCount) {\n if (prop.kind === \"get\") {\n this.raise(start, \"getter must not have any formal parameters\");\n } else {\n this.raise(start, \"setter must have exactly one formal parameter\");\n }\n } else if (\n prop.kind === \"set\" &&\n prop.value.params[0].type === \"RestElement\"\n ) {\n this.raise(\n start,\n \"setter function argument must not be a rest parameter\",\n );\n }\n }\n\n checkLVal(\n expr: N.Expression,\n bindingType: BindingTypes = BIND_NONE,\n checkClashes: ?{ [key: string]: boolean },\n contextDescription: string,\n disallowLetBinding?: boolean,\n ): void {\n switch (expr.type) {\n case \"ObjectPattern\":\n expr.properties.forEach(prop => {\n this.checkLVal(\n prop.type === \"Property\" ? prop.value : prop,\n bindingType,\n checkClashes,\n \"object destructuring pattern\",\n disallowLetBinding,\n );\n });\n break;\n default:\n super.checkLVal(\n expr,\n bindingType,\n checkClashes,\n contextDescription,\n disallowLetBinding,\n );\n }\n }\n\n checkDuplicatedProto(\n prop: N.ObjectMember | N.SpreadElement,\n protoRef: { used: boolean },\n refExpressionErrors: ?ExpressionErrors,\n ): void {\n if (\n prop.type === \"SpreadElement\" ||\n prop.computed ||\n prop.method ||\n // $FlowIgnore\n prop.shorthand\n ) {\n return;\n }\n\n const key = prop.key;\n // It is either an Identifier or a String/NumericLiteral\n const name = key.type === \"Identifier\" ? key.name : String(key.value);\n\n if (name === \"__proto__\" && prop.kind === \"init\") {\n // Store the first redefinition's position\n if (protoRef.used) {\n if (refExpressionErrors && refExpressionErrors.doubleProto === -1) {\n refExpressionErrors.doubleProto = key.start;\n } else {\n this.raise(key.start, \"Redefinition of __proto__ property\");\n }\n }\n\n protoRef.used = true;\n }\n }\n\n isValidDirective(stmt: N.Statement): boolean {\n return (\n stmt.type === \"ExpressionStatement\" &&\n stmt.expression.type === \"Literal\" &&\n typeof stmt.expression.value === \"string\" &&\n (!stmt.expression.extra || !stmt.expression.extra.parenthesized)\n );\n }\n\n stmtToDirective(stmt: N.Statement): N.Directive {\n const directive = super.stmtToDirective(stmt);\n const value = stmt.expression.value;\n\n // Reset value to the actual value as in estree mode we want\n // the stmt to have the real value and not the raw value\n directive.value.value = value;\n\n return directive;\n }\n\n parseBlockBody(\n node: N.BlockStatementLike,\n allowDirectives: ?boolean,\n topLevel: boolean,\n end: TokenType,\n ): void {\n super.parseBlockBody(node, allowDirectives, topLevel, end);\n\n const directiveStatements = node.directives.map(d =>\n this.directiveToStmt(d),\n );\n node.body = directiveStatements.concat(node.body);\n delete node.directives;\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n this.parseMethod(\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n \"ClassMethod\",\n true,\n );\n if (method.typeParameters) {\n // $FlowIgnore\n method.value.typeParameters = method.typeParameters;\n delete method.typeParameters;\n }\n classBody.body.push(method);\n }\n\n parseExprAtom(refExpressionErrors?: ?ExpressionErrors): N.Expression {\n switch (this.state.type) {\n case tt.num:\n case tt.string:\n return this.estreeParseLiteral(this.state.value);\n\n case tt.regexp:\n return this.estreeParseRegExpLiteral(this.state.value);\n\n case tt.bigint:\n return this.estreeParseBigIntLiteral(this.state.value);\n\n case tt._null:\n return this.estreeParseLiteral(null);\n\n case tt._true:\n return this.estreeParseLiteral(true);\n\n case tt._false:\n return this.estreeParseLiteral(false);\n\n default:\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n parseLiteral(\n value: any,\n type: /*T[\"kind\"]*/ string,\n startPos?: number,\n startLoc?: Position,\n ): T {\n const node = super.parseLiteral(value, type, startPos, startLoc);\n node.raw = node.extra.raw;\n delete node.extra;\n\n return node;\n }\n\n parseFunctionBody(\n node: N.Function,\n allowExpression: ?boolean,\n isMethod?: boolean = false,\n ): void {\n super.parseFunctionBody(node, allowExpression, isMethod);\n node.expression = node.body.type !== \"BlockStatement\";\n }\n\n parseMethod(\n node: T,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowDirectSuper: boolean,\n type: string,\n inClassScope: boolean = false,\n ): T {\n let funcNode = this.startNode();\n funcNode.kind = node.kind; // provide kind, so super method correctly sets state\n funcNode = super.parseMethod(\n funcNode,\n isGenerator,\n isAsync,\n isConstructor,\n allowDirectSuper,\n type,\n inClassScope,\n );\n funcNode.type = \"FunctionExpression\";\n delete funcNode.kind;\n // $FlowIgnore\n node.value = funcNode;\n\n type = type === \"ClassMethod\" ? \"MethodDefinition\" : type;\n return this.finishNode(node, type);\n }\n\n parseObjectMethod(\n prop: N.ObjectMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n containsEsc: boolean,\n ): ?N.ObjectMethod {\n const node: N.EstreeProperty = (super.parseObjectMethod(\n prop,\n isGenerator,\n isAsync,\n isPattern,\n containsEsc,\n ): any);\n\n if (node) {\n node.type = \"Property\";\n if (((node: any): N.ClassMethod).kind === \"method\") node.kind = \"init\";\n node.shorthand = false;\n }\n\n return (node: any);\n }\n\n parseObjectProperty(\n prop: N.ObjectProperty,\n startPos: ?number,\n startLoc: ?Position,\n isPattern: boolean,\n refExpressionErrors: ?ExpressionErrors,\n ): ?N.ObjectProperty {\n const node: N.EstreeProperty = (super.parseObjectProperty(\n prop,\n startPos,\n startLoc,\n isPattern,\n refExpressionErrors,\n ): any);\n\n if (node) {\n node.kind = \"init\";\n node.type = \"Property\";\n }\n\n return (node: any);\n }\n\n toAssignable(node: N.Node): N.Node {\n if (isSimpleProperty(node)) {\n this.toAssignable(node.value);\n\n return node;\n }\n\n return super.toAssignable(node);\n }\n\n toAssignableObjectExpressionProp(prop: N.Node, isLast: boolean) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n throw this.raise(\n prop.key.start,\n \"Object pattern can't contain getter or setter\",\n );\n } else if (prop.method) {\n throw this.raise(\n prop.key.start,\n \"Object pattern can't contain methods\",\n );\n } else {\n super.toAssignableObjectExpressionProp(prop, isLast);\n }\n }\n\n finishCallExpression(\n node: T,\n optional: boolean,\n ): N.Expression {\n super.finishCallExpression(node, optional);\n\n if (node.callee.type === \"Import\") {\n ((node: N.Node): N.EstreeImportExpression).type = \"ImportExpression\";\n ((node: N.Node): N.EstreeImportExpression).source = node.arguments[0];\n delete node.arguments;\n delete node.callee;\n }\n\n return node;\n }\n\n toReferencedListDeep(\n exprList: $ReadOnlyArray,\n isParenthesizedExpr?: boolean,\n ): void {\n // ImportExpressions do not have an arguments array.\n if (!exprList) {\n return;\n }\n\n super.toReferencedListDeep(exprList, isParenthesizedExpr);\n }\n };\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n?|[\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","// @flow\n\n// The algorithm used to determine whether a regexp can appear at a\n// given point in the program is loosely based on sweet.js' approach.\n// See https://github.com/mozilla/sweet.js/wiki/design\n\nimport { types as tt } from \"./types\";\nimport { lineBreak } from \"../util/whitespace\";\n\nexport class TokContext {\n constructor(\n token: string,\n isExpr?: boolean,\n preserveSpace?: boolean,\n override?: ?Function, // Takes a Tokenizer as a this-parameter, and returns void.\n ) {\n this.token = token;\n this.isExpr = !!isExpr;\n this.preserveSpace = !!preserveSpace;\n this.override = override;\n }\n\n token: string;\n isExpr: boolean;\n preserveSpace: boolean;\n override: ?Function;\n}\n\nexport const types: {\n [key: string]: TokContext,\n} = {\n braceStatement: new TokContext(\"{\", false),\n braceExpression: new TokContext(\"{\", true),\n templateQuasi: new TokContext(\"${\", false),\n parenStatement: new TokContext(\"(\", false),\n parenExpression: new TokContext(\"(\", true),\n template: new TokContext(\"`\", true, true, p => p.readTmplToken()),\n functionExpression: new TokContext(\"function\", true),\n functionStatement: new TokContext(\"function\", false),\n};\n\n// Token-specific context update code\n\ntt.parenR.updateContext = tt.braceR.updateContext = function() {\n if (this.state.context.length === 1) {\n this.state.exprAllowed = true;\n return;\n }\n\n let out = this.state.context.pop();\n if (out === types.braceStatement && this.curContext().token === \"function\") {\n out = this.state.context.pop();\n }\n\n this.state.exprAllowed = !out.isExpr;\n};\n\ntt.name.updateContext = function(prevType) {\n let allowed = false;\n if (prevType !== tt.dot) {\n if (\n (this.state.value === \"of\" && !this.state.exprAllowed) ||\n (this.state.value === \"yield\" && this.prodParam.hasYield)\n ) {\n allowed = true;\n }\n }\n this.state.exprAllowed = allowed;\n\n if (this.state.isIterator) {\n this.state.isIterator = false;\n }\n};\n\ntt.braceL.updateContext = function(prevType) {\n this.state.context.push(\n this.braceIsBlock(prevType) ? types.braceStatement : types.braceExpression,\n );\n this.state.exprAllowed = true;\n};\n\ntt.dollarBraceL.updateContext = function() {\n this.state.context.push(types.templateQuasi);\n this.state.exprAllowed = true;\n};\n\ntt.parenL.updateContext = function(prevType) {\n const statementParens =\n prevType === tt._if ||\n prevType === tt._for ||\n prevType === tt._with ||\n prevType === tt._while;\n this.state.context.push(\n statementParens ? types.parenStatement : types.parenExpression,\n );\n this.state.exprAllowed = true;\n};\n\ntt.incDec.updateContext = function() {\n // tokExprAllowed stays unchanged\n};\n\ntt._function.updateContext = tt._class.updateContext = function(prevType) {\n if (\n prevType.beforeExpr &&\n prevType !== tt.semi &&\n prevType !== tt._else &&\n !(\n prevType === tt._return &&\n lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))\n ) &&\n !(\n (prevType === tt.colon || prevType === tt.braceL) &&\n this.curContext() === types.b_stat\n )\n ) {\n this.state.context.push(types.functionExpression);\n } else {\n this.state.context.push(types.functionStatement);\n }\n\n this.state.exprAllowed = false;\n};\n\ntt.backQuote.updateContext = function() {\n if (this.curContext() === types.template) {\n this.state.context.pop();\n } else {\n this.state.context.push(types.template);\n }\n this.state.exprAllowed = false;\n};\n","/* eslint max-len: 0 */\n\n// @flow\n\nimport * as charCodes from \"charcodes\";\nimport { keywords } from \"../tokenizer/types\";\n\nconst reservedWords = {\n strict: [\n \"implements\",\n \"interface\",\n \"let\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"static\",\n \"yield\",\n ],\n strictBind: [\"eval\", \"arguments\"],\n};\n\nconst reservedWordsStrictSet = new Set(reservedWords.strict);\nconst reservedWordsStrictBindSet = new Set(reservedWords.strictBind);\n\n/**\n * Checks if word is a reserved word in non-strict mode\n */\nexport const isReservedWord = (word: string, inModule: boolean): boolean => {\n return (inModule && word === \"await\") || word === \"enum\";\n};\n\n/**\n * Checks if word is a reserved word in non-binding strict mode\n *\n * Includes non-strict reserved words\n */\nexport function isStrictReservedWord(word: string, inModule: boolean): boolean {\n return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode, but it is allowed as\n * a normal identifier.\n */\nexport function isStrictBindOnlyReservedWord(word: string): boolean {\n return reservedWordsStrictBindSet.has(word);\n}\n\n/**\n * Checks if word is a reserved word in binding strict mode\n *\n * Includes non-strict reserved words and non-binding strict reserved words\n */\nexport function isStrictBindReservedWord(\n word: string,\n inModule: boolean,\n): boolean {\n return (\n isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word)\n );\n}\n\nexport function isKeyword(word: string): boolean {\n return keywords.has(word);\n}\n\nexport const keywordRelationalOperator = /^in(stanceof)?$/;\n\n// ## Character categories\n\n// Big ugly regular expressions that match characters in the\n// whitespace, identifier, and identifier-start categories. These\n// are only applied when a character is found to actually have a\n// code point above 0x80.\n// Generated by `scripts/generate-identifier-regex.js`.\n\n/* prettier-ignore */\nlet nonASCIIidentifierStartChars = \"\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u08a0-\\u08b4\\u08b6-\\u08bd\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c88\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fef\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7bf\\ua7c2-\\ua7c6\\ua7f7-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab67\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc\";\n/* prettier-ignore */\nlet nonASCIIidentifierChars = \"\\u200c\\u200d\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u08d3-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1df9\\u1dfb-\\u1dff\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\";\n\nconst nonASCIIidentifierStart = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + \"]\",\n);\nconst nonASCIIidentifier = new RegExp(\n \"[\" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + \"]\",\n);\n\nnonASCIIidentifierStartChars = nonASCIIidentifierChars = null;\n\n// These are a run-length and offset-encoded representation of the\n// >0xffff code points that are a valid part of identifiers. The\n// offset starts at 0x10000, and each pair of numbers represents an\n// offset to the next range, and then a size of the range. They were\n// generated by `scripts/generate-identifier-regex.js`.\n/* prettier-ignore */\nconst astralIdentifierStartCodes = [0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,157,310,10,21,11,7,153,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,477,28,11,0,9,21,155,22,13,52,76,44,33,24,27,35,30,0,12,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,85,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,0,33,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,230,43,117,63,32,0,161,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,35,56,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,270,921,103,110,18,195,2749,1070,4050,582,8634,568,8,30,114,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,754,9486,286,50,2,18,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,2357,44,11,6,17,0,370,43,1301,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42710,42,4148,12,221,3,5761,15,7472,3104,541];\n/* prettier-ignore */\nconst astralIdentifierCodes = [509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,525,10,176,2,54,14,32,9,16,3,46,10,54,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,4,9,83,11,7,0,161,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,232,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,19306,9,135,4,60,6,26,9,1014,0,2,54,8,3,19723,1,5319,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,262,6,10,9,419,13,1495,6,110,6,6,9,792487,239];\n\n// This has a complexity linear to the value of the code. The\n// assumption is that looking up astral identifier characters is\n// rare.\nfunction isInAstralSet(code: number, set: $ReadOnlyArray): boolean {\n let pos = 0x10000;\n for (let i = 0, length = set.length; i < length; i += 2) {\n pos += set[i];\n if (pos > code) return false;\n\n pos += set[i + 1];\n if (pos >= code) return true;\n }\n return false;\n}\n\n// Test whether a given character code starts an identifier.\n\nexport function isIdentifierStart(code: number): boolean {\n if (code < charCodes.uppercaseA) return code === charCodes.dollarSign;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return (\n code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code))\n );\n }\n return isInAstralSet(code, astralIdentifierStartCodes);\n}\n\n// Test whether a current state character code and next character code is @\n\nexport function isIteratorStart(current: number, next: number): boolean {\n return current === charCodes.atSign && next === charCodes.atSign;\n}\n\n// Test whether a given character is part of an identifier.\n\nexport function isIdentifierChar(code: number): boolean {\n if (code < charCodes.digit0) return code === charCodes.dollarSign;\n if (code < charCodes.colon) return true;\n if (code < charCodes.uppercaseA) return false;\n if (code <= charCodes.uppercaseZ) return true;\n if (code < charCodes.lowercaseA) return code === charCodes.underscore;\n if (code <= charCodes.lowercaseZ) return true;\n if (code <= 0xffff) {\n return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));\n }\n return (\n isInAstralSet(code, astralIdentifierStartCodes) ||\n isInAstralSet(code, astralIdentifierCodes)\n );\n}\n","// @flow\n\n/*:: declare var invariant; */\n\nimport type Parser from \"../parser\";\nimport { types as tt, type TokenType } from \"../tokenizer/types\";\nimport * as N from \"../types\";\nimport type { Options } from \"../options\";\nimport type { Pos, Position } from \"../util/location\";\nimport type State from \"../tokenizer/state\";\nimport { types as tc } from \"../tokenizer/context\";\nimport * as charCodes from \"charcodes\";\nimport { isIteratorStart } from \"../util/identifier\";\nimport {\n type BindingTypes,\n BIND_NONE,\n BIND_LEXICAL,\n BIND_VAR,\n BIND_FUNCTION,\n SCOPE_ARROW,\n SCOPE_FUNCTION,\n SCOPE_OTHER,\n} from \"../util/scopeflags\";\nimport type { ExpressionErrors } from \"../parser/util\";\n\nconst reservedTypes = new Set([\n \"_\",\n \"any\",\n \"bool\",\n \"boolean\",\n \"empty\",\n \"extends\",\n \"false\",\n \"interface\",\n \"mixed\",\n \"null\",\n \"number\",\n \"static\",\n \"string\",\n \"true\",\n \"typeof\",\n \"void\",\n]);\n\nfunction isEsModuleType(bodyElement: N.Node): boolean {\n return (\n bodyElement.type === \"DeclareExportAllDeclaration\" ||\n (bodyElement.type === \"DeclareExportDeclaration\" &&\n (!bodyElement.declaration ||\n (bodyElement.declaration.type !== \"TypeAlias\" &&\n bodyElement.declaration.type !== \"InterfaceDeclaration\")))\n );\n}\n\nfunction hasTypeImportKind(node: N.Node): boolean {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n}\n\nfunction isMaybeDefaultImport(state: State): boolean {\n return (\n (state.type === tt.name || !!state.type.keyword) && state.value !== \"from\"\n );\n}\n\nconst exportSuggestions = {\n const: \"declare export var\",\n let: \"declare export var\",\n type: \"export type\",\n interface: \"export interface\",\n};\n\n// Like Array#filter, but returns a tuple [ acceptedElements, discardedElements ]\nfunction partition(\n list: T[],\n test: (T, number, T[]) => ?boolean,\n): [T[], T[]] {\n const list1 = [];\n const list2 = [];\n for (let i = 0; i < list.length; i++) {\n (test(list[i], i, list) ? list1 : list2).push(list[i]);\n }\n return [list1, list2];\n}\n\nconst FLOW_PRAGMA_REGEX = /\\*?\\s*@((?:no)?flow)\\b/;\n\n// Flow enums types\ntype EnumExplicitType = null | \"boolean\" | \"number\" | \"string\" | \"symbol\";\ntype EnumContext = {|\n enumName: string,\n explicitType: EnumExplicitType,\n memberName: string,\n|};\ntype EnumMemberInit =\n | {| type: \"number\", pos: number, value: N.Node |}\n | {| type: \"string\", pos: number, value: N.Node |}\n | {| type: \"boolean\", pos: number, value: N.Node |}\n | {| type: \"invalid\", pos: number |}\n | {| type: \"none\", pos: number |};\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n // The value of the @flow/@noflow pragma. Initially undefined, transitions\n // to \"@flow\" or \"@noflow\" if we see a pragma. Transitions to null if we are\n // past the initial comment.\n flowPragma: void | null | \"flow\" | \"noflow\";\n\n constructor(options: ?Options, input: string) {\n super(options, input);\n this.flowPragma = undefined;\n }\n\n shouldParseTypes(): boolean {\n return this.getPluginOption(\"flow\", \"all\") || this.flowPragma === \"flow\";\n }\n\n shouldParseEnums(): boolean {\n return !!this.getPluginOption(\"flow\", \"enums\");\n }\n\n finishToken(type: TokenType, val: any): void {\n if (\n type !== tt.string &&\n type !== tt.semi &&\n type !== tt.interpreterDirective\n ) {\n if (this.flowPragma === undefined) {\n this.flowPragma = null;\n }\n }\n return super.finishToken(type, val);\n }\n\n addComment(comment: N.Comment): void {\n if (this.flowPragma === undefined) {\n // Try to parse a flow pragma.\n const matches = FLOW_PRAGMA_REGEX.exec(comment.value);\n if (!matches) {\n // do nothing\n } else if (matches[1] === \"flow\") {\n this.flowPragma = \"flow\";\n } else if (matches[1] === \"noflow\") {\n this.flowPragma = \"noflow\";\n } else {\n throw new Error(\"Unexpected flow pragma\");\n }\n }\n return super.addComment(comment);\n }\n\n flowParseTypeInitialiser(tok?: TokenType): N.FlowType {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tok || tt.colon);\n\n const type = this.flowParseType();\n this.state.inType = oldInType;\n return type;\n }\n\n flowParsePredicate(): N.FlowType {\n const node = this.startNode();\n const moduloLoc = this.state.startLoc;\n const moduloPos = this.state.start;\n this.expect(tt.modulo);\n const checksLoc = this.state.startLoc;\n this.expectContextual(\"checks\");\n // Force '%' and 'checks' to be adjacent\n if (\n moduloLoc.line !== checksLoc.line ||\n moduloLoc.column !== checksLoc.column - 1\n ) {\n this.raise(\n moduloPos,\n \"Spaces between ´%´ and ´checks´ are not allowed here.\",\n );\n }\n if (this.eat(tt.parenL)) {\n node.value = this.parseExpression();\n this.expect(tt.parenR);\n return this.finishNode(node, \"DeclaredPredicate\");\n } else {\n return this.finishNode(node, \"InferredPredicate\");\n }\n }\n\n flowParseTypeAndPredicateInitialiser(): [?N.FlowType, ?N.FlowPredicate] {\n const oldInType = this.state.inType;\n this.state.inType = true;\n this.expect(tt.colon);\n let type = null;\n let predicate = null;\n if (this.match(tt.modulo)) {\n this.state.inType = oldInType;\n predicate = this.flowParsePredicate();\n } else {\n type = this.flowParseType();\n this.state.inType = oldInType;\n if (this.match(tt.modulo)) {\n predicate = this.flowParsePredicate();\n }\n }\n return [type, predicate];\n }\n\n flowParseDeclareClass(node: N.FlowDeclareClass): N.FlowDeclareClass {\n this.next();\n this.flowParseInterfaceish(node, /*isClass*/ true);\n return this.finishNode(node, \"DeclareClass\");\n }\n\n flowParseDeclareFunction(\n node: N.FlowDeclareFunction,\n ): N.FlowDeclareFunction {\n this.next();\n\n const id = (node.id = this.parseIdentifier());\n\n const typeNode = this.startNode();\n const typeContainer = this.startNode();\n\n if (this.isRelational(\"<\")) {\n typeNode.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n typeNode.typeParameters = null;\n }\n\n this.expect(tt.parenL);\n const tmp = this.flowParseFunctionTypeParams();\n typeNode.params = tmp.params;\n typeNode.rest = tmp.rest;\n this.expect(tt.parenR);\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.returnType,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n typeContainer.typeAnnotation = this.finishNode(\n typeNode,\n \"FunctionTypeAnnotation\",\n );\n\n id.typeAnnotation = this.finishNode(typeContainer, \"TypeAnnotation\");\n\n this.resetEndLocation(id);\n this.semicolon();\n\n return this.finishNode(node, \"DeclareFunction\");\n }\n\n flowParseDeclare(\n node: N.FlowDeclare,\n insideModule?: boolean,\n ): N.FlowDeclare {\n if (this.match(tt._class)) {\n return this.flowParseDeclareClass(node);\n } else if (this.match(tt._function)) {\n return this.flowParseDeclareFunction(node);\n } else if (this.match(tt._var)) {\n return this.flowParseDeclareVariable(node);\n } else if (this.eatContextual(\"module\")) {\n if (this.match(tt.dot)) {\n return this.flowParseDeclareModuleExports(node);\n } else {\n if (insideModule) {\n this.raise(\n this.state.lastTokStart,\n \"`declare module` cannot be used inside another `declare module`\",\n );\n }\n return this.flowParseDeclareModule(node);\n }\n } else if (this.isContextual(\"type\")) {\n return this.flowParseDeclareTypeAlias(node);\n } else if (this.isContextual(\"opaque\")) {\n return this.flowParseDeclareOpaqueType(node);\n } else if (this.isContextual(\"interface\")) {\n return this.flowParseDeclareInterface(node);\n } else if (this.match(tt._export)) {\n return this.flowParseDeclareExportDeclaration(node, insideModule);\n } else {\n throw this.unexpected();\n }\n }\n\n flowParseDeclareVariable(\n node: N.FlowDeclareVariable,\n ): N.FlowDeclareVariable {\n this.next();\n node.id = this.flowParseTypeAnnotatableIdentifier(\n /*allowPrimitiveOverride*/ true,\n );\n this.scope.declareName(node.id.name, BIND_VAR, node.id.start);\n this.semicolon();\n return this.finishNode(node, \"DeclareVariable\");\n }\n\n flowParseDeclareModule(node: N.FlowDeclareModule): N.FlowDeclareModule {\n this.scope.enter(SCOPE_OTHER);\n\n if (this.match(tt.string)) {\n node.id = this.parseExprAtom();\n } else {\n node.id = this.parseIdentifier();\n }\n\n const bodyNode = (node.body = this.startNode());\n const body = (bodyNode.body = []);\n this.expect(tt.braceL);\n while (!this.match(tt.braceR)) {\n let bodyNode = this.startNode();\n\n if (this.match(tt._import)) {\n this.next();\n if (!this.isContextual(\"type\") && !this.match(tt._typeof)) {\n this.raise(\n this.state.lastTokStart,\n \"Imports within a `declare module` body must always be `import type` or `import typeof`\",\n );\n }\n this.parseImport(bodyNode);\n } else {\n this.expectContextual(\n \"declare\",\n \"Only declares and type imports are allowed inside declare module\",\n );\n\n bodyNode = this.flowParseDeclare(bodyNode, true);\n }\n\n body.push(bodyNode);\n }\n\n this.scope.exit();\n\n this.expect(tt.braceR);\n\n this.finishNode(bodyNode, \"BlockStatement\");\n\n let kind = null;\n let hasModuleExport = false;\n const errorMessage =\n \"Found both `declare module.exports` and `declare export` in the same module. \" +\n \"Modules can only have 1 since they are either an ES module or they are a CommonJS module\";\n body.forEach(bodyElement => {\n if (isEsModuleType(bodyElement)) {\n if (kind === \"CommonJS\") {\n this.raise(bodyElement.start, errorMessage);\n }\n kind = \"ES\";\n } else if (bodyElement.type === \"DeclareModuleExports\") {\n if (hasModuleExport) {\n this.raise(\n bodyElement.start,\n \"Duplicate `declare module.exports` statement\",\n );\n }\n if (kind === \"ES\") this.raise(bodyElement.start, errorMessage);\n kind = \"CommonJS\";\n hasModuleExport = true;\n }\n });\n\n node.kind = kind || \"CommonJS\";\n return this.finishNode(node, \"DeclareModule\");\n }\n\n flowParseDeclareExportDeclaration(\n node: N.FlowDeclareExportDeclaration,\n insideModule: ?boolean,\n ): N.FlowDeclareExportDeclaration {\n this.expect(tt._export);\n\n if (this.eat(tt._default)) {\n if (this.match(tt._function) || this.match(tt._class)) {\n // declare export default class ...\n // declare export default function ...\n node.declaration = this.flowParseDeclare(this.startNode());\n } else {\n // declare export default [type];\n node.declaration = this.flowParseType();\n this.semicolon();\n }\n node.default = true;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else {\n if (\n this.match(tt._const) ||\n this.isLet() ||\n ((this.isContextual(\"type\") || this.isContextual(\"interface\")) &&\n !insideModule)\n ) {\n const label = this.state.value;\n const suggestion = exportSuggestions[label];\n this.unexpected(\n this.state.start,\n `\\`declare export ${label}\\` is not supported. Use \\`${suggestion}\\` instead`,\n );\n }\n\n if (\n this.match(tt._var) || // declare export var ...\n this.match(tt._function) || // declare export function ...\n this.match(tt._class) || // declare export class ...\n this.isContextual(\"opaque\") // declare export opaque ..\n ) {\n node.declaration = this.flowParseDeclare(this.startNode());\n node.default = false;\n\n return this.finishNode(node, \"DeclareExportDeclaration\");\n } else if (\n this.match(tt.star) || // declare export * from ''\n this.match(tt.braceL) || // declare export {} ...\n this.isContextual(\"interface\") || // declare export interface ...\n this.isContextual(\"type\") || // declare export type ...\n this.isContextual(\"opaque\") // declare export opaque type ...\n ) {\n node = this.parseExport(node);\n if (node.type === \"ExportNamedDeclaration\") {\n // flow does not support the ExportNamedDeclaration\n // $FlowIgnore\n node.type = \"ExportDeclaration\";\n // $FlowFixMe\n node.default = false;\n delete node.exportKind;\n }\n\n // $FlowIgnore\n node.type = \"Declare\" + node.type;\n\n return node;\n }\n }\n\n throw this.unexpected();\n }\n\n flowParseDeclareModuleExports(\n node: N.FlowDeclareModuleExports,\n ): N.FlowDeclareModuleExports {\n this.next();\n this.expectContextual(\"exports\");\n node.typeAnnotation = this.flowParseTypeAnnotation();\n this.semicolon();\n\n return this.finishNode(node, \"DeclareModuleExports\");\n }\n\n flowParseDeclareTypeAlias(\n node: N.FlowDeclareTypeAlias,\n ): N.FlowDeclareTypeAlias {\n this.next();\n this.flowParseTypeAlias(node);\n // Don't do finishNode as we don't want to process comments twice\n node.type = \"DeclareTypeAlias\";\n return node;\n }\n\n flowParseDeclareOpaqueType(\n node: N.FlowDeclareOpaqueType,\n ): N.FlowDeclareOpaqueType {\n this.next();\n this.flowParseOpaqueType(node, true);\n // Don't do finishNode as we don't want to process comments twice\n node.type = \"DeclareOpaqueType\";\n return node;\n }\n\n flowParseDeclareInterface(\n node: N.FlowDeclareInterface,\n ): N.FlowDeclareInterface {\n this.next();\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"DeclareInterface\");\n }\n\n // Interfaces\n\n flowParseInterfaceish(\n node: N.FlowDeclare,\n isClass?: boolean = false,\n ): void {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ !isClass,\n /* declaration */ true,\n );\n\n this.scope.declareName(\n node.id.name,\n isClass ? BIND_FUNCTION : BIND_LEXICAL,\n node.id.start,\n );\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.extends = [];\n node.implements = [];\n node.mixins = [];\n\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (!isClass && this.eat(tt.comma));\n }\n\n if (this.isContextual(\"mixins\")) {\n this.next();\n do {\n node.mixins.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n if (this.isContextual(\"implements\")) {\n this.next();\n do {\n node.implements.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: isClass,\n allowExact: false,\n allowSpread: false,\n allowProto: isClass,\n allowInexact: false,\n });\n }\n\n flowParseInterfaceExtends(): N.FlowInterfaceExtends {\n const node = this.startNode();\n\n node.id = this.flowParseQualifiedTypeIdentifier();\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n\n return this.finishNode(node, \"InterfaceExtends\");\n }\n\n flowParseInterface(node: N.FlowInterface): N.FlowInterface {\n this.flowParseInterfaceish(node);\n return this.finishNode(node, \"InterfaceDeclaration\");\n }\n\n checkNotUnderscore(word: string) {\n if (word === \"_\") {\n this.raise(\n this.state.start,\n \"`_` is only allowed as a type argument to call or new\",\n );\n }\n }\n\n checkReservedType(word: string, startLoc: number, declaration?: boolean) {\n if (!reservedTypes.has(word)) return;\n\n if (declaration) {\n this.raise(startLoc, `Cannot overwrite reserved type ${word}`);\n return;\n }\n\n this.raise(startLoc, `Unexpected reserved type ${word}`);\n }\n\n flowParseRestrictedIdentifier(\n liberal?: boolean,\n declaration?: boolean,\n ): N.Identifier {\n this.checkReservedType(this.state.value, this.state.start, declaration);\n return this.parseIdentifier(liberal);\n }\n\n // Type aliases\n\n flowParseTypeAlias(node: N.FlowTypeAlias): N.FlowTypeAlias {\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ false,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n node.right = this.flowParseTypeInitialiser(tt.eq);\n this.semicolon();\n\n return this.finishNode(node, \"TypeAlias\");\n }\n\n flowParseOpaqueType(\n node: N.FlowOpaqueType,\n declare: boolean,\n ): N.FlowOpaqueType {\n this.expectContextual(\"type\");\n node.id = this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n );\n this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n } else {\n node.typeParameters = null;\n }\n\n // Parse the supertype\n node.supertype = null;\n if (this.match(tt.colon)) {\n node.supertype = this.flowParseTypeInitialiser(tt.colon);\n }\n\n node.impltype = null;\n if (!declare) {\n node.impltype = this.flowParseTypeInitialiser(tt.eq);\n }\n this.semicolon();\n\n return this.finishNode(node, \"OpaqueType\");\n }\n\n // Type annotations\n\n flowParseTypeParameter(requireDefault?: boolean = false): N.TypeParameter {\n const nodeStart = this.state.start;\n\n const node = this.startNode();\n\n const variance = this.flowParseVariance();\n\n const ident = this.flowParseTypeAnnotatableIdentifier();\n node.name = ident.name;\n node.variance = variance;\n node.bound = ident.typeAnnotation;\n\n if (this.match(tt.eq)) {\n this.eat(tt.eq);\n node.default = this.flowParseType();\n } else {\n if (requireDefault) {\n this.raise(\n nodeStart,\n // eslint-disable-next-line max-len\n \"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.\",\n );\n }\n }\n\n return this.finishNode(node, \"TypeParameter\");\n }\n\n flowParseTypeParameterDeclaration(): N.TypeParameterDeclaration {\n const oldInType = this.state.inType;\n const node = this.startNode();\n node.params = [];\n\n this.state.inType = true;\n\n // istanbul ignore else: this condition is already checked at all call sites\n if (this.isRelational(\"<\") || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n let defaultRequired = false;\n\n do {\n const typeParameter = this.flowParseTypeParameter(defaultRequired);\n\n node.params.push(typeParameter);\n\n if (typeParameter.default) {\n defaultRequired = true;\n }\n\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n } while (!this.isRelational(\">\"));\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterDeclaration\");\n }\n\n flowParseTypeParameterInstantiation(): N.TypeParameterInstantiation {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expectRelational(\"<\");\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = false;\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseType());\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n }\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseTypeParameterInstantiationCallOrNew(): N.TypeParameterInstantiation {\n const node = this.startNode();\n const oldInType = this.state.inType;\n node.params = [];\n\n this.state.inType = true;\n\n this.expectRelational(\"<\");\n while (!this.isRelational(\">\")) {\n node.params.push(this.flowParseTypeOrImplicitInstantiation());\n if (!this.isRelational(\">\")) {\n this.expect(tt.comma);\n }\n }\n this.expectRelational(\">\");\n\n this.state.inType = oldInType;\n\n return this.finishNode(node, \"TypeParameterInstantiation\");\n }\n\n flowParseInterfaceType(): N.FlowInterfaceType {\n const node = this.startNode();\n this.expectContextual(\"interface\");\n\n node.extends = [];\n if (this.eat(tt._extends)) {\n do {\n node.extends.push(this.flowParseInterfaceExtends());\n } while (this.eat(tt.comma));\n }\n\n node.body = this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: false,\n allowProto: false,\n allowInexact: false,\n });\n\n return this.finishNode(node, \"InterfaceTypeAnnotation\");\n }\n\n flowParseObjectPropertyKey(): N.Expression {\n return this.match(tt.num) || this.match(tt.string)\n ? this.parseExprAtom()\n : this.parseIdentifier(true);\n }\n\n flowParseObjectTypeIndexer(\n node: N.FlowObjectTypeIndexer,\n isStatic: boolean,\n variance: ?N.FlowVariance,\n ): N.FlowObjectTypeIndexer {\n node.static = isStatic;\n\n // Note: bracketL has already been consumed\n if (this.lookahead().type === tt.colon) {\n node.id = this.flowParseObjectPropertyKey();\n node.key = this.flowParseTypeInitialiser();\n } else {\n node.id = null;\n node.key = this.flowParseType();\n }\n this.expect(tt.bracketR);\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n\n return this.finishNode(node, \"ObjectTypeIndexer\");\n }\n\n flowParseObjectTypeInternalSlot(\n node: N.FlowObjectTypeInternalSlot,\n isStatic: boolean,\n ): N.FlowObjectTypeInternalSlot {\n node.static = isStatic;\n // Note: both bracketL have already been consumed\n node.id = this.flowParseObjectPropertyKey();\n this.expect(tt.bracketR);\n this.expect(tt.bracketR);\n if (this.isRelational(\"<\") || this.match(tt.parenL)) {\n node.method = true;\n node.optional = false;\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.start, node.loc.start),\n );\n } else {\n node.method = false;\n if (this.eat(tt.question)) {\n node.optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n }\n return this.finishNode(node, \"ObjectTypeInternalSlot\");\n }\n\n flowParseObjectTypeMethodish(\n node: N.FlowFunctionTypeAnnotation,\n ): N.FlowFunctionTypeAnnotation {\n node.params = [];\n node.rest = null;\n node.typeParameters = null;\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n this.expect(tt.parenL);\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n node.params.push(this.flowParseFunctionTypeParam());\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n\n if (this.eat(tt.ellipsis)) {\n node.rest = this.flowParseFunctionTypeParam();\n }\n this.expect(tt.parenR);\n node.returnType = this.flowParseTypeInitialiser();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n\n flowParseObjectTypeCallProperty(\n node: N.FlowObjectTypeCallProperty,\n isStatic: boolean,\n ): N.FlowObjectTypeCallProperty {\n const valueNode = this.startNode();\n node.static = isStatic;\n node.value = this.flowParseObjectTypeMethodish(valueNode);\n return this.finishNode(node, \"ObjectTypeCallProperty\");\n }\n\n flowParseObjectType({\n allowStatic,\n allowExact,\n allowSpread,\n allowProto,\n allowInexact,\n }: {\n allowStatic: boolean,\n allowExact: boolean,\n allowSpread: boolean,\n allowProto: boolean,\n allowInexact: boolean,\n }): N.FlowObjectTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n\n const nodeStart = this.startNode();\n\n nodeStart.callProperties = [];\n nodeStart.properties = [];\n nodeStart.indexers = [];\n nodeStart.internalSlots = [];\n\n let endDelim;\n let exact;\n let inexact = false;\n if (allowExact && this.match(tt.braceBarL)) {\n this.expect(tt.braceBarL);\n endDelim = tt.braceBarR;\n exact = true;\n } else {\n this.expect(tt.braceL);\n endDelim = tt.braceR;\n exact = false;\n }\n\n nodeStart.exact = exact;\n\n while (!this.match(endDelim)) {\n let isStatic = false;\n let protoStart: ?number = null;\n let inexactStart: ?number = null;\n const node = this.startNode();\n\n if (allowProto && this.isContextual(\"proto\")) {\n const lookahead = this.lookahead();\n\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n protoStart = this.state.start;\n allowStatic = false;\n }\n }\n\n if (allowStatic && this.isContextual(\"static\")) {\n const lookahead = this.lookahead();\n\n // static is a valid identifier name\n if (lookahead.type !== tt.colon && lookahead.type !== tt.question) {\n this.next();\n isStatic = true;\n }\n }\n\n const variance = this.flowParseVariance();\n\n if (this.eat(tt.bracketL)) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (this.eat(tt.bracketL)) {\n if (variance) {\n this.unexpected(variance.start);\n }\n nodeStart.internalSlots.push(\n this.flowParseObjectTypeInternalSlot(node, isStatic),\n );\n } else {\n nodeStart.indexers.push(\n this.flowParseObjectTypeIndexer(node, isStatic, variance),\n );\n }\n } else if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.unexpected(variance.start);\n }\n nodeStart.callProperties.push(\n this.flowParseObjectTypeCallProperty(node, isStatic),\n );\n } else {\n let kind = \"init\";\n\n if (this.isContextual(\"get\") || this.isContextual(\"set\")) {\n const lookahead = this.lookahead();\n if (\n lookahead.type === tt.name ||\n lookahead.type === tt.string ||\n lookahead.type === tt.num\n ) {\n kind = this.state.value;\n this.next();\n }\n }\n\n const propOrInexact = this.flowParseObjectTypeProperty(\n node,\n isStatic,\n protoStart,\n variance,\n kind,\n allowSpread,\n allowInexact ?? !exact,\n );\n\n if (propOrInexact === null) {\n inexact = true;\n inexactStart = this.state.lastTokStart;\n } else {\n nodeStart.properties.push(propOrInexact);\n }\n }\n\n this.flowObjectTypeSemicolon();\n\n if (\n inexactStart &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.raise(\n inexactStart,\n \"Explicit inexact syntax must appear at the end of an inexact object\",\n );\n }\n }\n\n this.expect(endDelim);\n\n /* The inexact flag should only be added on ObjectTypeAnnotations that\n * are not the body of an interface, declare interface, or declare class.\n * Since spreads are only allowed in objec types, checking that is\n * sufficient here.\n */\n if (allowSpread) {\n nodeStart.inexact = inexact;\n }\n\n const out = this.finishNode(nodeStart, \"ObjectTypeAnnotation\");\n\n this.state.inType = oldInType;\n\n return out;\n }\n\n flowParseObjectTypeProperty(\n node: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,\n isStatic: boolean,\n protoStart: ?number,\n variance: ?N.FlowVariance,\n kind: string,\n allowSpread: boolean,\n allowInexact: boolean,\n ): (N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty) | null {\n if (this.eat(tt.ellipsis)) {\n const isInexactToken =\n this.match(tt.comma) ||\n this.match(tt.semi) ||\n this.match(tt.braceR) ||\n this.match(tt.braceBarR);\n\n if (isInexactToken) {\n if (!allowSpread) {\n this.raise(\n this.state.lastTokStart,\n \"Explicit inexact syntax cannot appear in class or interface definitions\",\n );\n } else if (!allowInexact) {\n this.raise(\n this.state.lastTokStart,\n \"Explicit inexact syntax cannot appear inside an explicit exact object type\",\n );\n }\n if (variance) {\n this.raise(\n variance.start,\n \"Explicit inexact syntax cannot have variance\",\n );\n }\n\n return null;\n }\n\n if (!allowSpread) {\n this.raise(\n this.state.lastTokStart,\n \"Spread operator cannot appear in class or interface definitions\",\n );\n }\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.raise(variance.start, \"Spread properties cannot have variance\");\n }\n\n node.argument = this.flowParseType();\n return this.finishNode(node, \"ObjectTypeSpreadProperty\");\n } else {\n node.key = this.flowParseObjectPropertyKey();\n node.static = isStatic;\n node.proto = protoStart != null;\n node.kind = kind;\n\n let optional = false;\n if (this.isRelational(\"<\") || this.match(tt.parenL)) {\n // This is a method property\n node.method = true;\n\n if (protoStart != null) {\n this.unexpected(protoStart);\n }\n if (variance) {\n this.unexpected(variance.start);\n }\n\n node.value = this.flowParseObjectTypeMethodish(\n this.startNodeAt(node.start, node.loc.start),\n );\n if (kind === \"get\" || kind === \"set\") {\n this.flowCheckGetterSetterParams(node);\n }\n } else {\n if (kind !== \"init\") this.unexpected();\n\n node.method = false;\n\n if (this.eat(tt.question)) {\n optional = true;\n }\n node.value = this.flowParseTypeInitialiser();\n node.variance = variance;\n }\n\n node.optional = optional;\n\n return this.finishNode(node, \"ObjectTypeProperty\");\n }\n }\n\n // This is similar to checkGetterSetterParams, but as\n // @babel/parser uses non estree properties we cannot reuse it here\n flowCheckGetterSetterParams(\n property: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty,\n ): void {\n const paramCount = property.kind === \"get\" ? 0 : 1;\n const start = property.start;\n const length =\n property.value.params.length + (property.value.rest ? 1 : 0);\n if (length !== paramCount) {\n if (property.kind === \"get\") {\n this.raise(start, \"getter must not have any formal parameters\");\n } else {\n this.raise(start, \"setter must have exactly one formal parameter\");\n }\n }\n\n if (property.kind === \"set\" && property.value.rest) {\n this.raise(\n start,\n \"setter function argument must not be a rest parameter\",\n );\n }\n }\n\n flowObjectTypeSemicolon(): void {\n if (\n !this.eat(tt.semi) &&\n !this.eat(tt.comma) &&\n !this.match(tt.braceR) &&\n !this.match(tt.braceBarR)\n ) {\n this.unexpected();\n }\n }\n\n flowParseQualifiedTypeIdentifier(\n startPos?: number,\n startLoc?: Position,\n id?: N.Identifier,\n ): N.FlowQualifiedTypeIdentifier {\n startPos = startPos || this.state.start;\n startLoc = startLoc || this.state.startLoc;\n let node = id || this.flowParseRestrictedIdentifier(true);\n\n while (this.eat(tt.dot)) {\n const node2 = this.startNodeAt(startPos, startLoc);\n node2.qualification = node;\n node2.id = this.flowParseRestrictedIdentifier(true);\n node = this.finishNode(node2, \"QualifiedTypeIdentifier\");\n }\n\n return node;\n }\n\n flowParseGenericType(\n startPos: number,\n startLoc: Position,\n id: N.Identifier,\n ): N.FlowGenericTypeAnnotation {\n const node = this.startNodeAt(startPos, startLoc);\n\n node.typeParameters = null;\n node.id = this.flowParseQualifiedTypeIdentifier(startPos, startLoc, id);\n\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n }\n\n return this.finishNode(node, \"GenericTypeAnnotation\");\n }\n\n flowParseTypeofType(): N.FlowTypeofTypeAnnotation {\n const node = this.startNode();\n this.expect(tt._typeof);\n node.argument = this.flowParsePrimaryType();\n return this.finishNode(node, \"TypeofTypeAnnotation\");\n }\n\n flowParseTupleType(): N.FlowTupleTypeAnnotation {\n const node = this.startNode();\n node.types = [];\n this.expect(tt.bracketL);\n // We allow trailing commas\n while (this.state.pos < this.length && !this.match(tt.bracketR)) {\n node.types.push(this.flowParseType());\n if (this.match(tt.bracketR)) break;\n this.expect(tt.comma);\n }\n this.expect(tt.bracketR);\n return this.finishNode(node, \"TupleTypeAnnotation\");\n }\n\n flowParseFunctionTypeParam(): N.FlowFunctionTypeParam {\n let name = null;\n let optional = false;\n let typeAnnotation = null;\n const node = this.startNode();\n const lh = this.lookahead();\n if (lh.type === tt.colon || lh.type === tt.question) {\n name = this.parseIdentifier();\n if (this.eat(tt.question)) {\n optional = true;\n }\n typeAnnotation = this.flowParseTypeInitialiser();\n } else {\n typeAnnotation = this.flowParseType();\n }\n node.name = name;\n node.optional = optional;\n node.typeAnnotation = typeAnnotation;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n reinterpretTypeAsFunctionTypeParam(\n type: N.FlowType,\n ): N.FlowFunctionTypeParam {\n const node = this.startNodeAt(type.start, type.loc.start);\n node.name = null;\n node.optional = false;\n node.typeAnnotation = type;\n return this.finishNode(node, \"FunctionTypeParam\");\n }\n\n flowParseFunctionTypeParams(\n params: N.FlowFunctionTypeParam[] = [],\n ): { params: N.FlowFunctionTypeParam[], rest: ?N.FlowFunctionTypeParam } {\n let rest: ?N.FlowFunctionTypeParam = null;\n while (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n params.push(this.flowParseFunctionTypeParam());\n if (!this.match(tt.parenR)) {\n this.expect(tt.comma);\n }\n }\n if (this.eat(tt.ellipsis)) {\n rest = this.flowParseFunctionTypeParam();\n }\n return { params, rest };\n }\n\n flowIdentToTypeAnnotation(\n startPos: number,\n startLoc: Position,\n node: N.FlowTypeAnnotation,\n id: N.Identifier,\n ): N.FlowTypeAnnotation {\n switch (id.name) {\n case \"any\":\n return this.finishNode(node, \"AnyTypeAnnotation\");\n\n case \"bool\":\n case \"boolean\":\n return this.finishNode(node, \"BooleanTypeAnnotation\");\n\n case \"mixed\":\n return this.finishNode(node, \"MixedTypeAnnotation\");\n\n case \"empty\":\n return this.finishNode(node, \"EmptyTypeAnnotation\");\n\n case \"number\":\n return this.finishNode(node, \"NumberTypeAnnotation\");\n\n case \"string\":\n return this.finishNode(node, \"StringTypeAnnotation\");\n\n default:\n this.checkNotUnderscore(id.name);\n return this.flowParseGenericType(startPos, startLoc, id);\n }\n }\n\n // The parsing of types roughly parallels the parsing of expressions, and\n // primary types are kind of like primary expressions...they're the\n // primitives with which other types are constructed.\n flowParsePrimaryType(): N.FlowTypeAnnotation {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.startNode();\n let tmp;\n let type;\n let isGroupedType = false;\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n\n switch (this.state.type) {\n case tt.name:\n if (this.isContextual(\"interface\")) {\n return this.flowParseInterfaceType();\n }\n\n return this.flowIdentToTypeAnnotation(\n startPos,\n startLoc,\n node,\n this.parseIdentifier(),\n );\n\n case tt.braceL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: false,\n allowSpread: true,\n allowProto: false,\n allowInexact: true,\n });\n\n case tt.braceBarL:\n return this.flowParseObjectType({\n allowStatic: false,\n allowExact: true,\n allowSpread: true,\n allowProto: false,\n allowInexact: false,\n });\n\n case tt.bracketL:\n this.state.noAnonFunctionType = false;\n type = this.flowParseTupleType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n return type;\n\n case tt.relational:\n if (this.state.value === \"<\") {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n this.expect(tt.parenL);\n tmp = this.flowParseFunctionTypeParams();\n node.params = tmp.params;\n node.rest = tmp.rest;\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n break;\n\n case tt.parenL:\n this.next();\n\n // Check to see if this is actually a grouped type\n if (!this.match(tt.parenR) && !this.match(tt.ellipsis)) {\n if (this.match(tt.name)) {\n const token = this.lookahead().type;\n isGroupedType = token !== tt.question && token !== tt.colon;\n } else {\n isGroupedType = true;\n }\n }\n\n if (isGroupedType) {\n this.state.noAnonFunctionType = false;\n type = this.flowParseType();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n // A `,` or a `) =>` means this is an anonymous function type\n if (\n this.state.noAnonFunctionType ||\n !(\n this.match(tt.comma) ||\n (this.match(tt.parenR) && this.lookahead().type === tt.arrow)\n )\n ) {\n this.expect(tt.parenR);\n return type;\n } else {\n // Eat a comma if there is one\n this.eat(tt.comma);\n }\n }\n\n if (type) {\n tmp = this.flowParseFunctionTypeParams([\n this.reinterpretTypeAsFunctionTypeParam(type),\n ]);\n } else {\n tmp = this.flowParseFunctionTypeParams();\n }\n\n node.params = tmp.params;\n node.rest = tmp.rest;\n\n this.expect(tt.parenR);\n\n this.expect(tt.arrow);\n\n node.returnType = this.flowParseType();\n\n node.typeParameters = null;\n\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n\n case tt.string:\n return this.parseLiteral(\n this.state.value,\n \"StringLiteralTypeAnnotation\",\n );\n\n case tt._true:\n case tt._false:\n node.value = this.match(tt._true);\n this.next();\n return this.finishNode(node, \"BooleanLiteralTypeAnnotation\");\n\n case tt.plusMin:\n if (this.state.value === \"-\") {\n this.next();\n if (this.match(tt.num)) {\n return this.parseLiteral(\n -this.state.value,\n \"NumberLiteralTypeAnnotation\",\n node.start,\n node.loc.start,\n );\n }\n\n if (this.match(tt.bigint)) {\n return this.parseLiteral(\n -this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n node.start,\n node.loc.start,\n );\n }\n\n throw this.raise(\n this.state.start,\n `Unexpected token, expected \"number\" or \"bigint\"`,\n );\n }\n\n throw this.unexpected();\n case tt.num:\n return this.parseLiteral(\n this.state.value,\n \"NumberLiteralTypeAnnotation\",\n );\n\n case tt.bigint:\n return this.parseLiteral(\n this.state.value,\n \"BigIntLiteralTypeAnnotation\",\n );\n\n case tt._void:\n this.next();\n return this.finishNode(node, \"VoidTypeAnnotation\");\n\n case tt._null:\n this.next();\n return this.finishNode(node, \"NullLiteralTypeAnnotation\");\n\n case tt._this:\n this.next();\n return this.finishNode(node, \"ThisTypeAnnotation\");\n\n case tt.star:\n this.next();\n return this.finishNode(node, \"ExistsTypeAnnotation\");\n\n default:\n if (this.state.type.keyword === \"typeof\") {\n return this.flowParseTypeofType();\n } else if (this.state.type.keyword) {\n const label = this.state.type.label;\n this.next();\n return super.createIdentifier(node, label);\n }\n }\n\n throw this.unexpected();\n }\n\n flowParsePostfixType(): N.FlowTypeAnnotation {\n const startPos = this.state.start,\n startLoc = this.state.startLoc;\n let type = this.flowParsePrimaryType();\n while (this.match(tt.bracketL) && !this.canInsertSemicolon()) {\n const node = this.startNodeAt(startPos, startLoc);\n node.elementType = type;\n this.expect(tt.bracketL);\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"ArrayTypeAnnotation\");\n }\n return type;\n }\n\n flowParsePrefixType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n if (this.eat(tt.question)) {\n node.typeAnnotation = this.flowParsePrefixType();\n return this.finishNode(node, \"NullableTypeAnnotation\");\n } else {\n return this.flowParsePostfixType();\n }\n }\n\n flowParseAnonFunctionWithoutParens(): N.FlowTypeAnnotation {\n const param = this.flowParsePrefixType();\n if (!this.state.noAnonFunctionType && this.eat(tt.arrow)) {\n // TODO: This should be a type error. Passing in a SourceLocation, and it expects a Position.\n const node = this.startNodeAt(param.start, param.loc.start);\n node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];\n node.rest = null;\n node.returnType = this.flowParseType();\n node.typeParameters = null;\n return this.finishNode(node, \"FunctionTypeAnnotation\");\n }\n return param;\n }\n\n flowParseIntersectionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseAND);\n const type = this.flowParseAnonFunctionWithoutParens();\n node.types = [type];\n while (this.eat(tt.bitwiseAND)) {\n node.types.push(this.flowParseAnonFunctionWithoutParens());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"IntersectionTypeAnnotation\");\n }\n\n flowParseUnionType(): N.FlowTypeAnnotation {\n const node = this.startNode();\n this.eat(tt.bitwiseOR);\n const type = this.flowParseIntersectionType();\n node.types = [type];\n while (this.eat(tt.bitwiseOR)) {\n node.types.push(this.flowParseIntersectionType());\n }\n return node.types.length === 1\n ? type\n : this.finishNode(node, \"UnionTypeAnnotation\");\n }\n\n flowParseType(): N.FlowTypeAnnotation {\n const oldInType = this.state.inType;\n this.state.inType = true;\n const type = this.flowParseUnionType();\n this.state.inType = oldInType;\n // Ensure that a brace after a function generic type annotation is a\n // statement, except in arrow functions (noAnonFunctionType)\n this.state.exprAllowed =\n this.state.exprAllowed || this.state.noAnonFunctionType;\n return type;\n }\n\n flowParseTypeOrImplicitInstantiation(): N.FlowTypeAnnotation {\n if (this.state.type === tt.name && this.state.value === \"_\") {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const node = this.parseIdentifier();\n return this.flowParseGenericType(startPos, startLoc, node);\n } else {\n return this.flowParseType();\n }\n }\n\n flowParseTypeAnnotation(): N.FlowTypeAnnotation {\n const node = this.startNode();\n node.typeAnnotation = this.flowParseTypeInitialiser();\n return this.finishNode(node, \"TypeAnnotation\");\n }\n\n flowParseTypeAnnotatableIdentifier(\n allowPrimitiveOverride?: boolean,\n ): N.Identifier {\n const ident = allowPrimitiveOverride\n ? this.parseIdentifier()\n : this.flowParseRestrictedIdentifier();\n if (this.match(tt.colon)) {\n ident.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(ident);\n }\n return ident;\n }\n\n typeCastToParameter(node: N.Node): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(\n node.expression,\n node.typeAnnotation.end,\n node.typeAnnotation.loc.end,\n );\n\n return node.expression;\n }\n\n flowParseVariance(): ?N.FlowVariance {\n let variance = null;\n if (this.match(tt.plusMin)) {\n variance = this.startNode();\n if (this.state.value === \"+\") {\n variance.kind = \"plus\";\n } else {\n variance.kind = \"minus\";\n }\n this.next();\n this.finishNode(variance, \"Variance\");\n }\n return variance;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseFunctionBody(\n node: N.Function,\n allowExpressionBody: ?boolean,\n isMethod?: boolean = false,\n ): void {\n if (allowExpressionBody) {\n return this.forwardNoArrowParamsConversionAt(node, () =>\n super.parseFunctionBody(node, true, isMethod),\n );\n }\n\n return super.parseFunctionBody(node, false, isMethod);\n }\n\n parseFunctionBodyAndFinish(\n node: N.BodilessFunctionOrMethodBase,\n type: string,\n isMethod?: boolean = false,\n ): void {\n if (this.match(tt.colon)) {\n const typeNode = this.startNode();\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.typeAnnotation,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n node.returnType = typeNode.typeAnnotation\n ? this.finishNode(typeNode, \"TypeAnnotation\")\n : null;\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n // interfaces and enums\n parseStatement(context: ?string, topLevel?: boolean): N.Statement {\n // strict mode handling of `interface` since it's a reserved word\n if (\n this.state.strict &&\n this.match(tt.name) &&\n this.state.value === \"interface\"\n ) {\n const node = this.startNode();\n this.next();\n return this.flowParseInterface(node);\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n } else {\n const stmt = super.parseStatement(context, topLevel);\n // We will parse a flow pragma in any comment before the first statement.\n if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {\n this.flowPragma = null;\n }\n return stmt;\n }\n }\n\n // declares, interfaces and type aliases\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n ): N.ExpressionStatement {\n if (expr.type === \"Identifier\") {\n if (expr.name === \"declare\") {\n if (\n this.match(tt._class) ||\n this.match(tt.name) ||\n this.match(tt._function) ||\n this.match(tt._var) ||\n this.match(tt._export)\n ) {\n return this.flowParseDeclare(node);\n }\n } else if (this.match(tt.name)) {\n if (expr.name === \"interface\") {\n return this.flowParseInterface(node);\n } else if (expr.name === \"type\") {\n return this.flowParseTypeAlias(node);\n } else if (expr.name === \"opaque\") {\n return this.flowParseOpaqueType(node, false);\n }\n }\n }\n\n return super.parseExpressionStatement(node, expr);\n }\n\n // export type\n shouldParseExportDeclaration(): boolean {\n return (\n this.isContextual(\"type\") ||\n this.isContextual(\"interface\") ||\n this.isContextual(\"opaque\") ||\n (this.shouldParseEnums() && this.isContextual(\"enum\")) ||\n super.shouldParseExportDeclaration()\n );\n }\n\n isExportDefaultSpecifier(): boolean {\n if (\n this.match(tt.name) &&\n (this.state.value === \"type\" ||\n this.state.value === \"interface\" ||\n this.state.value === \"opaque\" ||\n (this.shouldParseEnums() && this.state.value === \"enum\"))\n ) {\n return false;\n }\n\n return super.isExportDefaultSpecifier();\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n const node = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(node);\n }\n return super.parseExportDefaultExpression();\n }\n\n parseConditional(\n expr: N.Expression,\n noIn: ?boolean,\n startPos: number,\n startLoc: Position,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n if (!this.match(tt.question)) return expr;\n\n // only use the expensive \"tryParse\" method if there is a question mark\n // and if we come from inside parens\n if (refNeedsArrowPos) {\n const result = this.tryParse(() =>\n super.parseConditional(expr, noIn, startPos, startLoc),\n );\n\n if (!result.node) {\n // $FlowIgnore\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n this.expect(tt.question);\n const state = this.state.clone();\n const originalNoArrowAt = this.state.noArrowAt;\n const node = this.startNodeAt(startPos, startLoc);\n let { consequent, failed } = this.tryParseConditionalConsequent();\n let [valid, invalid] = this.getArrowLikeExpressions(consequent);\n\n if (failed || invalid.length > 0) {\n const noArrowAt = [...originalNoArrowAt];\n\n if (invalid.length > 0) {\n this.state = state;\n this.state.noArrowAt = noArrowAt;\n\n for (let i = 0; i < invalid.length; i++) {\n noArrowAt.push(invalid[i].start);\n }\n\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n [valid, invalid] = this.getArrowLikeExpressions(consequent);\n }\n\n if (failed && valid.length > 1) {\n // if there are two or more possible correct ways of parsing, throw an\n // error.\n // e.g. Source: a ? (b): c => (d): e => f\n // Result 1: a ? b : (c => ((d): e => f))\n // Result 2: a ? ((b): c => d) : (e => f)\n this.raise(\n state.start,\n \"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.\",\n );\n }\n\n if (failed && valid.length === 1) {\n this.state = state;\n this.state.noArrowAt = noArrowAt.concat(valid[0].start);\n ({ consequent, failed } = this.tryParseConditionalConsequent());\n }\n }\n\n this.getArrowLikeExpressions(consequent, true);\n\n this.state.noArrowAt = originalNoArrowAt;\n this.expect(tt.colon);\n\n node.test = expr;\n node.consequent = consequent;\n node.alternate = this.forwardNoArrowParamsConversionAt(node, () =>\n this.parseMaybeAssign(noIn, undefined, undefined, undefined),\n );\n\n return this.finishNode(node, \"ConditionalExpression\");\n }\n\n tryParseConditionalConsequent(): {\n consequent: N.Expression,\n failed: boolean,\n } {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n\n const consequent = this.parseMaybeAssign();\n const failed = !this.match(tt.colon);\n\n this.state.noArrowParamsConversionAt.pop();\n\n return { consequent, failed };\n }\n\n // Given an expression, walks through out its arrow functions whose body is\n // an expression and through out conditional expressions. It returns every\n // function which has been parsed with a return type but could have been\n // parenthesized expressions.\n // These functions are separated into two arrays: one containing the ones\n // whose parameters can be converted to assignable lists, one containing the\n // others.\n getArrowLikeExpressions(\n node: N.Expression,\n disallowInvalid?: boolean,\n ): [N.ArrowFunctionExpression[], N.ArrowFunctionExpression[]] {\n const stack = [node];\n const arrows: N.ArrowFunctionExpression[] = [];\n\n while (stack.length !== 0) {\n const node = stack.pop();\n if (node.type === \"ArrowFunctionExpression\") {\n if (node.typeParameters || !node.returnType) {\n // This is an arrow expression without ambiguity, so check its parameters\n this.finishArrowValidation(node);\n } else {\n arrows.push(node);\n }\n stack.push(node.body);\n } else if (node.type === \"ConditionalExpression\") {\n stack.push(node.consequent);\n stack.push(node.alternate);\n }\n }\n\n if (disallowInvalid) {\n arrows.forEach(node => this.finishArrowValidation(node));\n return [arrows, []];\n }\n\n return partition(arrows, node =>\n node.params.every(param => this.isAssignable(param, true)),\n );\n }\n\n finishArrowValidation(node: N.ArrowFunctionExpression) {\n this.toAssignableList(\n // node.params is Expression[] instead of $ReadOnlyArray because it\n // has not been converted yet.\n ((node.params: any): N.Expression[]),\n node.extra?.trailingComma,\n );\n // Enter scope, as checkParams defines bindings\n this.scope.enter(SCOPE_FUNCTION | SCOPE_ARROW);\n // Use super's method to force the parameters to be checked\n super.checkParams(node, false, true);\n this.scope.exit();\n }\n\n forwardNoArrowParamsConversionAt(node: N.Node, parse: () => T): T {\n let result: T;\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n this.state.noArrowParamsConversionAt.push(this.state.start);\n result = parse();\n this.state.noArrowParamsConversionAt.pop();\n } else {\n result = parse();\n }\n\n return result;\n }\n\n parseParenItem(\n node: N.Expression,\n startPos: number,\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startPos, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode = this.startNodeAt(startPos, startLoc);\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TypeCastExpression\");\n }\n\n return node;\n }\n\n assertModuleNodeAllowed(node: N.Node) {\n if (\n (node.type === \"ImportDeclaration\" &&\n (node.importKind === \"type\" || node.importKind === \"typeof\")) ||\n (node.type === \"ExportNamedDeclaration\" &&\n node.exportKind === \"type\") ||\n (node.type === \"ExportAllDeclaration\" && node.exportKind === \"type\")\n ) {\n // Allow Flowtype imports and exports in all conditions because\n // Flow itself does not care about 'sourceType'.\n return;\n }\n\n super.assertModuleNodeAllowed(node);\n }\n\n parseExport(node: N.Node): N.AnyExport {\n const decl = super.parseExport(node);\n if (\n decl.type === \"ExportNamedDeclaration\" ||\n decl.type === \"ExportAllDeclaration\"\n ) {\n decl.exportKind = decl.exportKind || \"value\";\n }\n return decl;\n }\n\n parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {\n if (this.isContextual(\"type\")) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n\n if (this.match(tt.braceL)) {\n // export type { foo, bar };\n node.specifiers = this.parseExportSpecifiers();\n this.parseExportFrom(node);\n return null;\n } else {\n // export type Foo = Bar;\n return this.flowParseTypeAlias(declarationNode);\n }\n } else if (this.isContextual(\"opaque\")) {\n node.exportKind = \"type\";\n\n const declarationNode = this.startNode();\n this.next();\n // export opaque type Foo = Bar;\n return this.flowParseOpaqueType(declarationNode, false);\n } else if (this.isContextual(\"interface\")) {\n node.exportKind = \"type\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseInterface(declarationNode);\n } else if (this.shouldParseEnums() && this.isContextual(\"enum\")) {\n node.exportKind = \"value\";\n const declarationNode = this.startNode();\n this.next();\n return this.flowParseEnumDeclaration(declarationNode);\n } else {\n return super.parseExportDeclaration(node);\n }\n }\n\n eatExportStar(node: N.Node): boolean {\n if (super.eatExportStar(...arguments)) return true;\n\n if (this.isContextual(\"type\") && this.lookahead().type === tt.star) {\n node.exportKind = \"type\";\n this.next();\n this.next();\n return true;\n }\n\n return false;\n }\n\n maybeParseExportNamespaceSpecifier(node: N.Node): boolean {\n const pos = this.state.start;\n const hasNamespace = super.maybeParseExportNamespaceSpecifier(node);\n if (hasNamespace && node.exportKind === \"type\") {\n this.unexpected(pos);\n }\n return hasNamespace;\n }\n\n parseClassId(node: N.Class, isStatement: boolean, optionalId: ?boolean) {\n super.parseClassId(node, isStatement, optionalId);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n }\n\n // ensure that inside flow types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (code === charCodes.leftCurlyBrace && next === charCodes.verticalBar) {\n return this.finishOp(tt.braceBarL, 2);\n } else if (\n this.state.inType &&\n (code === charCodes.greaterThan || code === charCodes.lessThan)\n ) {\n return this.finishOp(tt.relational, 1);\n } else if (isIteratorStart(code, next)) {\n this.state.isIterator = true;\n return super.readWord();\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n isAssignable(node: N.Node, isBinding?: boolean): boolean {\n switch (node.type) {\n case \"Identifier\":\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n case \"AssignmentPattern\":\n return true;\n\n case \"ObjectExpression\": {\n const last = node.properties.length - 1;\n return node.properties.every((prop, i) => {\n return (\n prop.type !== \"ObjectMethod\" &&\n (i === last || prop.type === \"SpreadElement\") &&\n this.isAssignable(prop)\n );\n });\n }\n\n case \"ObjectProperty\":\n return this.isAssignable(node.value);\n\n case \"SpreadElement\":\n return this.isAssignable(node.argument);\n\n case \"ArrayExpression\":\n return node.elements.every(element => this.isAssignable(element));\n\n case \"AssignmentExpression\":\n return node.operator === \"=\";\n\n case \"ParenthesizedExpression\":\n case \"TypeCastExpression\":\n return this.isAssignable(node.expression);\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n return !isBinding;\n\n default:\n return false;\n }\n }\n\n toAssignable(node: N.Node): N.Node {\n if (node.type === \"TypeCastExpression\") {\n return super.toAssignable(this.typeCastToParameter(node));\n } else {\n return super.toAssignable(node);\n }\n }\n\n // turn type casts that we found in function parameter head into type annotated params\n toAssignableList(\n exprList: N.Expression[],\n trailingCommaPos?: ?number,\n ): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr && expr.type === \"TypeCastExpression\") {\n exprList[i] = this.typeCastToParameter(expr);\n }\n }\n return super.toAssignableList(exprList, trailingCommaPos);\n }\n\n // this is a list of nodes, from something like a call expression, we need to filter the\n // type casts that we've found that are illegal in this context\n toReferencedList(\n exprList: $ReadOnlyArray,\n isParenthesizedExpr?: boolean,\n ): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (\n expr &&\n expr.type === \"TypeCastExpression\" &&\n (!expr.extra || !expr.extra.parenthesized) &&\n (exprList.length > 1 || !isParenthesizedExpr)\n ) {\n this.raise(\n expr.typeAnnotation.start,\n \"The type cast expression is expected to be wrapped with parenthesis\",\n );\n }\n }\n\n return exprList;\n }\n\n checkLVal(\n expr: N.Expression,\n bindingType: BindingTypes = BIND_NONE,\n checkClashes: ?{ [key: string]: boolean },\n contextDescription: string,\n ): void {\n if (expr.type !== \"TypeCastExpression\") {\n return super.checkLVal(\n expr,\n bindingType,\n checkClashes,\n contextDescription,\n );\n }\n }\n\n // parse class property type annotations\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n if (this.match(tt.colon)) {\n node.typeAnnotation = this.flowParseTypeAnnotation();\n }\n return super.parseClassPrivateProperty(node);\n }\n\n // determine whether or not we're currently in the position where a class method would appear\n isClassMethod(): boolean {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n // determine whether or not we're currently in the position where a class property would appear\n isClassProperty(): boolean {\n return this.match(tt.colon) || super.isClassProperty();\n }\n\n isNonstaticConstructor(method: N.ClassMethod | N.ClassProperty): boolean {\n return !this.match(tt.colon) && super.isNonstaticConstructor(method);\n }\n\n // parse type parameters for class methods\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n if ((method: $FlowFixMe).variance) {\n this.unexpected((method: $FlowFixMe).variance.start);\n }\n delete (method: $FlowFixMe).variance;\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n if ((method: $FlowFixMe).variance) {\n this.unexpected((method: $FlowFixMe).variance.start);\n }\n delete (method: $FlowFixMe).variance;\n if (this.isRelational(\"<\")) {\n method.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n // parse a the super class type parameters and implements\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.flowParseTypeParameterInstantiation();\n }\n if (this.isContextual(\"implements\")) {\n this.next();\n const implemented: N.FlowClassImplements[] = (node.implements = []);\n do {\n const node = this.startNode();\n node.id = this.flowParseRestrictedIdentifier(/*liberal*/ true);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterInstantiation();\n } else {\n node.typeParameters = null;\n }\n implemented.push(this.finishNode(node, \"ClassImplements\"));\n } while (this.eat(tt.comma));\n }\n }\n\n parsePropertyName(\n node: N.ObjectOrClassMember | N.ClassMember | N.TsNamedTypeElementBase,\n isPrivateNameAllowed: boolean,\n ): N.Identifier {\n const variance = this.flowParseVariance();\n const key = super.parsePropertyName(node, isPrivateNameAllowed);\n // $FlowIgnore (\"variance\" not defined on TsNamedTypeElementBase)\n node.variance = variance;\n return key;\n }\n\n // parse type parameters for object method shorthand\n parseObjPropValue(\n prop: N.ObjectMember,\n startPos: ?number,\n startLoc: ?Position,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n refExpressionErrors: ?ExpressionErrors,\n containsEsc: boolean,\n ): void {\n if ((prop: $FlowFixMe).variance) {\n this.unexpected((prop: $FlowFixMe).variance.start);\n }\n delete (prop: $FlowFixMe).variance;\n\n let typeParameters;\n\n // method shorthand\n if (this.isRelational(\"<\")) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(tt.parenL)) this.unexpected();\n }\n\n super.parseObjPropValue(\n prop,\n startPos,\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n refExpressionErrors,\n containsEsc,\n );\n\n // add typeParameters if we found them\n if (typeParameters) {\n (prop.value || prop).typeParameters = typeParameters;\n }\n }\n\n parseAssignableListItemTypes(param: N.Pattern): N.Pattern {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(\n param.start,\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n );\n }\n\n ((param: any): N.Identifier).optional = true;\n }\n if (this.match(tt.colon)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n }\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault(\n startPos?: ?number,\n startLoc?: ?Position,\n left?: ?N.Pattern,\n ): N.Pattern {\n const node = super.parseMaybeDefault(startPos, startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(\n node.typeAnnotation.start,\n \"Type annotations must come before default assignments, \" +\n \"e.g. instead of `age = 25: number` use `age: number = 25`\",\n );\n }\n\n return node;\n }\n\n shouldParseDefaultImport(node: N.ImportDeclaration): boolean {\n if (!hasTypeImportKind(node)) {\n return super.shouldParseDefaultImport(node);\n }\n\n return isMaybeDefaultImport(this.state);\n }\n\n parseImportSpecifierLocal(\n node: N.ImportDeclaration,\n specifier: N.Node,\n type: string,\n contextDescription: string,\n ): void {\n specifier.local = hasTypeImportKind(node)\n ? this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n )\n : this.parseIdentifier();\n\n this.checkLVal(\n specifier.local,\n BIND_LEXICAL,\n undefined,\n contextDescription,\n );\n node.specifiers.push(this.finishNode(specifier, type));\n }\n\n // parse typeof and type imports\n maybeParseDefaultImportSpecifier(node: N.ImportDeclaration): boolean {\n node.importKind = \"value\";\n\n let kind = null;\n if (this.match(tt._typeof)) {\n kind = \"typeof\";\n } else if (this.isContextual(\"type\")) {\n kind = \"type\";\n }\n if (kind) {\n const lh = this.lookahead();\n\n // import type * is not allowed\n if (kind === \"type\" && lh.type === tt.star) {\n this.unexpected(lh.start);\n }\n\n if (\n isMaybeDefaultImport(lh) ||\n lh.type === tt.braceL ||\n lh.type === tt.star\n ) {\n this.next();\n node.importKind = kind;\n }\n }\n\n return super.maybeParseDefaultImportSpecifier(node);\n }\n\n // parse import-type/typeof shorthand\n parseImportSpecifier(node: N.ImportDeclaration): void {\n const specifier = this.startNode();\n const firstIdentLoc = this.state.start;\n const firstIdent = this.parseIdentifier(true);\n\n let specifierTypeKind = null;\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n\n let isBinding = false;\n if (this.isContextual(\"as\") && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (\n specifierTypeKind !== null &&\n !this.match(tt.name) &&\n !this.state.type.keyword\n ) {\n // `import {type as ,` or `import {type as }`\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = as_ident.__clone();\n } else {\n // `import {type as foo`\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else if (\n specifierTypeKind !== null &&\n (this.match(tt.name) || this.state.type.keyword)\n ) {\n // `import {type foo`\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n if (this.eatContextual(\"as\")) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = specifier.imported.__clone();\n }\n } else {\n isBinding = true;\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = specifier.imported.__clone();\n }\n\n const nodeIsTypeImport = hasTypeImportKind(node);\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (nodeIsTypeImport && specifierIsTypeImport) {\n this.raise(\n firstIdentLoc,\n \"The `type` and `typeof` keywords on named imports can only be used on regular \" +\n \"`import` statements. It cannot be used with `import type` or `import typeof` statements\",\n );\n }\n\n if (nodeIsTypeImport || specifierIsTypeImport) {\n this.checkReservedType(\n specifier.local.name,\n specifier.local.start,\n /* declaration */ true,\n );\n }\n\n if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) {\n this.checkReservedWord(\n specifier.local.name,\n specifier.start,\n true,\n true,\n );\n }\n\n this.checkLVal(\n specifier.local,\n BIND_LEXICAL,\n undefined,\n \"import specifier\",\n );\n node.specifiers.push(this.finishNode(specifier, \"ImportSpecifier\"));\n }\n\n // parse function type parameters - function foo() {}\n parseFunctionParams(node: N.Function, allowModifiers?: boolean): void {\n // $FlowFixMe\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.isRelational(\"<\")) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, allowModifiers);\n }\n\n // parse flow type annotations on variable declarator heads - let foo: string = bar\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (this.match(tt.colon)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n // todo description\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n // We need to support type parameter declarations for arrow functions. This\n // is tricky. There are three situations we need to handle\n //\n // 1. This is either JSX or an arrow function. We'll try JSX first. If that\n // fails, we'll try an arrow function. If that fails, we'll throw the JSX\n // error.\n // 2. This is an arrow function. We'll parse the type parameter declaration,\n // parse the rest, make sure the rest is an arrow function, and go from\n // there\n // 3. This is neither. Just call the super method\n parseMaybeAssign(\n noIn?: ?boolean,\n refExpressionErrors?: ?ExpressionErrors,\n afterLeftParse?: Function,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n let state = null;\n\n let jsx;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.isRelational(\"<\"))\n ) {\n state = this.state.clone();\n\n jsx = this.tryParse(\n () =>\n super.parseMaybeAssign(\n noIn,\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n ),\n state,\n );\n /*:: invariant(!jsx.aborted) */\n\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n if (context[context.length - 1] === tc.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === tc.j_expr) {\n context.length -= 1;\n }\n }\n\n if ((jsx && jsx.error) || this.isRelational(\"<\")) {\n state = state || this.state.clone();\n\n let typeParameters;\n\n const arrow = this.tryParse(() => {\n typeParameters = this.flowParseTypeParameterDeclaration();\n\n const arrowExpression = this.forwardNoArrowParamsConversionAt(\n typeParameters,\n () =>\n super.parseMaybeAssign(\n noIn,\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n ),\n );\n arrowExpression.typeParameters = typeParameters;\n this.resetStartLocationFromNode(arrowExpression, typeParameters);\n\n return arrowExpression;\n }, state);\n\n const arrowExpression: ?N.ArrowFunctionExpression =\n arrow.node && arrow.node.type === \"ArrowFunctionExpression\"\n ? arrow.node\n : null;\n\n if (!arrow.error && arrowExpression) return arrowExpression;\n\n // If we are here, both JSX and Flow parsing attemps failed.\n // Give the precedence to the JSX error, except if JSX had an\n // unrecoverable error while Flow didn't.\n // If the error is recoverable, we can only re-report it if there is\n // a node we can return.\n\n if (jsx && jsx.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrowExpression;\n }\n\n if (jsx && jsx.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n /*:: invariant(typeParameters) */\n throw this.raise(\n typeParameters.start,\n \"Expected an arrow function after this type parameter declaration\",\n );\n }\n\n return super.parseMaybeAssign(\n noIn,\n refExpressionErrors,\n afterLeftParse,\n refNeedsArrowPos,\n );\n }\n\n // handle return types for arrow functions\n parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n\n const typeNode = this.startNode();\n\n [\n // $FlowFixMe (destructuring not supported yet)\n typeNode.typeAnnotation,\n // $FlowFixMe (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(tt.arrow)) this.unexpected();\n\n return typeNode;\n });\n\n if (result.thrown) return null;\n /*:: invariant(result.node) */\n\n if (result.error) this.state = result.failState;\n\n // assign after it is clear it is an arrow\n node.returnType = result.node.typeAnnotation\n ? this.finishNode(result.node, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseArrow();\n }\n\n setArrowFunctionParameters(\n node: N.ArrowFunctionExpression,\n params: N.Expression[],\n ): void {\n if (this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1) {\n node.params = params;\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(\n node: N.Function,\n allowDuplicates: boolean,\n isArrowFunction: ?boolean,\n ): void {\n if (\n isArrowFunction &&\n this.state.noArrowParamsConversionAt.indexOf(node.start) !== -1\n ) {\n return;\n }\n\n return super.checkParams(...arguments);\n }\n\n parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {\n return super.parseParenAndDistinguishExpression(\n canBeArrow && this.state.noArrowAt.indexOf(this.state.start) === -1,\n );\n }\n\n parseSubscripts(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls?: ?boolean,\n ): N.Expression {\n if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.noArrowAt.indexOf(startPos) !== -1\n ) {\n this.next();\n\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n base = this.finishNode(node, \"CallExpression\");\n } else if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.isRelational(\"<\")\n ) {\n const state = this.state.clone();\n const arrow = this.tryParse(\n abort =>\n this.parseAsyncArrowWithTypeParameters(startPos, startLoc) ||\n abort(),\n state,\n );\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n const result = this.tryParse(\n () => super.parseSubscripts(base, startPos, startLoc, noCalls),\n state,\n );\n\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n\n throw arrow.error || result.error;\n }\n\n return super.parseSubscripts(base, startPos, startLoc, noCalls);\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n subscriptState: N.ParseSubscriptState,\n ): N.Expression {\n if (this.match(tt.questionDot) && this.isLookaheadRelational(\"<\")) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node: N.OptionalCallExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n node.callee = base;\n node.typeArguments = this.flowParseTypeParameterInstantiation();\n this.expect(tt.parenL);\n // $FlowFixMe\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n node.optional = true;\n return this.finishCallExpression(node, /* optional */ true);\n } else if (\n !noCalls &&\n this.shouldParseTypes() &&\n this.isRelational(\"<\")\n ) {\n const node = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n\n const result = this.tryParse(() => {\n node.typeArguments = this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(tt.parenL);\n node.arguments = this.parseCallExpressionArguments(tt.parenR, false);\n if (subscriptState.optionalChainMember) node.optional = false;\n return this.finishCallExpression(\n node,\n subscriptState.optionalChainMember,\n );\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(\n base,\n startPos,\n startLoc,\n noCalls,\n subscriptState,\n );\n }\n\n parseNewArguments(node: N.NewExpression): void {\n let targs = null;\n if (this.shouldParseTypes() && this.isRelational(\"<\")) {\n targs = this.tryParse(() =>\n this.flowParseTypeParameterInstantiationCallOrNew(),\n ).node;\n }\n node.typeArguments = targs;\n\n super.parseNewArguments(node);\n }\n\n parseAsyncArrowWithTypeParameters(\n startPos: number,\n startLoc: Position,\n ): ?N.ArrowFunctionExpression {\n const node = this.startNodeAt(startPos, startLoc);\n this.parseFunctionParams(node);\n if (!this.parseArrow(node)) return;\n return this.parseArrowExpression(\n node,\n /* params */ undefined,\n /* isAsync */ true,\n );\n }\n\n readToken_mult_modulo(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.asterisk &&\n next === charCodes.slash &&\n this.state.hasFlowComment\n ) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.verticalBar &&\n next === charCodes.rightCurlyBrace\n ) {\n // '|}'\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file: N.File, program: N.Program): N.File {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(this.state.pos, \"Unterminated flow-comment\");\n }\n return fileNode;\n }\n\n skipBlockComment(): void {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n this.unexpected(\n null,\n \"Cannot have a flow comment inside another flow comment\",\n );\n }\n this.hasFlowCommentCompletion();\n this.state.pos += this.skipFlowComment();\n this.state.hasFlowComment = true;\n return;\n }\n\n if (this.state.hasFlowComment) {\n const end = this.input.indexOf(\"*-/\", (this.state.pos += 2));\n if (end === -1) {\n throw this.raise(this.state.pos - 2, \"Unterminated comment\");\n }\n this.state.pos = end + 3;\n return;\n }\n\n super.skipBlockComment();\n }\n\n skipFlowComment(): number | boolean {\n const { pos } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while (\n [charCodes.space, charCodes.tab].includes(\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace),\n )\n ) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === charCodes.colon && ch3 === charCodes.colon) {\n return shiftToFirstNonWhiteSpace + 2; // check for /*::\n }\n if (\n this.input.slice(\n shiftToFirstNonWhiteSpace + pos,\n shiftToFirstNonWhiteSpace + pos + 12,\n ) === \"flow-include\"\n ) {\n return shiftToFirstNonWhiteSpace + 12; // check for /*flow-include\n }\n if (ch2 === charCodes.colon && ch3 !== charCodes.colon) {\n return shiftToFirstNonWhiteSpace; // check for /*:, advance up to :\n }\n return false;\n }\n\n hasFlowCommentCompletion(): void {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(this.state.pos, \"Unterminated comment\");\n }\n }\n\n // Flow enum parsing\n\n flowEnumErrorBooleanMemberNotInitialized(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(\n pos,\n `Boolean enum members need to be initialized. Use either \\`${memberName} = true,\\` ` +\n `or \\`${memberName} = false,\\` in enum \\`${enumName}\\`.`,\n );\n }\n\n flowEnumErrorInvalidMemberName(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n const suggestion = memberName[0].toUpperCase() + memberName.slice(1);\n this.raise(\n pos,\n `Enum member names cannot start with lowercase 'a' through 'z'. Instead of using ` +\n `\\`${memberName}\\`, consider using \\`${suggestion}\\`, in enum \\`${enumName}\\`.`,\n );\n }\n\n flowEnumErrorDuplicateMemberName(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(\n pos,\n `Enum member names need to be unique, but the name \\`${memberName}\\` has already been used ` +\n `before in enum \\`${enumName}\\`.`,\n );\n }\n\n flowEnumErrorInconsistentMemberValues(\n pos: number,\n { enumName }: { enumName: string },\n ): void {\n this.raise(\n pos,\n `Enum \\`${enumName}\\` has inconsistent member initializers. Either use no initializers, or ` +\n `consistently use literals (either booleans, numbers, or strings) for all member initializers.`,\n );\n }\n\n flowEnumErrorInvalidExplicitType(\n pos: number,\n {\n enumName,\n suppliedType,\n }: { enumName: string, suppliedType: null | string },\n ) {\n const suggestion =\n `Use one of \\`boolean\\`, \\`number\\`, \\`string\\`, or \\`symbol\\` in ` +\n `enum \\`${enumName}\\`.`;\n const message =\n suppliedType === null\n ? `Supplied enum type is not valid. ${suggestion}`\n : `Enum type \\`${suppliedType}\\` is not valid. ${suggestion}`;\n return this.raise(pos, message);\n }\n\n flowEnumErrorInvalidMemberInitializer(\n pos: number,\n { enumName, explicitType, memberName }: EnumContext,\n ) {\n let message = null;\n switch (explicitType) {\n case \"boolean\":\n case \"number\":\n case \"string\":\n message =\n `Enum \\`${enumName}\\` has type \\`${explicitType}\\`, so the initializer of ` +\n `\\`${memberName}\\` needs to be a ${explicitType} literal.`;\n break;\n case \"symbol\":\n message =\n `Symbol enum members cannot be initialized. Use \\`${memberName},\\` in ` +\n `enum \\`${enumName}\\`.`;\n break;\n default:\n // null\n message =\n `The enum member initializer for \\`${memberName}\\` needs to be a literal (either ` +\n `a boolean, number, or string) in enum \\`${enumName}\\`.`;\n }\n return this.raise(pos, message);\n }\n\n flowEnumErrorNumberMemberNotInitialized(\n pos: number,\n { enumName, memberName }: { enumName: string, memberName: string },\n ): void {\n this.raise(\n pos,\n `Number enum members need to be initialized, e.g. \\`${memberName} = 1\\` in enum \\`${enumName}\\`.`,\n );\n }\n\n flowEnumErrorStringMemberInconsistentlyInitailized(\n pos: number,\n { enumName }: { enumName: string },\n ): void {\n this.raise(\n pos,\n `String enum members need to consistently either all use initializers, or use no initializers, ` +\n `in enum \\`${enumName}\\`.`,\n );\n }\n\n flowEnumMemberInit(): EnumMemberInit {\n const startPos = this.state.start;\n const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);\n switch (this.state.type) {\n case tt.num: {\n const literal = this.parseLiteral(this.state.value, \"NumericLiteral\");\n if (endOfInit()) {\n return { type: \"number\", pos: literal.start, value: literal };\n }\n return { type: \"invalid\", pos: startPos };\n }\n case tt.string: {\n const literal = this.parseLiteral(this.state.value, \"StringLiteral\");\n if (endOfInit()) {\n return { type: \"string\", pos: literal.start, value: literal };\n }\n return { type: \"invalid\", pos: startPos };\n }\n case tt._true:\n case tt._false: {\n const literal = this.parseBooleanLiteral();\n if (endOfInit()) {\n return {\n type: \"boolean\",\n pos: literal.start,\n value: literal,\n };\n }\n return { type: \"invalid\", pos: startPos };\n }\n default:\n return { type: \"invalid\", pos: startPos };\n }\n }\n\n flowEnumMemberRaw(): { id: N.Node, init: EnumMemberInit } {\n const pos = this.state.start;\n const id = this.parseIdentifier(true);\n const init = this.eat(tt.eq)\n ? this.flowEnumMemberInit()\n : { type: \"none\", pos };\n return { id, init };\n }\n\n flowEnumCheckExplicitTypeMismatch(\n pos: number,\n context: EnumContext,\n expectedType: EnumExplicitType,\n ): void {\n const { explicitType } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(pos, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType,\n }: {\n enumName: string,\n explicitType: EnumExplicitType,\n }): {|\n booleanMembers: Array,\n numberMembers: Array,\n stringMembers: Array,\n defaultedMembers: Array,\n |} {\n const seenNames = new Set();\n const members = {\n booleanMembers: [],\n numberMembers: [],\n stringMembers: [],\n defaultedMembers: [],\n };\n while (!this.match(tt.braceR)) {\n const memberNode = this.startNode();\n const { id, init } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.flowEnumErrorInvalidMemberName(id.start, {\n enumName,\n memberName,\n });\n }\n if (seenNames.has(memberName)) {\n this.flowEnumErrorDuplicateMemberName(id.start, {\n enumName,\n memberName,\n });\n }\n seenNames.add(memberName);\n const context = { enumName, explicitType, memberName };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\": {\n this.flowEnumCheckExplicitTypeMismatch(\n init.pos,\n context,\n \"boolean\",\n );\n memberNode.init = init.value;\n members.booleanMembers.push(\n this.finishNode(memberNode, \"EnumBooleanMember\"),\n );\n break;\n }\n case \"number\": {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(\n this.finishNode(memberNode, \"EnumNumberMember\"),\n );\n break;\n }\n case \"string\": {\n this.flowEnumCheckExplicitTypeMismatch(init.pos, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(\n this.finishNode(memberNode, \"EnumStringMember\"),\n );\n break;\n }\n case \"invalid\": {\n throw this.flowEnumErrorInvalidMemberInitializer(init.pos, context);\n }\n case \"none\": {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(\n init.pos,\n context,\n );\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.pos, context);\n break;\n default:\n members.defaultedMembers.push(\n this.finishNode(memberNode, \"EnumDefaultedMember\"),\n );\n }\n }\n }\n\n if (!this.match(tt.braceR)) {\n this.expect(tt.comma);\n }\n }\n return members;\n }\n\n flowEnumStringMembers(\n initializedMembers: Array,\n defaultedMembers: Array,\n { enumName }: { enumName: string },\n ): Array {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(\n member.start,\n { enumName },\n );\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitailized(\n member.start,\n { enumName },\n );\n }\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName,\n }: {\n enumName: string,\n }): EnumExplicitType {\n if (this.eatContextual(\"of\")) {\n if (!this.match(tt.name)) {\n throw this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: null,\n });\n }\n\n const { value } = this.state;\n this.next();\n\n if (\n value !== \"boolean\" &&\n value !== \"number\" &&\n value !== \"string\" &&\n value !== \"symbol\"\n ) {\n this.flowEnumErrorInvalidExplicitType(this.state.start, {\n enumName,\n suppliedType: value,\n });\n }\n\n return value;\n }\n return null;\n }\n\n flowEnumBody(node: N.Node, { enumName, nameLoc }): N.Node {\n const explicitType = this.flowEnumParseExplicitType({ enumName });\n this.expect(tt.braceL);\n const members = this.flowEnumMembers({ enumName, explicitType });\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n default: {\n // `explicitType` is `null`\n const empty = () => {\n node.members = [];\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.flowEnumErrorInconsistentMemberValues(nameLoc, { enumName });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(node: N.Node): N.Node {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), {\n enumName: id.name,\n nameLoc: id.start,\n });\n return this.finishNode(node, \"EnumDeclaration\");\n }\n };\n","// @flow\n\nconst entities: { [name: string]: string } = {\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\",\n};\nexport default entities;\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\nimport XHTMLEntities from \"./xhtml\";\nimport type Parser from \"../../parser\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport { TokenType, types as tt } from \"../../tokenizer/types\";\nimport { TokContext, types as tc } from \"../../tokenizer/context\";\nimport * as N from \"../../types\";\nimport { isIdentifierChar, isIdentifierStart } from \"../../util/identifier\";\nimport type { Position } from \"../../util/location\";\nimport { isNewLine } from \"../../util/whitespace\";\n\nconst HEX_NUMBER = /^[\\da-fA-F]+$/;\nconst DECIMAL_NUMBER = /^\\d+$/;\n\n// Be aware that this file is always executed and not only when the plugin is enabled.\n// Therefore this contexts and tokens do always exist.\ntc.j_oTag = new TokContext(\"... \", true, true);\n\ntt.jsxName = new TokenType(\"jsxName\");\ntt.jsxText = new TokenType(\"jsxText\", { beforeExpr: true });\ntt.jsxTagStart = new TokenType(\"jsxTagStart\", { startsExpr: true });\ntt.jsxTagEnd = new TokenType(\"jsxTagEnd\");\n\ntt.jsxTagStart.updateContext = function() {\n this.state.context.push(tc.j_expr); // treat as beginning of JSX expression\n this.state.context.push(tc.j_oTag); // start opening tag context\n this.state.exprAllowed = false;\n};\n\ntt.jsxTagEnd.updateContext = function(prevType) {\n const out = this.state.context.pop();\n if ((out === tc.j_oTag && prevType === tt.slash) || out === tc.j_cTag) {\n this.state.context.pop();\n this.state.exprAllowed = this.curContext() === tc.j_expr;\n } else {\n this.state.exprAllowed = true;\n }\n};\n\nfunction isFragment(object: ?N.JSXElement): boolean {\n return object\n ? object.type === \"JSXOpeningFragment\" ||\n object.type === \"JSXClosingFragment\"\n : false;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(\n object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,\n): string {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return (\n getQualifiedJSXName(object.object) +\n \".\" +\n getQualifiedJSXName(object.property)\n );\n }\n\n // istanbul ignore next\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n // Reads inline JSX contents token.\n\n jsxReadToken(): void {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, \"Unterminated JSX contents\");\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case charCodes.lessThan:\n case charCodes.leftCurlyBrace:\n if (this.state.pos === this.state.start) {\n if (ch === charCodes.lessThan && this.state.exprAllowed) {\n ++this.state.pos;\n return this.finishToken(tt.jsxTagStart);\n }\n return super.getTokenFromCode(ch);\n }\n out += this.input.slice(chunkStart, this.state.pos);\n return this.finishToken(tt.jsxText, out);\n\n case charCodes.ampersand:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF: boolean): string {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (\n ch === charCodes.carriageReturn &&\n this.input.charCodeAt(this.state.pos) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n\n return out;\n }\n\n jsxReadString(quote: number): void {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(this.state.start, \"Unterminated string constant\");\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === charCodes.ampersand) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n return this.finishToken(tt.string, out);\n }\n\n jsxReadEntity(): string {\n let str = \"\";\n let count = 0;\n let entity;\n let ch = this.input[this.state.pos];\n\n const startPos = ++this.state.pos;\n while (this.state.pos < this.length && count++ < 10) {\n ch = this.input[this.state.pos++];\n if (ch === \";\") {\n if (str[0] === \"#\") {\n if (str[1] === \"x\") {\n str = str.substr(2);\n if (HEX_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 16));\n }\n } else {\n str = str.substr(1);\n if (DECIMAL_NUMBER.test(str)) {\n entity = String.fromCodePoint(parseInt(str, 10));\n }\n }\n } else {\n entity = XHTMLEntities[str];\n }\n break;\n }\n str += ch;\n }\n if (!entity) {\n this.state.pos = startPos;\n return \"&\";\n }\n return entity;\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can\"t contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsxReadWord(): void {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === charCodes.dash);\n return this.finishToken(\n tt.jsxName,\n this.input.slice(start, this.state.pos),\n );\n }\n\n // Parse next token as JSX identifier\n\n jsxParseIdentifier(): N.JSXIdentifier {\n const node = this.startNode();\n if (this.match(tt.jsxName)) {\n node.name = this.state.value;\n } else if (this.state.type.keyword) {\n node.name = this.state.type.keyword;\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n // Parse namespaced identifier.\n\n jsxParseNamespacedName(): N.JSXNamespacedName {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(tt.colon)) return name;\n\n const node = this.startNodeAt(startPos, startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsxParseElementName():\n | N.JSXIdentifier\n | N.JSXNamespacedName\n | N.JSXMemberExpression {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n let node = this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(tt.dot)) {\n const newNode = this.startNodeAt(startPos, startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsxParseAttributeValue(): N.Expression {\n let node;\n switch (this.state.type) {\n case tt.braceL:\n node = this.startNode();\n this.next();\n node = this.jsxParseExpressionContainer(node);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(\n node.start,\n \"JSX attributes must only be assigned a non-empty expression\",\n );\n }\n return node;\n\n case tt.jsxTagStart:\n case tt.string:\n return this.parseExprAtom();\n\n default:\n throw this.raise(\n this.state.start,\n \"JSX value should be either an expression or a quoted JSX text\",\n );\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsxParseEmptyExpression(): N.JSXEmptyExpression {\n const node = this.startNodeAt(\n this.state.lastTokEnd,\n this.state.lastTokEndLoc,\n );\n return this.finishNodeAt(\n node,\n \"JSXEmptyExpression\",\n this.state.start,\n this.state.startLoc,\n );\n }\n\n // Parse JSX spread child\n\n jsxParseSpreadChild(node: N.JSXSpreadChild): N.JSXSpreadChild {\n this.next(); // ellipsis\n node.expression = this.parseExpression();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsxParseExpressionContainer(\n node: N.JSXExpressionContainer,\n ): N.JSXExpressionContainer {\n if (this.match(tt.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n node.expression = this.parseExpression();\n }\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsxParseAttribute(): N.JSXAttribute {\n const node = this.startNode();\n if (this.eat(tt.braceL)) {\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssign();\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n // Parses JSX opening tag starting after \"<\".\n\n jsxParseOpeningElementAt(\n startPos: number,\n startLoc: Position,\n ): N.JSXOpeningElement {\n const node = this.startNodeAt(startPos, startLoc);\n if (this.match(tt.jsxTagEnd)) {\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(node);\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n const attributes: N.JSXAttribute[] = [];\n while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(tt.slash);\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n // Parses JSX closing tag starting after \"\".\n\n jsxParseClosingElementAt(\n startPos: number,\n startLoc: Position,\n ): N.JSXClosingElement {\n const node = this.startNodeAt(startPos, startLoc);\n if (this.match(tt.jsxTagEnd)) {\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n node.name = this.jsxParseElementName();\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n // Parses entire JSX element, including it\"s opening tag\n // (starting after \"<\"), attributes, contents and closing tag.\n\n jsxParseElementAt(startPos: number, startLoc: Position): N.JSXElement {\n const node = this.startNodeAt(startPos, startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);\n let closingElement = null;\n\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case tt.jsxTagStart:\n startPos = this.state.start;\n startLoc = this.state.startLoc;\n this.next();\n if (this.eat(tt.slash)) {\n closingElement = this.jsxParseClosingElementAt(\n startPos,\n startLoc,\n );\n break contents;\n }\n children.push(this.jsxParseElementAt(startPos, startLoc));\n break;\n\n case tt.jsxText:\n children.push(this.parseExprAtom());\n break;\n\n case tt.braceL: {\n const node = this.startNode();\n this.next();\n if (this.match(tt.ellipsis)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(this.jsxParseExpressionContainer(node));\n }\n\n break;\n }\n // istanbul ignore next - should never happen\n default:\n throw this.unexpected();\n }\n }\n\n if (isFragment(openingElement) && !isFragment(closingElement)) {\n this.raise(\n // $FlowIgnore\n closingElement.start,\n \"Expected corresponding JSX closing tag for <>\",\n );\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(\n // $FlowIgnore\n closingElement.start,\n \"Expected corresponding JSX closing tag for <\" +\n getQualifiedJSXName(openingElement.name) +\n \">\",\n );\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (\n // $FlowIgnore\n getQualifiedJSXName(closingElement.name) !==\n getQualifiedJSXName(openingElement.name)\n ) {\n this.raise(\n // $FlowIgnore\n closingElement.start,\n \"Expected corresponding JSX closing tag for <\" +\n getQualifiedJSXName(openingElement.name) +\n \">\",\n );\n }\n }\n }\n\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n node.children = children;\n if (this.isRelational(\"<\")) {\n throw this.raise(\n this.state.start,\n \"Adjacent JSX elements must be wrapped in an enclosing tag. \" +\n \"Did you want a JSX fragment <>...>?\",\n );\n }\n\n return isFragment(openingElement)\n ? this.finishNode(node, \"JSXFragment\")\n : this.finishNode(node, \"JSXElement\");\n }\n\n // Parses entire JSX element from current position.\n\n jsxParseElement(): N.JSXElement {\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startPos, startLoc);\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseExprAtom(refExpressionErrors: ?ExpressionErrors): N.Expression {\n if (this.match(tt.jsxText)) {\n return this.parseLiteral(this.state.value, \"JSXText\");\n } else if (this.match(tt.jsxTagStart)) {\n return this.jsxParseElement();\n } else if (\n this.isRelational(\"<\") &&\n this.input.charCodeAt(this.state.pos) !== charCodes.exclamationMark\n ) {\n // In case we encounter an lt token here it will always be the start of\n // jsx as the lt sign is not allowed in places that expect an expression\n this.finishToken(tt.jsxTagStart);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n getTokenFromCode(code: number): void {\n if (this.state.inPropertyName) return super.getTokenFromCode(code);\n\n const context = this.curContext();\n\n if (context === tc.j_expr) {\n return this.jsxReadToken();\n }\n\n if (context === tc.j_oTag || context === tc.j_cTag) {\n if (isIdentifierStart(code)) {\n return this.jsxReadWord();\n }\n\n if (code === charCodes.greaterThan) {\n ++this.state.pos;\n return this.finishToken(tt.jsxTagEnd);\n }\n\n if (\n (code === charCodes.quotationMark || code === charCodes.apostrophe) &&\n context === tc.j_oTag\n ) {\n return this.jsxReadString(code);\n }\n }\n\n if (\n code === charCodes.lessThan &&\n this.state.exprAllowed &&\n this.input.charCodeAt(this.state.pos + 1) !== charCodes.exclamationMark\n ) {\n ++this.state.pos;\n return this.finishToken(tt.jsxTagStart);\n }\n\n return super.getTokenFromCode(code);\n }\n\n updateContext(prevType: TokenType): void {\n if (this.match(tt.braceL)) {\n const curContext = this.curContext();\n if (curContext === tc.j_oTag) {\n this.state.context.push(tc.braceExpression);\n } else if (curContext === tc.j_expr) {\n this.state.context.push(tc.templateQuasi);\n } else {\n super.updateContext(prevType);\n }\n this.state.exprAllowed = true;\n } else if (this.match(tt.slash) && prevType === tt.jsxTagStart) {\n this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore\n this.state.context.push(tc.j_cTag); // reconsider as closing tag context\n this.state.exprAllowed = false;\n } else {\n return super.updateContext(prevType);\n }\n }\n };\n","// @flow\nimport {\n SCOPE_ARROW,\n SCOPE_DIRECT_SUPER,\n SCOPE_FUNCTION,\n SCOPE_SIMPLE_CATCH,\n SCOPE_SUPER,\n SCOPE_PROGRAM,\n SCOPE_VAR,\n SCOPE_CLASS,\n BIND_SCOPE_FUNCTION,\n BIND_SCOPE_VAR,\n BIND_SCOPE_LEXICAL,\n BIND_KIND_VALUE,\n type ScopeFlags,\n type BindingTypes,\n} from \"./scopeflags\";\nimport * as N from \"../types\";\n\n// Start an AST node, attaching a start offset.\nexport class Scope {\n flags: ScopeFlags;\n // A list of var-declared names in the current lexical scope\n var: string[] = [];\n // A list of lexically-declared names in the current lexical scope\n lexical: string[] = [];\n // A list of lexically-declared FunctionDeclaration names in the current lexical scope\n functions: string[] = [];\n\n constructor(flags: ScopeFlags) {\n this.flags = flags;\n }\n}\n\ntype raiseFunction = (number, string) => void;\n\n// The functions in this module keep track of declared variables in the\n// current scope in order to detect duplicate variable names.\nexport default class ScopeHandler {\n scopeStack: Array = [];\n raise: raiseFunction;\n inModule: boolean;\n undefinedExports: Map = new Map();\n undefinedPrivateNames: Map = new Map();\n\n constructor(raise: raiseFunction, inModule: boolean) {\n this.raise = raise;\n this.inModule = inModule;\n }\n\n get inFunction() {\n return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0;\n }\n get allowSuper() {\n return (this.currentThisScope().flags & SCOPE_SUPER) > 0;\n }\n get allowDirectSuper() {\n return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0;\n }\n get inClass() {\n return (this.currentThisScope().flags & SCOPE_CLASS) > 0;\n }\n get inNonArrowFunction() {\n return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0;\n }\n get treatFunctionsAsVar() {\n return this.treatFunctionsAsVarInScope(this.currentScope());\n }\n\n createScope(flags: ScopeFlags): Scope {\n return new Scope(flags);\n }\n // This method will be overwritten by subclasses\n /*:: +createScope: (flags: ScopeFlags) => IScope; */\n\n enter(flags: ScopeFlags) {\n this.scopeStack.push(this.createScope(flags));\n }\n\n exit() {\n this.scopeStack.pop();\n }\n\n // The spec says:\n // > At the top level of a function, or script, function declarations are\n // > treated like var declarations rather than like lexical declarations.\n treatFunctionsAsVarInScope(scope: IScope): boolean {\n return !!(\n scope.flags & SCOPE_FUNCTION ||\n (!this.inModule && scope.flags & SCOPE_PROGRAM)\n );\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n let scope = this.currentScope();\n if (bindingType & BIND_SCOPE_LEXICAL || bindingType & BIND_SCOPE_FUNCTION) {\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n scope.functions.push(name);\n } else {\n scope.lexical.push(name);\n }\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n this.maybeExportDefined(scope, name);\n }\n } else if (bindingType & BIND_SCOPE_VAR) {\n for (let i = this.scopeStack.length - 1; i >= 0; --i) {\n scope = this.scopeStack[i];\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n scope.var.push(name);\n this.maybeExportDefined(scope, name);\n\n if (scope.flags & SCOPE_VAR) break;\n }\n }\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n maybeExportDefined(scope: IScope, name: string) {\n if (this.inModule && scope.flags & SCOPE_PROGRAM) {\n this.undefinedExports.delete(name);\n }\n }\n\n checkRedeclarationInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n pos: number,\n ) {\n if (this.isRedeclaredInScope(scope, name, bindingType)) {\n this.raise(pos, `Identifier '${name}' has already been declared`);\n }\n }\n\n isRedeclaredInScope(\n scope: IScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (!(bindingType & BIND_KIND_VALUE)) return false;\n\n if (bindingType & BIND_SCOPE_LEXICAL) {\n return (\n scope.lexical.indexOf(name) > -1 ||\n scope.functions.indexOf(name) > -1 ||\n scope.var.indexOf(name) > -1\n );\n }\n\n if (bindingType & BIND_SCOPE_FUNCTION) {\n return (\n scope.lexical.indexOf(name) > -1 ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n scope.var.indexOf(name) > -1)\n );\n }\n\n return (\n (scope.lexical.indexOf(name) > -1 &&\n !(scope.flags & SCOPE_SIMPLE_CATCH && scope.lexical[0] === name)) ||\n (!this.treatFunctionsAsVarInScope(scope) &&\n scope.functions.indexOf(name) > -1)\n );\n }\n\n checkLocalExport(id: N.Identifier) {\n if (\n this.scopeStack[0].lexical.indexOf(id.name) === -1 &&\n this.scopeStack[0].var.indexOf(id.name) === -1 &&\n // In strict mode, scope.functions will always be empty.\n // Modules are strict by default, but the `scriptMode` option\n // can overwrite this behavior.\n this.scopeStack[0].functions.indexOf(id.name) === -1\n ) {\n this.undefinedExports.set(id.name, id.start);\n }\n }\n\n currentScope(): IScope {\n return this.scopeStack[this.scopeStack.length - 1];\n }\n\n // $FlowIgnore\n currentVarScope(): IScope {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const scope = this.scopeStack[i];\n if (scope.flags & SCOPE_VAR) {\n return scope;\n }\n }\n }\n\n // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`.\n // $FlowIgnore\n currentThisScope(): IScope {\n for (let i = this.scopeStack.length - 1; ; i--) {\n const scope = this.scopeStack[i];\n if (\n (scope.flags & SCOPE_VAR || scope.flags & SCOPE_CLASS) &&\n !(scope.flags & SCOPE_ARROW)\n ) {\n return scope;\n }\n }\n }\n}\n","// @flow\n\nimport ScopeHandler, { Scope } from \"../../util/scope\";\nimport {\n BIND_KIND_TYPE,\n BIND_FLAGS_TS_ENUM,\n BIND_FLAGS_TS_CONST_ENUM,\n BIND_FLAGS_TS_EXPORT_ONLY,\n BIND_KIND_VALUE,\n BIND_FLAGS_CLASS,\n type ScopeFlags,\n type BindingTypes,\n} from \"../../util/scopeflags\";\nimport * as N from \"../../types\";\n\nclass TypeScriptScope extends Scope {\n types: string[] = [];\n\n // enums (which are also in .types)\n enums: string[] = [];\n\n // const enums (which are also in .enums and .types)\n constEnums: string[] = [];\n\n // classes (which are also in .lexical) and interface (which are also in .types)\n classes: string[] = [];\n\n // namespaces and ambient functions (or classes) are too difficult to track,\n // especially without type analysis.\n // We need to track them anyway, to avoid \"X is not defined\" errors\n // when exporting them.\n exportOnlyBindings: string[] = [];\n}\n\n// See https://github.com/babel/babel/pull/9766#discussion_r268920730 for an\n// explanation of how typescript handles scope.\n\nexport default class TypeScriptScopeHandler extends ScopeHandler {\n createScope(flags: ScopeFlags): TypeScriptScope {\n return new TypeScriptScope(flags);\n }\n\n declareName(name: string, bindingType: BindingTypes, pos: number) {\n const scope = this.currentScope();\n if (bindingType & BIND_FLAGS_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.exportOnlyBindings.push(name);\n return;\n }\n\n super.declareName(...arguments);\n\n if (bindingType & BIND_KIND_TYPE) {\n if (!(bindingType & BIND_KIND_VALUE)) {\n // \"Value\" bindings have already been registered by the superclass.\n this.checkRedeclarationInScope(scope, name, bindingType, pos);\n this.maybeExportDefined(scope, name);\n }\n scope.types.push(name);\n }\n if (bindingType & BIND_FLAGS_TS_ENUM) scope.enums.push(name);\n if (bindingType & BIND_FLAGS_TS_CONST_ENUM) scope.constEnums.push(name);\n if (bindingType & BIND_FLAGS_CLASS) scope.classes.push(name);\n }\n\n isRedeclaredInScope(\n scope: TypeScriptScope,\n name: string,\n bindingType: BindingTypes,\n ): boolean {\n if (scope.enums.indexOf(name) > -1) {\n if (bindingType & BIND_FLAGS_TS_ENUM) {\n // Enums can be merged with other enums if they are both\n // const or both non-const.\n const isConst = !!(bindingType & BIND_FLAGS_TS_CONST_ENUM);\n const wasConst = scope.constEnums.indexOf(name) > -1;\n return isConst !== wasConst;\n }\n return true;\n }\n if (bindingType & BIND_FLAGS_CLASS && scope.classes.indexOf(name) > -1) {\n if (scope.lexical.indexOf(name) > -1) {\n // Classes can be merged with interfaces\n return !!(bindingType & BIND_KIND_VALUE);\n } else {\n // Interface can be merged with other classes or interfaces\n return false;\n }\n }\n if (bindingType & BIND_KIND_TYPE && scope.types.indexOf(name) > -1) {\n return true;\n }\n\n return super.isRedeclaredInScope(...arguments);\n }\n\n checkLocalExport(id: N.Identifier) {\n if (\n this.scopeStack[0].types.indexOf(id.name) === -1 &&\n this.scopeStack[0].exportOnlyBindings.indexOf(id.name) === -1\n ) {\n super.checkLocalExport(id);\n }\n }\n}\n","// @flow\nexport const PARAM = 0b000, // Initial Parameter flags\n PARAM_YIELD = 0b001, // track [Yield] production parameter\n PARAM_AWAIT = 0b010, // track [Await] production parameter\n PARAM_RETURN = 0b100; // track [Return] production parameter\n\n// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above. Note that the [In] parameter is\n// tracked in `noIn` argument of `parseExpression`.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport type ParamKind = typeof PARAM | typeof PARAM_AWAIT | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array = [];\n enter(flags: ParamKind) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): ParamKind {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & PARAM_RETURN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (isAsync ? PARAM_AWAIT : 0) | (isGenerator ? PARAM_YIELD : 0);\n}\n","// @flow\n\n/*:: declare var invariant; */\n\nimport type { TokenType } from \"../../tokenizer/types\";\nimport type State from \"../../tokenizer/state\";\nimport { types as tt } from \"../../tokenizer/types\";\nimport { types as ct } from \"../../tokenizer/context\";\nimport * as N from \"../../types\";\nimport type { Pos, Position } from \"../../util/location\";\nimport type Parser from \"../../parser\";\nimport {\n type BindingTypes,\n BIND_NONE,\n SCOPE_TS_MODULE,\n SCOPE_OTHER,\n BIND_TS_ENUM,\n BIND_TS_CONST_ENUM,\n BIND_TS_TYPE,\n BIND_TS_INTERFACE,\n BIND_TS_AMBIENT,\n BIND_TS_NAMESPACE,\n BIND_CLASS,\n BIND_LEXICAL,\n} from \"../../util/scopeflags\";\nimport TypeScriptScopeHandler from \"./scope\";\nimport * as charCodes from \"charcodes\";\nimport type { ExpressionErrors } from \"../../parser/util\";\nimport { PARAM } from \"../../util/production-parameter\";\n\ntype TsModifier =\n | \"readonly\"\n | \"abstract\"\n | \"declare\"\n | \"static\"\n | \"public\"\n | \"private\"\n | \"protected\";\n\nfunction nonNull(x: ?T): T {\n if (x == null) {\n // $FlowIgnore\n throw new Error(`Unexpected ${x} value.`);\n }\n return x;\n}\n\nfunction assert(x: boolean): void {\n if (!x) {\n throw new Error(\"Assert fail\");\n }\n}\n\ntype ParsingContext =\n | \"EnumMembers\"\n | \"HeritageClauseElement\"\n | \"TupleElementTypes\"\n | \"TypeMembers\"\n | \"TypeParametersOrArguments\";\n\n// Doesn't handle \"void\" or \"null\" because those are keywords, not identifiers.\nfunction keywordTypeFromName(\n value: string,\n): N.TsKeywordTypeType | typeof undefined {\n switch (value) {\n case \"any\":\n return \"TSAnyKeyword\";\n case \"boolean\":\n return \"TSBooleanKeyword\";\n case \"bigint\":\n return \"TSBigIntKeyword\";\n case \"never\":\n return \"TSNeverKeyword\";\n case \"number\":\n return \"TSNumberKeyword\";\n case \"object\":\n return \"TSObjectKeyword\";\n case \"string\":\n return \"TSStringKeyword\";\n case \"symbol\":\n return \"TSSymbolKeyword\";\n case \"undefined\":\n return \"TSUndefinedKeyword\";\n case \"unknown\":\n return \"TSUnknownKeyword\";\n default:\n return undefined;\n }\n}\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n getScopeHandler(): Class {\n return TypeScriptScopeHandler;\n }\n\n tsIsIdentifier(): boolean {\n // TODO: actually a bit more complex in TypeScript, but shouldn't matter.\n // See https://github.com/Microsoft/TypeScript/issues/15008\n return this.match(tt.name);\n }\n\n tsNextTokenCanFollowModifier() {\n // Note: TypeScript's implementation is much more complicated because\n // more things are considered modifiers there.\n // This implementation only handles modifiers not handled by @babel/parser itself. And \"static\".\n // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method...\n this.next();\n return (\n !this.hasPrecedingLineBreak() &&\n !this.match(tt.parenL) &&\n !this.match(tt.parenR) &&\n !this.match(tt.colon) &&\n !this.match(tt.eq) &&\n !this.match(tt.question) &&\n !this.match(tt.bang)\n );\n }\n\n /** Parses a modifier matching one the given modifier names. */\n tsParseModifier(allowedModifiers: T[]): ?T {\n if (!this.match(tt.name)) {\n return undefined;\n }\n\n const modifier = this.state.value;\n if (\n allowedModifiers.indexOf(modifier) !== -1 &&\n this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))\n ) {\n return modifier;\n }\n return undefined;\n }\n\n /** Parses a list of modifiers, in any order.\n * If you need a specific order, you must call this function multiple times:\n * this.tsParseModifiers(node, [\"public\"]);\n * this.tsParseModifiers(node, [\"abstract\", \"readonly\"]);\n */\n tsParseModifiers(\n modified: { [key: TsModifier]: ?true },\n allowedModifiers: T[],\n ): void {\n for (;;) {\n const startPos = this.state.start;\n const modifier: ?T = this.tsParseModifier(allowedModifiers);\n\n if (!modifier) break;\n\n if (Object.hasOwnProperty.call(modified, modifier)) {\n this.raise(startPos, `Duplicate modifier: '${modifier}'`);\n }\n modified[modifier] = true;\n }\n }\n\n tsIsListTerminator(kind: ParsingContext): boolean {\n switch (kind) {\n case \"EnumMembers\":\n case \"TypeMembers\":\n return this.match(tt.braceR);\n case \"HeritageClauseElement\":\n return this.match(tt.braceL);\n case \"TupleElementTypes\":\n return this.match(tt.bracketR);\n case \"TypeParametersOrArguments\":\n return this.isRelational(\">\");\n }\n\n throw new Error(\"Unreachable\");\n }\n\n tsParseList(kind: ParsingContext, parseElement: () => T): T[] {\n const result: T[] = [];\n while (!this.tsIsListTerminator(kind)) {\n // Skipping \"parseListElement\" from the TS source since that's just for error handling.\n result.push(parseElement());\n }\n return result;\n }\n\n tsParseDelimitedList(\n kind: ParsingContext,\n parseElement: () => T,\n ): T[] {\n return nonNull(\n this.tsParseDelimitedListWorker(\n kind,\n parseElement,\n /* expectSuccess */ true,\n ),\n );\n }\n\n /**\n * If !expectSuccess, returns undefined instead of failing to parse.\n * If expectSuccess, parseElement should always return a defined value.\n */\n tsParseDelimitedListWorker(\n kind: ParsingContext,\n parseElement: () => ?T,\n expectSuccess: boolean,\n ): ?(T[]) {\n const result = [];\n\n for (;;) {\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n const element = parseElement();\n if (element == null) {\n return undefined;\n }\n result.push(element);\n\n if (this.eat(tt.comma)) {\n continue;\n }\n\n if (this.tsIsListTerminator(kind)) {\n break;\n }\n\n if (expectSuccess) {\n // This will fail with an error about a missing comma\n this.expect(tt.comma);\n }\n return undefined;\n }\n\n return result;\n }\n\n tsParseBracketedList(\n kind: ParsingContext,\n parseElement: () => T,\n bracket: boolean,\n skipFirstToken: boolean,\n ): T[] {\n if (!skipFirstToken) {\n if (bracket) {\n this.expect(tt.bracketL);\n } else {\n this.expectRelational(\"<\");\n }\n }\n\n const result = this.tsParseDelimitedList(kind, parseElement);\n\n if (bracket) {\n this.expect(tt.bracketR);\n } else {\n this.expectRelational(\">\");\n }\n\n return result;\n }\n\n tsParseImportType(): N.TsImportType {\n const node: N.TsImportType = this.startNode();\n this.expect(tt._import);\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n this.raise(\n this.state.start,\n \"Argument in a type import must be a string literal\",\n );\n }\n\n // For compatibility to estree we cannot call parseLiteral directly here\n node.argument = this.parseExprAtom();\n this.expect(tt.parenR);\n\n if (this.eat(tt.dot)) {\n node.qualifier = this.tsParseEntityName(/* allowReservedWords */ true);\n }\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSImportType\");\n }\n\n tsParseEntityName(allowReservedWords: boolean): N.TsEntityName {\n let entity: N.TsEntityName = this.parseIdentifier();\n while (this.eat(tt.dot)) {\n const node: N.TsQualifiedName = this.startNodeAtNode(entity);\n node.left = entity;\n node.right = this.parseIdentifier(allowReservedWords);\n entity = this.finishNode(node, \"TSQualifiedName\");\n }\n return entity;\n }\n\n tsParseTypeReference(): N.TsTypeReference {\n const node: N.TsTypeReference = this.startNode();\n node.typeName = this.tsParseEntityName(/* allowReservedWords */ false);\n if (!this.hasPrecedingLineBreak() && this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n return this.finishNode(node, \"TSTypeReference\");\n }\n\n tsParseThisTypePredicate(lhs: N.TsThisType): N.TsTypePredicate {\n this.next();\n const node: N.TsTypePredicate = this.startNodeAtNode(lhs);\n node.parameterName = lhs;\n node.typeAnnotation = this.tsParseTypeAnnotation(/* eatColon */ false);\n return this.finishNode(node, \"TSTypePredicate\");\n }\n\n tsParseThisTypeNode(): N.TsThisType {\n const node: N.TsThisType = this.startNode();\n this.next();\n return this.finishNode(node, \"TSThisType\");\n }\n\n tsParseTypeQuery(): N.TsTypeQuery {\n const node: N.TsTypeQuery = this.startNode();\n this.expect(tt._typeof);\n if (this.match(tt._import)) {\n node.exprName = this.tsParseImportType();\n } else {\n node.exprName = this.tsParseEntityName(/* allowReservedWords */ true);\n }\n return this.finishNode(node, \"TSTypeQuery\");\n }\n\n tsParseTypeParameter(): N.TsTypeParameter {\n const node: N.TsTypeParameter = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsEatThenParseType(tt._extends);\n node.default = this.tsEatThenParseType(tt.eq);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsTryParseTypeParameters(): ?N.TsTypeParameterDeclaration {\n if (this.isRelational(\"<\")) {\n return this.tsParseTypeParameters();\n }\n }\n\n tsParseTypeParameters() {\n const node: N.TsTypeParameterDeclaration = this.startNode();\n\n if (this.isRelational(\"<\") || this.match(tt.jsxTagStart)) {\n this.next();\n } else {\n this.unexpected();\n }\n\n node.params = this.tsParseBracketedList(\n \"TypeParametersOrArguments\",\n this.tsParseTypeParameter.bind(this),\n /* bracket */ false,\n /* skipFirstToken */ true,\n );\n return this.finishNode(node, \"TSTypeParameterDeclaration\");\n }\n\n tsTryNextParseConstantContext(): ?N.TsTypeReference {\n if (this.lookahead().type === tt._const) {\n this.next();\n return this.tsParseTypeReference();\n }\n return null;\n }\n\n // Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`,\n // but here it's always false, because this is only used for types.\n tsFillSignature(\n returnToken: TokenType,\n signature: N.TsSignatureDeclaration,\n ): void {\n // Arrow fns *must* have return token (`=>`). Normal functions can omit it.\n const returnTokenRequired = returnToken === tt.arrow;\n signature.typeParameters = this.tsTryParseTypeParameters();\n this.expect(tt.parenL);\n signature.parameters = this.tsParseBindingListForSignature();\n if (returnTokenRequired) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(\n returnToken,\n );\n } else if (this.match(returnToken)) {\n signature.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(\n returnToken,\n );\n }\n }\n\n tsParseBindingListForSignature(): $ReadOnlyArray<\n N.Identifier | N.RestElement | N.ObjectPattern | N.ArrayPattern,\n > {\n return this.parseBindingList(tt.parenR, charCodes.rightParenthesis).map(\n pattern => {\n if (\n pattern.type !== \"Identifier\" &&\n pattern.type !== \"RestElement\" &&\n pattern.type !== \"ObjectPattern\" &&\n pattern.type !== \"ArrayPattern\"\n ) {\n this.raise(\n pattern.start,\n \"Name in a signature must be an Identifier, ObjectPattern or ArrayPattern,\" +\n `instead got ${pattern.type}`,\n );\n }\n return (pattern: any);\n },\n );\n }\n\n tsParseTypeMemberSemicolon(): void {\n if (!this.eat(tt.comma)) {\n this.semicolon();\n }\n }\n\n tsParseSignatureMember(\n kind: \"TSCallSignatureDeclaration\" | \"TSConstructSignatureDeclaration\",\n node: N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration,\n ): N.TsCallSignatureDeclaration | N.TsConstructSignatureDeclaration {\n this.tsFillSignature(tt.colon, node);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, kind);\n }\n\n tsIsUnambiguouslyIndexSignature() {\n this.next(); // Skip '{'\n return this.eat(tt.name) && this.match(tt.colon);\n }\n\n tsTryParseIndexSignature(node: N.Node): ?N.TsIndexSignature {\n if (\n !(\n this.match(tt.bracketL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))\n )\n ) {\n return undefined;\n }\n\n this.expect(tt.bracketL);\n const id = this.parseIdentifier();\n id.typeAnnotation = this.tsParseTypeAnnotation();\n this.resetEndLocation(id); // set end position to end of type\n\n this.expect(tt.bracketR);\n node.parameters = [id];\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(node, \"TSIndexSignature\");\n }\n\n tsParsePropertyOrMethodSignature(\n node: N.TsPropertySignature | N.TsMethodSignature,\n readonly: boolean,\n ): N.TsPropertySignature | N.TsMethodSignature {\n if (this.eat(tt.question)) node.optional = true;\n const nodeAny: any = node;\n\n if (!readonly && (this.match(tt.parenL) || this.isRelational(\"<\"))) {\n const method: N.TsMethodSignature = nodeAny;\n this.tsFillSignature(tt.colon, method);\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(method, \"TSMethodSignature\");\n } else {\n const property: N.TsPropertySignature = nodeAny;\n if (readonly) property.readonly = true;\n const type = this.tsTryParseTypeAnnotation();\n if (type) property.typeAnnotation = type;\n this.tsParseTypeMemberSemicolon();\n return this.finishNode(property, \"TSPropertySignature\");\n }\n }\n\n tsParseTypeMember(): N.TsTypeElement {\n const node: any = this.startNode();\n\n if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\"TSCallSignatureDeclaration\", node);\n }\n\n if (this.match(tt._new)) {\n const id: N.Identifier = this.startNode();\n this.next();\n if (this.match(tt.parenL) || this.isRelational(\"<\")) {\n return this.tsParseSignatureMember(\n \"TSConstructSignatureDeclaration\",\n node,\n );\n } else {\n node.key = this.createIdentifier(id, \"new\");\n return this.tsParsePropertyOrMethodSignature(node, false);\n }\n }\n\n const readonly = !!this.tsParseModifier([\"readonly\"]);\n\n const idx = this.tsTryParseIndexSignature(node);\n if (idx) {\n if (readonly) node.readonly = true;\n return idx;\n }\n\n this.parsePropertyName(node, /* isPrivateNameAllowed */ false);\n return this.tsParsePropertyOrMethodSignature(node, readonly);\n }\n\n tsParseTypeLiteral(): N.TsTypeLiteral {\n const node: N.TsTypeLiteral = this.startNode();\n node.members = this.tsParseObjectTypeMembers();\n return this.finishNode(node, \"TSTypeLiteral\");\n }\n\n tsParseObjectTypeMembers(): $ReadOnlyArray {\n this.expect(tt.braceL);\n const members = this.tsParseList(\n \"TypeMembers\",\n this.tsParseTypeMember.bind(this),\n );\n this.expect(tt.braceR);\n return members;\n }\n\n tsIsStartOfMappedType(): boolean {\n this.next();\n if (this.eat(tt.plusMin)) {\n return this.isContextual(\"readonly\");\n }\n if (this.isContextual(\"readonly\")) {\n this.next();\n }\n if (!this.match(tt.bracketL)) {\n return false;\n }\n this.next();\n if (!this.tsIsIdentifier()) {\n return false;\n }\n this.next();\n return this.match(tt._in);\n }\n\n tsParseMappedTypeParameter(): N.TsTypeParameter {\n const node: N.TsTypeParameter = this.startNode();\n node.name = this.parseIdentifierName(node.start);\n node.constraint = this.tsExpectThenParseType(tt._in);\n return this.finishNode(node, \"TSTypeParameter\");\n }\n\n tsParseMappedType(): N.TsMappedType {\n const node: N.TsMappedType = this.startNode();\n\n this.expect(tt.braceL);\n\n if (this.match(tt.plusMin)) {\n node.readonly = this.state.value;\n this.next();\n this.expectContextual(\"readonly\");\n } else if (this.eatContextual(\"readonly\")) {\n node.readonly = true;\n }\n\n this.expect(tt.bracketL);\n node.typeParameter = this.tsParseMappedTypeParameter();\n this.expect(tt.bracketR);\n\n if (this.match(tt.plusMin)) {\n node.optional = this.state.value;\n this.next();\n this.expect(tt.question);\n } else if (this.eat(tt.question)) {\n node.optional = true;\n }\n\n node.typeAnnotation = this.tsTryParseType();\n this.semicolon();\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"TSMappedType\");\n }\n\n tsParseTupleType(): N.TsTupleType {\n const node: N.TsTupleType = this.startNode();\n node.elementTypes = this.tsParseBracketedList(\n \"TupleElementTypes\",\n this.tsParseTupleElementType.bind(this),\n /* bracket */ true,\n /* skipFirstToken */ false,\n );\n\n // Validate the elementTypes to ensure:\n // No mandatory elements may follow optional elements\n // If there's a rest element, it must be at the end of the tuple\n let seenOptionalElement = false;\n node.elementTypes.forEach(elementNode => {\n if (elementNode.type === \"TSOptionalType\") {\n seenOptionalElement = true;\n } else if (seenOptionalElement && elementNode.type !== \"TSRestType\") {\n this.raise(\n elementNode.start,\n \"A required element cannot follow an optional element.\",\n );\n }\n });\n\n return this.finishNode(node, \"TSTupleType\");\n }\n\n tsParseTupleElementType(): N.TsType {\n // parses `...TsType[]`\n if (this.match(tt.ellipsis)) {\n const restNode: N.TsRestType = this.startNode();\n this.next(); // skips ellipsis\n restNode.typeAnnotation = this.tsParseType();\n if (\n this.match(tt.comma) &&\n this.lookaheadCharCode() !== charCodes.rightSquareBracket\n ) {\n this.raiseRestNotLast(this.state.start);\n }\n return this.finishNode(restNode, \"TSRestType\");\n }\n\n const type = this.tsParseType();\n // parses `TsType?`\n if (this.eat(tt.question)) {\n const optionalTypeNode: N.TsOptionalType = this.startNodeAtNode(type);\n optionalTypeNode.typeAnnotation = type;\n return this.finishNode(optionalTypeNode, \"TSOptionalType\");\n }\n return type;\n }\n\n tsParseParenthesizedType(): N.TsParenthesizedType {\n const node = this.startNode();\n this.expect(tt.parenL);\n node.typeAnnotation = this.tsParseType();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSParenthesizedType\");\n }\n\n tsParseFunctionOrConstructorType(\n type: \"TSFunctionType\" | \"TSConstructorType\",\n ): N.TsFunctionOrConstructorType {\n const node: N.TsFunctionOrConstructorType = this.startNode();\n if (type === \"TSConstructorType\") {\n this.expect(tt._new);\n }\n this.tsFillSignature(tt.arrow, node);\n return this.finishNode(node, type);\n }\n\n tsParseLiteralTypeNode(): N.TsLiteralType {\n const node: N.TsLiteralType = this.startNode();\n node.literal = (() => {\n switch (this.state.type) {\n case tt.num:\n case tt.string:\n case tt._true:\n case tt._false:\n // For compatibility to estree we cannot call parseLiteral directly here\n return this.parseExprAtom();\n default:\n throw this.unexpected();\n }\n })();\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n tsParseTemplateLiteralType(): N.TsType {\n const node: N.TsLiteralType = this.startNode();\n const templateNode = this.parseTemplate(false);\n if (templateNode.expressions.length > 0) {\n this.raise(\n templateNode.expressions[0].start,\n \"Template literal types cannot have any substitution\",\n );\n }\n node.literal = templateNode;\n return this.finishNode(node, \"TSLiteralType\");\n }\n\n tsParseThisTypeOrThisTypePredicate(): N.TsThisType | N.TsTypePredicate {\n const thisKeyword = this.tsParseThisTypeNode();\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n return this.tsParseThisTypePredicate(thisKeyword);\n } else {\n return thisKeyword;\n }\n }\n\n tsParseNonArrayType(): N.TsType {\n switch (this.state.type) {\n case tt.name:\n case tt._void:\n case tt._null: {\n const type = this.match(tt._void)\n ? \"TSVoidKeyword\"\n : this.match(tt._null)\n ? \"TSNullKeyword\"\n : keywordTypeFromName(this.state.value);\n if (\n type !== undefined &&\n this.lookaheadCharCode() !== charCodes.dot\n ) {\n const node: N.TsKeywordType = this.startNode();\n this.next();\n return this.finishNode(node, type);\n }\n return this.tsParseTypeReference();\n }\n case tt.string:\n case tt.num:\n case tt._true:\n case tt._false:\n return this.tsParseLiteralTypeNode();\n case tt.plusMin:\n if (this.state.value === \"-\") {\n const node: N.TsLiteralType = this.startNode();\n if (this.lookahead().type !== tt.num) {\n throw this.unexpected();\n }\n node.literal = this.parseMaybeUnary();\n return this.finishNode(node, \"TSLiteralType\");\n }\n break;\n case tt._this:\n return this.tsParseThisTypeOrThisTypePredicate();\n case tt._typeof:\n return this.tsParseTypeQuery();\n case tt._import:\n return this.tsParseImportType();\n case tt.braceL:\n return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))\n ? this.tsParseMappedType()\n : this.tsParseTypeLiteral();\n case tt.bracketL:\n return this.tsParseTupleType();\n case tt.parenL:\n return this.tsParseParenthesizedType();\n case tt.backQuote:\n return this.tsParseTemplateLiteralType();\n }\n\n throw this.unexpected();\n }\n\n tsParseArrayTypeOrHigher(): N.TsType {\n let type = this.tsParseNonArrayType();\n while (!this.hasPrecedingLineBreak() && this.eat(tt.bracketL)) {\n if (this.match(tt.bracketR)) {\n const node: N.TsArrayType = this.startNodeAtNode(type);\n node.elementType = type;\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSArrayType\");\n } else {\n const node: N.TsIndexedAccessType = this.startNodeAtNode(type);\n node.objectType = type;\n node.indexType = this.tsParseType();\n this.expect(tt.bracketR);\n type = this.finishNode(node, \"TSIndexedAccessType\");\n }\n }\n return type;\n }\n\n tsParseTypeOperator(\n operator: \"keyof\" | \"unique\" | \"readonly\",\n ): N.TsTypeOperator {\n const node: N.TsTypeOperator = this.startNode();\n this.expectContextual(operator);\n node.operator = operator;\n node.typeAnnotation = this.tsParseTypeOperatorOrHigher();\n\n if (operator === \"readonly\") {\n this.tsCheckTypeAnnotationForReadOnly(node);\n }\n\n return this.finishNode(node, \"TSTypeOperator\");\n }\n\n tsCheckTypeAnnotationForReadOnly(node: N.Node) {\n switch (node.typeAnnotation.type) {\n case \"TSTupleType\":\n case \"TSArrayType\":\n return;\n default:\n this.raise(\n node.start,\n \"'readonly' type modifier is only permitted on array and tuple literal types.\",\n );\n }\n }\n\n tsParseInferType(): N.TsInferType {\n const node = this.startNode();\n this.expectContextual(\"infer\");\n const typeParameter = this.startNode();\n typeParameter.name = this.parseIdentifierName(typeParameter.start);\n node.typeParameter = this.finishNode(typeParameter, \"TSTypeParameter\");\n return this.finishNode(node, \"TSInferType\");\n }\n\n tsParseTypeOperatorOrHigher(): N.TsType {\n const operator = [\"keyof\", \"unique\", \"readonly\"].find(kw =>\n this.isContextual(kw),\n );\n return operator\n ? this.tsParseTypeOperator(operator)\n : this.isContextual(\"infer\")\n ? this.tsParseInferType()\n : this.tsParseArrayTypeOrHigher();\n }\n\n tsParseUnionOrIntersectionType(\n kind: \"TSUnionType\" | \"TSIntersectionType\",\n parseConstituentType: () => N.TsType,\n operator: TokenType,\n ): N.TsType {\n this.eat(operator);\n let type = parseConstituentType();\n if (this.match(operator)) {\n const types = [type];\n while (this.eat(operator)) {\n types.push(parseConstituentType());\n }\n const node: N.TsUnionType | N.TsIntersectionType = this.startNodeAtNode(\n type,\n );\n node.types = types;\n type = this.finishNode(node, kind);\n }\n return type;\n }\n\n tsParseIntersectionTypeOrHigher(): N.TsType {\n return this.tsParseUnionOrIntersectionType(\n \"TSIntersectionType\",\n this.tsParseTypeOperatorOrHigher.bind(this),\n tt.bitwiseAND,\n );\n }\n\n tsParseUnionTypeOrHigher() {\n return this.tsParseUnionOrIntersectionType(\n \"TSUnionType\",\n this.tsParseIntersectionTypeOrHigher.bind(this),\n tt.bitwiseOR,\n );\n }\n\n tsIsStartOfFunctionType() {\n if (this.isRelational(\"<\")) {\n return true;\n }\n return (\n this.match(tt.parenL) &&\n this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))\n );\n }\n\n tsSkipParameterStart(): boolean {\n if (this.match(tt.name) || this.match(tt._this)) {\n this.next();\n return true;\n }\n\n if (this.match(tt.braceL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(tt.braceL)) {\n ++braceStackCounter;\n } else if (this.match(tt.braceR)) {\n --braceStackCounter;\n }\n this.next();\n }\n return true;\n }\n\n if (this.match(tt.bracketL)) {\n let braceStackCounter = 1;\n this.next();\n\n while (braceStackCounter > 0) {\n if (this.match(tt.bracketL)) {\n ++braceStackCounter;\n } else if (this.match(tt.bracketR)) {\n --braceStackCounter;\n }\n this.next();\n }\n return true;\n }\n\n return false;\n }\n\n tsIsUnambiguouslyStartOfFunctionType(): boolean {\n this.next();\n if (this.match(tt.parenR) || this.match(tt.ellipsis)) {\n // ( )\n // ( ...\n return true;\n }\n if (this.tsSkipParameterStart()) {\n if (\n this.match(tt.colon) ||\n this.match(tt.comma) ||\n this.match(tt.question) ||\n this.match(tt.eq)\n ) {\n // ( xxx :\n // ( xxx ,\n // ( xxx ?\n // ( xxx =\n return true;\n }\n if (this.match(tt.parenR)) {\n this.next();\n if (this.match(tt.arrow)) {\n // ( xxx ) =>\n return true;\n }\n }\n }\n return false;\n }\n\n tsParseTypeOrTypePredicateAnnotation(\n returnToken: TokenType,\n ): N.TsTypeAnnotation {\n return this.tsInType(() => {\n const t: N.TsTypeAnnotation = this.startNode();\n this.expect(returnToken);\n\n const asserts = this.tsTryParse(\n this.tsParseTypePredicateAsserts.bind(this),\n );\n\n if (asserts && this.match(tt._this)) {\n // When asserts is false, thisKeyword is handled by tsParseNonArrayType\n // : asserts this is type\n let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate();\n // if it turns out to be a `TSThisType`, wrap it with `TSTypePredicate`\n // : asserts this\n if (thisTypePredicate.type === \"TSThisType\") {\n const node: N.TsTypePredicate = this.startNodeAtNode(t);\n node.parameterName = (thisTypePredicate: N.TsThisType);\n node.asserts = true;\n thisTypePredicate = this.finishNode(node, \"TSTypePredicate\");\n } else {\n (thisTypePredicate: N.TsTypePredicate).asserts = true;\n }\n t.typeAnnotation = thisTypePredicate;\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n const typePredicateVariable =\n this.tsIsIdentifier() &&\n this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));\n\n if (!typePredicateVariable) {\n if (!asserts) {\n // : type\n return this.tsParseTypeAnnotation(/* eatColon */ false, t);\n }\n\n const node: N.TsTypePredicate = this.startNodeAtNode(t);\n // : asserts foo\n node.parameterName = this.parseIdentifier();\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n // : asserts foo is type\n const type = this.tsParseTypeAnnotation(/* eatColon */ false);\n const node = this.startNodeAtNode(t);\n node.parameterName = typePredicateVariable;\n node.typeAnnotation = type;\n node.asserts = asserts;\n t.typeAnnotation = this.finishNode(node, \"TSTypePredicate\");\n return this.finishNode(t, \"TSTypeAnnotation\");\n });\n }\n\n tsTryParseTypeOrTypePredicateAnnotation(): ?N.TsTypeAnnotation {\n return this.match(tt.colon)\n ? this.tsParseTypeOrTypePredicateAnnotation(tt.colon)\n : undefined;\n }\n\n tsTryParseTypeAnnotation(): ?N.TsTypeAnnotation {\n return this.match(tt.colon) ? this.tsParseTypeAnnotation() : undefined;\n }\n\n tsTryParseType(): ?N.TsType {\n return this.tsEatThenParseType(tt.colon);\n }\n\n tsParseTypePredicatePrefix(): ?N.Identifier {\n const id = this.parseIdentifier();\n if (this.isContextual(\"is\") && !this.hasPrecedingLineBreak()) {\n this.next();\n return id;\n }\n }\n\n tsParseTypePredicateAsserts(): boolean {\n if (\n !this.match(tt.name) ||\n this.state.value !== \"asserts\" ||\n this.hasPrecedingLineBreak()\n ) {\n return false;\n }\n const containsEsc = this.state.containsEsc;\n this.next();\n if (!this.match(tt.name) && !this.match(tt._this)) {\n return false;\n }\n\n if (containsEsc) {\n this.raise(\n this.state.lastTokStart,\n \"Escape sequence in keyword asserts\",\n );\n }\n\n return true;\n }\n\n tsParseTypeAnnotation(\n eatColon = true,\n t: N.TsTypeAnnotation = this.startNode(),\n ): N.TsTypeAnnotation {\n this.tsInType(() => {\n if (eatColon) this.expect(tt.colon);\n t.typeAnnotation = this.tsParseType();\n });\n return this.finishNode(t, \"TSTypeAnnotation\");\n }\n\n /** Be sure to be in a type context before calling this, using `tsInType`. */\n tsParseType(): N.TsType {\n // Need to set `state.inType` so that we don't parse JSX in a type context.\n assert(this.state.inType);\n const type = this.tsParseNonConditionalType();\n if (this.hasPrecedingLineBreak() || !this.eat(tt._extends)) {\n return type;\n }\n const node: N.TsConditionalType = this.startNodeAtNode(type);\n node.checkType = type;\n node.extendsType = this.tsParseNonConditionalType();\n this.expect(tt.question);\n node.trueType = this.tsParseType();\n this.expect(tt.colon);\n node.falseType = this.tsParseType();\n return this.finishNode(node, \"TSConditionalType\");\n }\n\n tsParseNonConditionalType(): N.TsType {\n if (this.tsIsStartOfFunctionType()) {\n return this.tsParseFunctionOrConstructorType(\"TSFunctionType\");\n }\n if (this.match(tt._new)) {\n // As in `new () => Date`\n return this.tsParseFunctionOrConstructorType(\"TSConstructorType\");\n }\n return this.tsParseUnionTypeOrHigher();\n }\n\n tsParseTypeAssertion(): N.TsTypeAssertion {\n const node: N.TsTypeAssertion = this.startNode();\n const _const = this.tsTryNextParseConstantContext();\n node.typeAnnotation = _const || this.tsNextThenParseType();\n this.expectRelational(\">\");\n node.expression = this.parseMaybeUnary();\n return this.finishNode(node, \"TSTypeAssertion\");\n }\n\n tsParseHeritageClause(\n descriptor: string,\n ): $ReadOnlyArray {\n const originalStart = this.state.start;\n\n const delimitedList = this.tsParseDelimitedList(\n \"HeritageClauseElement\",\n this.tsParseExpressionWithTypeArguments.bind(this),\n );\n\n if (!delimitedList.length) {\n this.raise(originalStart, `'${descriptor}' list cannot be empty.`);\n }\n\n return delimitedList;\n }\n\n tsParseExpressionWithTypeArguments(): N.TsExpressionWithTypeArguments {\n const node: N.TsExpressionWithTypeArguments = this.startNode();\n // Note: TS uses parseLeftHandSideExpressionOrHigher,\n // then has grammar errors later if it's not an EntityName.\n node.expression = this.tsParseEntityName(/* allowReservedWords */ false);\n if (this.isRelational(\"<\")) {\n node.typeParameters = this.tsParseTypeArguments();\n }\n\n return this.finishNode(node, \"TSExpressionWithTypeArguments\");\n }\n\n tsParseInterfaceDeclaration(\n node: N.TsInterfaceDeclaration,\n ): N.TsInterfaceDeclaration {\n node.id = this.parseIdentifier();\n this.checkLVal(\n node.id,\n BIND_TS_INTERFACE,\n undefined,\n \"typescript interface declaration\",\n );\n node.typeParameters = this.tsTryParseTypeParameters();\n if (this.eat(tt._extends)) {\n node.extends = this.tsParseHeritageClause(\"extends\");\n }\n const body: N.TSInterfaceBody = this.startNode();\n body.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this));\n node.body = this.finishNode(body, \"TSInterfaceBody\");\n return this.finishNode(node, \"TSInterfaceDeclaration\");\n }\n\n tsParseTypeAliasDeclaration(\n node: N.TsTypeAliasDeclaration,\n ): N.TsTypeAliasDeclaration {\n node.id = this.parseIdentifier();\n this.checkLVal(node.id, BIND_TS_TYPE, undefined, \"typescript type alias\");\n\n node.typeParameters = this.tsTryParseTypeParameters();\n node.typeAnnotation = this.tsExpectThenParseType(tt.eq);\n this.semicolon();\n return this.finishNode(node, \"TSTypeAliasDeclaration\");\n }\n\n tsInNoContext(cb: () => T): T {\n const oldContext = this.state.context;\n this.state.context = [oldContext[0]];\n try {\n return cb();\n } finally {\n this.state.context = oldContext;\n }\n }\n\n /**\n * Runs `cb` in a type context.\n * This should be called one token *before* the first type token,\n * so that the call to `next()` is run in type context.\n */\n tsInType(cb: () => T): T {\n const oldInType = this.state.inType;\n this.state.inType = true;\n try {\n return cb();\n } finally {\n this.state.inType = oldInType;\n }\n }\n\n tsEatThenParseType(token: TokenType): N.TsType | typeof undefined {\n return !this.match(token) ? undefined : this.tsNextThenParseType();\n }\n\n tsExpectThenParseType(token: TokenType): N.TsType {\n return this.tsDoThenParseType(() => this.expect(token));\n }\n\n tsNextThenParseType(): N.TsType {\n return this.tsDoThenParseType(() => this.next());\n }\n\n tsDoThenParseType(cb: () => void): N.TsType {\n return this.tsInType(() => {\n cb();\n return this.tsParseType();\n });\n }\n\n tsParseEnumMember(): N.TsEnumMember {\n const node: N.TsEnumMember = this.startNode();\n // Computed property names are grammar errors in an enum, so accept just string literal or identifier.\n node.id = this.match(tt.string)\n ? this.parseExprAtom()\n : this.parseIdentifier(/* liberal */ true);\n if (this.eat(tt.eq)) {\n node.initializer = this.parseMaybeAssign();\n }\n return this.finishNode(node, \"TSEnumMember\");\n }\n\n tsParseEnumDeclaration(\n node: N.TsEnumDeclaration,\n isConst: boolean,\n ): N.TsEnumDeclaration {\n if (isConst) node.const = true;\n node.id = this.parseIdentifier();\n this.checkLVal(\n node.id,\n isConst ? BIND_TS_CONST_ENUM : BIND_TS_ENUM,\n undefined,\n \"typescript enum declaration\",\n );\n\n this.expect(tt.braceL);\n node.members = this.tsParseDelimitedList(\n \"EnumMembers\",\n this.tsParseEnumMember.bind(this),\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"TSEnumDeclaration\");\n }\n\n tsParseModuleBlock(): N.TsModuleBlock {\n const node: N.TsModuleBlock = this.startNode();\n this.scope.enter(SCOPE_OTHER);\n\n this.expect(tt.braceL);\n // Inside of a module block is considered \"top-level\", meaning it can have imports and exports.\n this.parseBlockOrModuleBlockBody(\n (node.body = []),\n /* directives */ undefined,\n /* topLevel */ true,\n /* end */ tt.braceR,\n );\n this.scope.exit();\n return this.finishNode(node, \"TSModuleBlock\");\n }\n\n tsParseModuleOrNamespaceDeclaration(\n node: N.TsModuleDeclaration,\n nested?: boolean = false,\n ): N.TsModuleDeclaration {\n node.id = this.parseIdentifier();\n\n if (!nested) {\n this.checkLVal(\n node.id,\n BIND_TS_NAMESPACE,\n null,\n \"module or namespace declaration\",\n );\n }\n\n if (this.eat(tt.dot)) {\n const inner = this.startNode();\n this.tsParseModuleOrNamespaceDeclaration(inner, true);\n node.body = inner;\n } else {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n }\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseAmbientExternalModuleDeclaration(\n node: N.TsModuleDeclaration,\n ): N.TsModuleDeclaration {\n if (this.isContextual(\"global\")) {\n node.global = true;\n node.id = this.parseIdentifier();\n } else if (this.match(tt.string)) {\n node.id = this.parseExprAtom();\n } else {\n this.unexpected();\n }\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n node.body = this.tsParseModuleBlock();\n this.prodParam.exit();\n this.scope.exit();\n } else {\n this.semicolon();\n }\n\n return this.finishNode(node, \"TSModuleDeclaration\");\n }\n\n tsParseImportEqualsDeclaration(\n node: N.TsImportEqualsDeclaration,\n isExport?: boolean,\n ): N.TsImportEqualsDeclaration {\n node.isExport = isExport || false;\n node.id = this.parseIdentifier();\n this.checkLVal(\n node.id,\n BIND_LEXICAL,\n undefined,\n \"import equals declaration\",\n );\n this.expect(tt.eq);\n node.moduleReference = this.tsParseModuleReference();\n this.semicolon();\n return this.finishNode(node, \"TSImportEqualsDeclaration\");\n }\n\n tsIsExternalModuleReference(): boolean {\n return (\n this.isContextual(\"require\") &&\n this.lookaheadCharCode() === charCodes.leftParenthesis\n );\n }\n\n tsParseModuleReference(): N.TsModuleReference {\n return this.tsIsExternalModuleReference()\n ? this.tsParseExternalModuleReference()\n : this.tsParseEntityName(/* allowReservedWords */ false);\n }\n\n tsParseExternalModuleReference(): N.TsExternalModuleReference {\n const node: N.TsExternalModuleReference = this.startNode();\n this.expectContextual(\"require\");\n this.expect(tt.parenL);\n if (!this.match(tt.string)) {\n throw this.unexpected();\n }\n // For compatibility to estree we cannot call parseLiteral directly here\n node.expression = this.parseExprAtom();\n this.expect(tt.parenR);\n return this.finishNode(node, \"TSExternalModuleReference\");\n }\n\n // Utilities\n\n tsLookAhead(f: () => T): T {\n const state = this.state.clone();\n const res = f();\n this.state = state;\n return res;\n }\n\n tsTryParseAndCatch(f: () => T): ?T {\n const result = this.tryParse(abort => f() || abort());\n\n if (result.aborted || !result.node) return undefined;\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n tsTryParse(f: () => ?T): ?T {\n const state = this.state.clone();\n const result = f();\n if (result !== undefined && result !== false) {\n return result;\n } else {\n this.state = state;\n return undefined;\n }\n }\n\n tsTryParseDeclare(nany: any): ?N.Declaration {\n if (this.isLineTerminator()) {\n return;\n }\n let starttype = this.state.type;\n let kind;\n\n if (this.isContextual(\"let\")) {\n starttype = tt._var;\n kind = \"let\";\n }\n\n switch (starttype) {\n case tt._function:\n return this.parseFunctionStatement(\n nany,\n /* async */ false,\n /* declarationPosition */ true,\n );\n case tt._class:\n // While this is also set by tsParseExpressionStatement, we need to set it\n // before parsing the class declaration to now how to register it in the scope.\n nany.declare = true;\n return this.parseClass(\n nany,\n /* isStatement */ true,\n /* optionalId */ false,\n );\n case tt._const:\n if (this.match(tt._const) && this.isLookaheadContextual(\"enum\")) {\n // `const enum = 0;` not allowed because \"enum\" is a strict mode reserved word.\n this.expect(tt._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(nany, /* isConst */ true);\n }\n // falls through\n case tt._var:\n kind = kind || this.state.value;\n return this.parseVarStatement(nany, kind);\n case tt.name: {\n const value = this.state.value;\n if (value === \"global\") {\n return this.tsParseAmbientExternalModuleDeclaration(nany);\n } else {\n return this.tsParseDeclaration(nany, value, /* next */ true);\n }\n }\n }\n }\n\n // Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`.\n tsTryParseExportDeclaration(): ?N.Declaration {\n return this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n /* next */ true,\n );\n }\n\n tsParseExpressionStatement(node: any, expr: N.Identifier): ?N.Declaration {\n switch (expr.name) {\n case \"declare\": {\n const declaration = this.tsTryParseDeclare(node);\n if (declaration) {\n declaration.declare = true;\n return declaration;\n }\n break;\n }\n case \"global\":\n // `global { }` (with no `declare`) may appear inside an ambient module declaration.\n // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past \"global\".\n if (this.match(tt.braceL)) {\n this.scope.enter(SCOPE_TS_MODULE);\n this.prodParam.enter(PARAM);\n const mod: N.TsModuleDeclaration = node;\n mod.global = true;\n mod.id = expr;\n mod.body = this.tsParseModuleBlock();\n this.scope.exit();\n this.prodParam.exit();\n return this.finishNode(mod, \"TSModuleDeclaration\");\n }\n break;\n\n default:\n return this.tsParseDeclaration(node, expr.name, /* next */ false);\n }\n }\n\n // Common to tsTryParseDeclare, tsTryParseExportDeclaration, and tsParseExpressionStatement.\n tsParseDeclaration(\n node: any,\n value: string,\n next: boolean,\n ): ?N.Declaration {\n switch (value) {\n case \"abstract\":\n if (this.tsCheckLineTerminatorAndMatch(tt._class, next)) {\n const cls: N.ClassDeclaration = node;\n cls.abstract = true;\n if (next) {\n this.next();\n if (!this.match(tt._class)) {\n this.unexpected(null, tt._class);\n }\n }\n return this.parseClass(\n cls,\n /* isStatement */ true,\n /* optionalId */ false,\n );\n }\n break;\n\n case \"enum\":\n if (next || this.match(tt.name)) {\n if (next) this.next();\n return this.tsParseEnumDeclaration(node, /* isConst */ false);\n }\n break;\n\n case \"interface\":\n if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n if (next) this.next();\n return this.tsParseInterfaceDeclaration(node);\n }\n break;\n\n case \"module\":\n if (next) this.next();\n if (this.match(tt.string)) {\n return this.tsParseAmbientExternalModuleDeclaration(node);\n } else if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n\n case \"namespace\":\n if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n if (next) this.next();\n return this.tsParseModuleOrNamespaceDeclaration(node);\n }\n break;\n\n case \"type\":\n if (this.tsCheckLineTerminatorAndMatch(tt.name, next)) {\n if (next) this.next();\n return this.tsParseTypeAliasDeclaration(node);\n }\n break;\n }\n }\n\n tsCheckLineTerminatorAndMatch(tokenType: TokenType, next: boolean) {\n return (next || this.match(tokenType)) && !this.isLineTerminator();\n }\n\n tsTryParseGenericAsyncArrowFunction(\n startPos: number,\n startLoc: Position,\n ): ?N.ArrowFunctionExpression {\n if (!this.isRelational(\"<\")) {\n return undefined;\n }\n\n const oldMaybeInArrowParameters = this.state.maybeInArrowParameters;\n const oldYieldPos = this.state.yieldPos;\n const oldAwaitPos = this.state.awaitPos;\n this.state.maybeInArrowParameters = true;\n this.state.yieldPos = -1;\n this.state.awaitPos = -1;\n\n const res: ?N.ArrowFunctionExpression = this.tsTryParseAndCatch(() => {\n const node: N.ArrowFunctionExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n node.typeParameters = this.tsParseTypeParameters();\n // Don't use overloaded parseFunctionParams which would look for \"<\" again.\n super.parseFunctionParams(node);\n node.returnType = this.tsTryParseTypeOrTypePredicateAnnotation();\n this.expect(tt.arrow);\n return node;\n });\n\n this.state.maybeInArrowParameters = oldMaybeInArrowParameters;\n this.state.yieldPos = oldYieldPos;\n this.state.awaitPos = oldAwaitPos;\n\n if (!res) {\n return undefined;\n }\n\n return this.parseArrowExpression(\n res,\n /* params are already set */ null,\n /* async */ true,\n );\n }\n\n tsParseTypeArguments(): N.TsTypeParameterInstantiation {\n const node = this.startNode();\n node.params = this.tsInType(() =>\n // Temporarily remove a JSX parsing context, which makes us scan different tokens.\n this.tsInNoContext(() => {\n this.expectRelational(\"<\");\n return this.tsParseDelimitedList(\n \"TypeParametersOrArguments\",\n this.tsParseType.bind(this),\n );\n }),\n );\n // This reads the next token after the `>` too, so do this in the enclosing context.\n // But be sure not to parse a regex in the jsx expression ` />`, so set exprAllowed = false\n this.state.exprAllowed = false;\n this.expectRelational(\">\");\n return this.finishNode(node, \"TSTypeParameterInstantiation\");\n }\n\n tsIsDeclarationStart(): boolean {\n if (this.match(tt.name)) {\n switch (this.state.value) {\n case \"abstract\":\n case \"declare\":\n case \"enum\":\n case \"interface\":\n case \"module\":\n case \"namespace\":\n case \"type\":\n return true;\n }\n }\n\n return false;\n }\n\n // ======================================================\n // OVERRIDES\n // ======================================================\n\n isExportDefaultSpecifier(): boolean {\n if (this.tsIsDeclarationStart()) return false;\n return super.isExportDefaultSpecifier();\n }\n\n parseAssignableListItem(\n allowModifiers: ?boolean,\n decorators: N.Decorator[],\n ): N.Pattern | N.TSParameterProperty {\n // Store original location/position to include modifiers in range\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n let accessibility: ?N.Accessibility;\n let readonly = false;\n if (allowModifiers) {\n accessibility = this.parseAccessModifier();\n readonly = !!this.tsParseModifier([\"readonly\"]);\n }\n\n const left = this.parseMaybeDefault();\n this.parseAssignableListItemTypes(left);\n const elt = this.parseMaybeDefault(left.start, left.loc.start, left);\n if (accessibility || readonly) {\n const pp: N.TSParameterProperty = this.startNodeAt(startPos, startLoc);\n if (decorators.length) {\n pp.decorators = decorators;\n }\n if (accessibility) pp.accessibility = accessibility;\n if (readonly) pp.readonly = readonly;\n if (elt.type !== \"Identifier\" && elt.type !== \"AssignmentPattern\") {\n this.raise(\n pp.start,\n \"A parameter property may not be declared using a binding pattern.\",\n );\n }\n pp.parameter = ((elt: any): N.Identifier | N.AssignmentPattern);\n return this.finishNode(pp, \"TSParameterProperty\");\n }\n\n if (decorators.length) {\n left.decorators = decorators;\n }\n\n return elt;\n }\n\n parseFunctionBodyAndFinish(\n node: N.BodilessFunctionOrMethodBase,\n type: string,\n isMethod?: boolean = false,\n ): void {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeOrTypePredicateAnnotation(tt.colon);\n }\n\n const bodilessType =\n type === \"FunctionDeclaration\"\n ? \"TSDeclareFunction\"\n : type === \"ClassMethod\"\n ? \"TSDeclareMethod\"\n : undefined;\n if (bodilessType && !this.match(tt.braceL) && this.isLineTerminator()) {\n this.finishNode(node, bodilessType);\n return;\n }\n\n super.parseFunctionBodyAndFinish(node, type, isMethod);\n }\n\n registerFunctionStatementId(node: N.Function): void {\n if (!node.body && node.id) {\n // Function ids are validated after parsing their body.\n // For bodyless function, we need to do it here.\n this.checkLVal(node.id, BIND_TS_AMBIENT, null, \"function name\");\n } else {\n super.registerFunctionStatementId(...arguments);\n }\n }\n\n parseSubscript(\n base: N.Expression,\n startPos: number,\n startLoc: Position,\n noCalls: ?boolean,\n state: N.ParseSubscriptState,\n ): N.Expression {\n if (!this.hasPrecedingLineBreak() && this.match(tt.bang)) {\n this.state.exprAllowed = false;\n this.next();\n\n const nonNullExpression: N.TsNonNullExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n nonNullExpression.expression = base;\n return this.finishNode(nonNullExpression, \"TSNonNullExpression\");\n }\n\n if (this.isRelational(\"<\")) {\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\n // There are number of things we are going to \"maybe\" parse, like type arguments on\n // tagged template expressions. If any of them fail, walk it back and continue.\n const result = this.tsTryParseAndCatch(() => {\n if (!noCalls && this.atPossibleAsync(base)) {\n // Almost certainly this is a generic async function `async () => ...\n // But it might be a call with a type argument `async();`\n const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(\n startPos,\n startLoc,\n );\n if (asyncArrowFn) {\n return asyncArrowFn;\n }\n }\n\n const node: N.CallExpression = this.startNodeAt(startPos, startLoc);\n node.callee = base;\n\n const typeArguments = this.tsParseTypeArguments();\n\n if (typeArguments) {\n if (!noCalls && this.eat(tt.parenL)) {\n // possibleAsync always false here, because we would have handled it above.\n // $FlowIgnore (won't be any undefined arguments)\n node.arguments = this.parseCallExpressionArguments(\n tt.parenR,\n /* possibleAsync */ false,\n );\n node.typeParameters = typeArguments;\n return this.finishCallExpression(node, state.optionalChainMember);\n } else if (this.match(tt.backQuote)) {\n return this.parseTaggedTemplateExpression(\n startPos,\n startLoc,\n base,\n state,\n typeArguments,\n );\n }\n }\n\n this.unexpected();\n });\n\n if (result) return result;\n }\n\n return super.parseSubscript(base, startPos, startLoc, noCalls, state);\n }\n\n parseNewArguments(node: N.NewExpression): void {\n if (this.isRelational(\"<\")) {\n // tsTryParseAndCatch is expensive, so avoid if not necessary.\n // 99% certain this is `new C();`. But may be `new C < T;`, which is also legal.\n const typeParameters = this.tsTryParseAndCatch(() => {\n const args = this.tsParseTypeArguments();\n if (!this.match(tt.parenL)) this.unexpected();\n return args;\n });\n if (typeParameters) {\n node.typeParameters = typeParameters;\n }\n }\n\n super.parseNewArguments(node);\n }\n\n parseExprOp(\n left: N.Expression,\n leftStartPos: number,\n leftStartLoc: Position,\n minPrec: number,\n noIn: ?boolean,\n ) {\n if (\n nonNull(tt._in.binop) > minPrec &&\n !this.hasPrecedingLineBreak() &&\n this.isContextual(\"as\")\n ) {\n const node: N.TsAsExpression = this.startNodeAt(\n leftStartPos,\n leftStartLoc,\n );\n node.expression = left;\n const _const = this.tsTryNextParseConstantContext();\n if (_const) {\n node.typeAnnotation = _const;\n } else {\n node.typeAnnotation = this.tsNextThenParseType();\n }\n this.finishNode(node, \"TSAsExpression\");\n return this.parseExprOp(\n node,\n leftStartPos,\n leftStartLoc,\n minPrec,\n noIn,\n );\n }\n\n return super.parseExprOp(left, leftStartPos, leftStartLoc, minPrec, noIn);\n }\n\n checkReservedWord(\n word: string, // eslint-disable-line no-unused-vars\n startLoc: number, // eslint-disable-line no-unused-vars\n checkKeywords: boolean, // eslint-disable-line no-unused-vars\n // eslint-disable-next-line no-unused-vars\n isBinding: boolean,\n ): void {\n // Don't bother checking for TypeScript code.\n // Strict mode words may be allowed as in `declare namespace N { const static: number; }`.\n // And we have a type checker anyway, so don't bother having the parser do it.\n }\n\n /*\n Don't bother doing this check in TypeScript code because:\n 1. We may have a nested export statement with the same name:\n export const x = 0;\n export namespace N {\n export const x = 1;\n }\n 2. We have a type checker to warn us about this sort of thing.\n */\n checkDuplicateExports() {}\n\n parseImport(node: N.Node): N.AnyImport {\n if (this.match(tt.name) && this.lookahead().type === tt.eq) {\n return this.tsParseImportEqualsDeclaration(node);\n }\n return super.parseImport(node);\n }\n\n parseExport(node: N.Node): N.AnyExport {\n if (this.match(tt._import)) {\n // `export import A = B;`\n this.expect(tt._import);\n return this.tsParseImportEqualsDeclaration(node, /* isExport */ true);\n } else if (this.eat(tt.eq)) {\n // `export = x;`\n const assign: N.TsExportAssignment = node;\n assign.expression = this.parseExpression();\n this.semicolon();\n return this.finishNode(assign, \"TSExportAssignment\");\n } else if (this.eatContextual(\"as\")) {\n // `export as namespace A;`\n const decl: N.TsNamespaceExportDeclaration = node;\n // See `parseNamespaceExportDeclaration` in TypeScript's own parser\n this.expectContextual(\"namespace\");\n decl.id = this.parseIdentifier();\n this.semicolon();\n return this.finishNode(decl, \"TSNamespaceExportDeclaration\");\n } else {\n return super.parseExport(node);\n }\n }\n\n isAbstractClass(): boolean {\n return (\n this.isContextual(\"abstract\") && this.lookahead().type === tt._class\n );\n }\n\n parseExportDefaultExpression(): N.Expression | N.Declaration {\n if (this.isAbstractClass()) {\n const cls = this.startNode();\n this.next(); // Skip \"abstract\"\n this.parseClass(cls, true, true);\n cls.abstract = true;\n return cls;\n }\n\n // export default interface allowed in:\n // https://github.com/Microsoft/TypeScript/pull/16040\n if (this.state.value === \"interface\") {\n const result = this.tsParseDeclaration(\n this.startNode(),\n this.state.value,\n true,\n );\n\n if (result) return result;\n }\n\n return super.parseExportDefaultExpression();\n }\n\n parseStatementContent(context: ?string, topLevel: ?boolean): N.Statement {\n if (this.state.type === tt._const) {\n const ahead = this.lookahead();\n if (ahead.type === tt.name && ahead.value === \"enum\") {\n const node: N.TsEnumDeclaration = this.startNode();\n this.expect(tt._const);\n this.expectContextual(\"enum\");\n return this.tsParseEnumDeclaration(node, /* isConst */ true);\n }\n }\n return super.parseStatementContent(context, topLevel);\n }\n\n parseAccessModifier(): ?N.Accessibility {\n return this.tsParseModifier([\"public\", \"protected\", \"private\"]);\n }\n\n parseClassMember(\n classBody: N.ClassBody,\n member: any,\n state: { hadConstructor: boolean },\n constructorAllowsSuper: boolean,\n ): void {\n this.tsParseModifiers(member, [\"declare\"]);\n const accessibility = this.parseAccessModifier();\n if (accessibility) member.accessibility = accessibility;\n this.tsParseModifiers(member, [\"declare\"]);\n\n super.parseClassMember(classBody, member, state, constructorAllowsSuper);\n }\n\n parseClassMemberWithIsStatic(\n classBody: N.ClassBody,\n member: N.ClassMember | N.TsIndexSignature,\n state: { hadConstructor: boolean },\n isStatic: boolean,\n constructorAllowsSuper: boolean,\n ): void {\n this.tsParseModifiers(member, [\"abstract\", \"readonly\", \"declare\"]);\n\n const idx = this.tsTryParseIndexSignature(member);\n if (idx) {\n classBody.body.push(idx);\n\n if ((member: any).abstract) {\n this.raise(\n member.start,\n \"Index signatures cannot have the 'abstract' modifier\",\n );\n }\n if (isStatic) {\n this.raise(\n member.start,\n \"Index signatures cannot have the 'static' modifier\",\n );\n }\n if ((member: any).accessibility) {\n this.raise(\n member.start,\n `Index signatures cannot have an accessibility modifier ('${\n (member: any).accessibility\n }')`,\n );\n }\n\n return;\n }\n\n /*:: invariant(member.type !== \"TSIndexSignature\") */\n\n super.parseClassMemberWithIsStatic(\n classBody,\n member,\n state,\n isStatic,\n constructorAllowsSuper,\n );\n }\n\n parsePostMemberNameModifiers(\n methodOrProp: N.ClassMethod | N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n const optional = this.eat(tt.question);\n if (optional) methodOrProp.optional = true;\n\n if ((methodOrProp: any).readonly && this.match(tt.parenL)) {\n this.raise(\n methodOrProp.start,\n \"Class methods cannot have the 'readonly' modifier\",\n );\n }\n\n if ((methodOrProp: any).declare && this.match(tt.parenL)) {\n this.raise(\n methodOrProp.start,\n \"Class methods cannot have the 'declare' modifier\",\n );\n }\n }\n\n // Note: The reason we do this in `parseExpressionStatement` and not `parseStatement`\n // is that e.g. `type()` is valid JS, so we must try parsing that first.\n // If it's really a type, we will parse `type` as the statement, and can correct it here\n // by parsing the rest.\n parseExpressionStatement(\n node: N.ExpressionStatement,\n expr: N.Expression,\n ): N.Statement {\n const decl =\n expr.type === \"Identifier\"\n ? this.tsParseExpressionStatement(node, expr)\n : undefined;\n return decl || super.parseExpressionStatement(node, expr);\n }\n\n // export type\n // Should be true for anything parsed by `tsTryParseExportDeclaration`.\n shouldParseExportDeclaration(): boolean {\n if (this.tsIsDeclarationStart()) return true;\n return super.shouldParseExportDeclaration();\n }\n\n // An apparent conditional expression could actually be an optional parameter in an arrow function.\n parseConditional(\n expr: N.Expression,\n noIn: ?boolean,\n startPos: number,\n startLoc: Position,\n refNeedsArrowPos?: ?Pos,\n ): N.Expression {\n // only do the expensive clone if there is a question mark\n // and if we come from inside parens\n if (!refNeedsArrowPos || !this.match(tt.question)) {\n return super.parseConditional(\n expr,\n noIn,\n startPos,\n startLoc,\n refNeedsArrowPos,\n );\n }\n\n const result = this.tryParse(() =>\n super.parseConditional(expr, noIn, startPos, startLoc),\n );\n\n if (!result.node) {\n // $FlowIgnore\n refNeedsArrowPos.start = result.error.pos || this.state.start;\n return expr;\n }\n if (result.error) this.state = result.failState;\n return result.node;\n }\n\n // Note: These \"type casts\" are *not* valid TS expressions.\n // But we parse them here and change them when completing the arrow function.\n parseParenItem(\n node: N.Expression,\n startPos: number,\n startLoc: Position,\n ): N.Expression {\n node = super.parseParenItem(node, startPos, startLoc);\n if (this.eat(tt.question)) {\n node.optional = true;\n // Include questionmark in location of node\n // Don't use this.finishNode() as otherwise we might process comments twice and\n // include already consumed parens\n this.resetEndLocation(node);\n }\n\n if (this.match(tt.colon)) {\n const typeCastNode: N.TsTypeCastExpression = this.startNodeAt(\n startPos,\n startLoc,\n );\n typeCastNode.expression = node;\n typeCastNode.typeAnnotation = this.tsParseTypeAnnotation();\n\n return this.finishNode(typeCastNode, \"TSTypeCastExpression\");\n }\n\n return node;\n }\n\n parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {\n // Store original location/position\n const startPos = this.state.start;\n const startLoc = this.state.startLoc;\n\n // \"export declare\" is equivalent to just \"export\".\n const isDeclare = this.eatContextual(\"declare\");\n\n let declaration: ?N.Declaration;\n\n if (this.match(tt.name)) {\n declaration = this.tsTryParseExportDeclaration();\n }\n if (!declaration) {\n declaration = super.parseExportDeclaration(node);\n }\n\n if (declaration && isDeclare) {\n // Reset location to include `declare` in range\n this.resetStartLocation(declaration, startPos, startLoc);\n\n declaration.declare = true;\n }\n\n return declaration;\n }\n\n parseClassId(\n node: N.Class,\n isStatement: boolean,\n optionalId: ?boolean,\n ): void {\n if ((!isStatement || optionalId) && this.isContextual(\"implements\")) {\n return;\n }\n\n super.parseClassId(\n node,\n isStatement,\n optionalId,\n (node: any).declare ? BIND_TS_AMBIENT : BIND_CLASS,\n );\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n }\n\n parseClassPropertyAnnotation(\n node: N.ClassProperty | N.ClassPrivateProperty,\n ): void {\n if (!node.optional && this.eat(tt.bang)) {\n node.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) node.typeAnnotation = type;\n }\n\n parseClassProperty(node: N.ClassProperty): N.ClassProperty {\n this.parseClassPropertyAnnotation(node);\n\n if (node.declare && this.match(tt.equal)) {\n this.raise(\n this.state.start,\n \"'declare' class fields cannot have an initializer\",\n );\n }\n\n return super.parseClassProperty(node);\n }\n\n parseClassPrivateProperty(\n node: N.ClassPrivateProperty,\n ): N.ClassPrivateProperty {\n // $FlowIgnore\n if (node.abstract) {\n this.raise(\n node.start,\n \"Private elements cannot have the 'abstract' modifier.\",\n );\n }\n\n // $FlowIgnore\n if (node.accessibility) {\n this.raise(\n node.start,\n `Private elements cannot have an accessibility modifier ('${node.accessibility}')`,\n );\n }\n\n this.parseClassPropertyAnnotation(node);\n return super.parseClassPrivateProperty(node);\n }\n\n pushClassMethod(\n classBody: N.ClassBody,\n method: N.ClassMethod,\n isGenerator: boolean,\n isAsync: boolean,\n isConstructor: boolean,\n allowsDirectSuper: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassMethod(\n classBody,\n method,\n isGenerator,\n isAsync,\n isConstructor,\n allowsDirectSuper,\n );\n }\n\n pushClassPrivateMethod(\n classBody: N.ClassBody,\n method: N.ClassPrivateMethod,\n isGenerator: boolean,\n isAsync: boolean,\n ): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) method.typeParameters = typeParameters;\n super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);\n }\n\n parseClassSuper(node: N.Class): void {\n super.parseClassSuper(node);\n if (node.superClass && this.isRelational(\"<\")) {\n node.superTypeParameters = this.tsParseTypeArguments();\n }\n if (this.eatContextual(\"implements\")) {\n node.implements = this.tsParseHeritageClause(\"implements\");\n }\n }\n\n parseObjPropValue(prop: N.ObjectMember, ...args): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) prop.typeParameters = typeParameters;\n\n super.parseObjPropValue(prop, ...args);\n }\n\n parseFunctionParams(node: N.Function, allowModifiers?: boolean): void {\n const typeParameters = this.tsTryParseTypeParameters();\n if (typeParameters) node.typeParameters = typeParameters;\n super.parseFunctionParams(node, allowModifiers);\n }\n\n // `let x: number;`\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\",\n ): void {\n super.parseVarId(decl, kind);\n if (decl.id.type === \"Identifier\" && this.eat(tt.bang)) {\n decl.definite = true;\n }\n\n const type = this.tsTryParseTypeAnnotation();\n if (type) {\n decl.id.typeAnnotation = type;\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n node.returnType = this.tsParseTypeAnnotation();\n }\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n parseMaybeAssign(...args): N.Expression {\n // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax.\n\n let state: ?State;\n let jsx;\n let typeCast;\n\n if (this.match(tt.jsxTagStart)) {\n // Prefer to parse JSX if possible. But may be an arrow fn.\n state = this.state.clone();\n\n jsx = this.tryParse(() => super.parseMaybeAssign(...args), state);\n /*:: invariant(!jsx.aborted) */\n\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n if (context[context.length - 1] === ct.j_oTag) {\n context.length -= 2;\n } else if (context[context.length - 1] === ct.j_expr) {\n context.length -= 1;\n }\n }\n\n if (!(jsx && jsx.error) && !this.isRelational(\"<\")) {\n return super.parseMaybeAssign(...args);\n }\n\n // Either way, we're looking at a '<': tt.jsxTagStart or relational.\n\n let typeParameters: N.TsTypeParameterDeclaration;\n state = state || this.state.clone();\n\n const arrow = this.tryParse(abort => {\n // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`.\n typeParameters = this.tsParseTypeParameters();\n const expr = super.parseMaybeAssign(...args);\n\n if (\n expr.type !== \"ArrowFunctionExpression\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n abort();\n }\n\n // Correct TypeScript code should have at least 1 type parameter, but don't crash on bad code.\n if (typeParameters && typeParameters.params.length !== 0) {\n this.resetStartLocationFromNode(expr, typeParameters);\n }\n expr.typeParameters = typeParameters;\n return expr;\n }, state);\n\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n if (!jsx) {\n // Try parsing a type cast instead of an arrow function.\n // This will never happen outside of JSX.\n // (Because in JSX the '<' should be a jsxTagStart and not a relational.\n assert(!this.hasPlugin(\"jsx\"));\n\n // This will start with a type assertion (via parseMaybeUnary).\n // But don't directly call `this.tsParseTypeAssertion` because we want to handle any binary after it.\n typeCast = this.tryParse(() => super.parseMaybeAssign(...args), state);\n /*:: invariant(!typeCast.aborted) */\n if (!typeCast.error) return typeCast.node;\n }\n\n if (jsx && jsx.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrow.node) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrow.node;\n }\n\n if (typeCast && typeCast.node) {\n /*:: invariant(typeCast.failState) */\n this.state = typeCast.failState;\n return typeCast.node;\n }\n\n if (jsx && jsx.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n if (typeCast && typeCast.thrown) throw typeCast.error;\n\n throw (jsx && jsx.error) || arrow.error || (typeCast && typeCast.error);\n }\n\n // Handle type assertions\n parseMaybeUnary(refExpressionErrors?: ?ExpressionErrors): N.Expression {\n if (!this.hasPlugin(\"jsx\") && this.isRelational(\"<\")) {\n return this.tsParseTypeAssertion();\n } else {\n return super.parseMaybeUnary(refExpressionErrors);\n }\n }\n\n parseArrow(node: N.ArrowFunctionExpression): ?N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n // This is different from how the TS parser does it.\n // TS uses lookahead. The Babel Parser parses it as a parenthesized expression and converts.\n\n const result = this.tryParse(abort => {\n const returnType = this.tsParseTypeOrTypePredicateAnnotation(\n tt.colon,\n );\n if (this.canInsertSemicolon() || !this.match(tt.arrow)) abort();\n return returnType;\n });\n\n if (result.aborted) return;\n\n if (!result.thrown) {\n if (result.error) this.state = result.failState;\n node.returnType = result.node;\n }\n }\n\n return super.parseArrow(node);\n }\n\n // Allow type annotations inside of a parameter list.\n parseAssignableListItemTypes(param: N.Pattern) {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(\n param.start,\n \"A binding pattern parameter cannot be optional in an implementation signature.\",\n );\n }\n\n ((param: any): N.Identifier).optional = true;\n }\n const type = this.tsTryParseTypeAnnotation();\n if (type) param.typeAnnotation = type;\n this.resetEndLocation(param);\n\n return param;\n }\n\n toAssignable(node: N.Node): N.Node {\n switch (node.type) {\n case \"TSTypeCastExpression\":\n return super.toAssignable(this.typeCastToParameter(node));\n case \"TSParameterProperty\":\n return super.toAssignable(node);\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n node.expression = this.toAssignable(node.expression);\n return node;\n default:\n return super.toAssignable(node);\n }\n }\n\n checkLVal(\n expr: N.Expression,\n bindingType: BindingTypes = BIND_NONE,\n checkClashes: ?{ [key: string]: boolean },\n contextDescription: string,\n ): void {\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n // Allow \"typecasts\" to appear on the left of assignment expressions,\n // because it may be in an arrow function.\n // e.g. `const f = (foo: number = 0) => foo;`\n return;\n case \"TSParameterProperty\":\n this.checkLVal(\n expr.parameter,\n bindingType,\n checkClashes,\n \"parameter property\",\n );\n return;\n case \"TSAsExpression\":\n case \"TSNonNullExpression\":\n case \"TSTypeAssertion\":\n this.checkLVal(\n expr.expression,\n bindingType,\n checkClashes,\n contextDescription,\n );\n return;\n default:\n super.checkLVal(expr, bindingType, checkClashes, contextDescription);\n return;\n }\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n parseMaybeDecoratorArguments(expr: N.Expression): N.Expression {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsParseTypeArguments();\n\n if (this.match(tt.parenL)) {\n const call = super.parseMaybeDecoratorArguments(expr);\n call.typeParameters = typeArguments;\n return call;\n }\n\n this.unexpected(this.state.start, tt.parenL);\n }\n\n return super.parseMaybeDecoratorArguments(expr);\n }\n\n // === === === === === === === === === === === === === === === ===\n // Note: All below methods are duplicates of something in flow.js.\n // Not sure what the best way to combine these is.\n // === === === === === === === === === === === === === === === ===\n\n isClassMethod(): boolean {\n return this.isRelational(\"<\") || super.isClassMethod();\n }\n\n isClassProperty(): boolean {\n return (\n this.match(tt.bang) || this.match(tt.colon) || super.isClassProperty()\n );\n }\n\n parseMaybeDefault(...args): N.Pattern {\n const node = super.parseMaybeDefault(...args);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(\n node.typeAnnotation.start,\n \"Type annotations must come before default assignments, \" +\n \"e.g. instead of `age = 25: number` use `age: number = 25`\",\n );\n }\n\n return node;\n }\n\n // ensure that inside types, we bypass the jsx parser plugin\n getTokenFromCode(code: number): void {\n if (this.state.inType && (code === 62 || code === 60)) {\n return this.finishOp(tt.relational, 1);\n } else {\n return super.getTokenFromCode(code);\n }\n }\n\n toAssignableList(exprList: N.Expression[]): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (!expr) continue;\n switch (expr.type) {\n case \"TSTypeCastExpression\":\n exprList[i] = this.typeCastToParameter(expr);\n break;\n case \"TSAsExpression\":\n case \"TSTypeAssertion\":\n if (!this.state.maybeInArrowParameters) {\n exprList[i] = this.typeCastToParameter(expr);\n } else {\n this.raise(\n expr.start,\n \"Unexpected type cast in parameter position.\",\n );\n }\n break;\n }\n }\n return super.toAssignableList(...arguments);\n }\n\n typeCastToParameter(node: N.TsTypeCastExpression): N.Node {\n node.expression.typeAnnotation = node.typeAnnotation;\n\n this.resetEndLocation(\n node.expression,\n node.typeAnnotation.end,\n node.typeAnnotation.loc.end,\n );\n\n return node.expression;\n }\n\n toReferencedList(\n exprList: $ReadOnlyArray,\n isInParens?: boolean, // eslint-disable-line no-unused-vars\n ): $ReadOnlyArray {\n for (let i = 0; i < exprList.length; i++) {\n const expr = exprList[i];\n if (expr && expr.type === \"TSTypeCastExpression\") {\n this.raise(expr.start, \"Did not expect a type annotation here.\");\n }\n }\n\n return exprList;\n }\n\n shouldParseArrow() {\n return this.match(tt.colon) || super.shouldParseArrow();\n }\n\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n canHaveLeadingDecorator() {\n // Avoid unnecessary lookahead in checking for abstract class unless needed!\n return super.canHaveLeadingDecorator() || this.isAbstractClass();\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n if (this.isRelational(\"<\")) {\n const typeArguments = this.tsTryParseAndCatch(() =>\n this.tsParseTypeArguments(),\n );\n if (typeArguments) node.typeParameters = typeArguments;\n }\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n getGetterSetterExpectedParamCount(\n method: N.ObjectMethod | N.ClassMethod,\n ): number {\n const baseCount = super.getGetterSetterExpectedParamCount(method);\n const firstParam = method.params[0];\n const hasContextParam =\n firstParam &&\n firstParam.type === \"Identifier\" &&\n firstParam.name === \"this\";\n\n return hasContextParam ? baseCount + 1 : baseCount;\n }\n };\n","// @flow\n\nimport * as charCodes from \"charcodes\";\n\nimport { types as tt, TokenType } from \"../tokenizer/types\";\nimport type Parser from \"../parser\";\nimport * as N from \"../types\";\n\ntt.placeholder = new TokenType(\"%%\", { startsExpr: true });\n\nexport type PlaceholderTypes =\n | \"Identifier\"\n | \"StringLiteral\"\n | \"Expression\"\n | \"Statement\"\n | \"Declaration\"\n | \"BlockStatement\"\n | \"ClassBody\"\n | \"Pattern\";\n\n// $PropertyType doesn't support enums. Use a fake \"switch\" (GetPlaceholderNode)\n//type MaybePlaceholder = $PropertyType | N.Placeholder;\n\ntype _Switch = $Call<\n (\n $ElementType<$ElementType, 0>,\n ) => $ElementType<$ElementType, 1>,\n Value,\n>;\ntype $Switch = _Switch;\n\ntype NodeOf = $Switch<\n T,\n [\n [\"Identifier\", N.Identifier],\n [\"StringLiteral\", N.StringLiteral],\n [\"Expression\", N.Expression],\n [\"Statement\", N.Statement],\n [\"Declaration\", N.Declaration],\n [\"BlockStatement\", N.BlockStatement],\n [\"ClassBody\", N.ClassBody],\n [\"Pattern\", N.Pattern],\n ],\n>;\n\n// Placeholder breaks everything, because its type is incompatible with\n// the substituted nodes.\ntype MaybePlaceholder = NodeOf; // | Placeholder\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parsePlaceholder(\n expectedNode: T,\n ): /*?N.Placeholder*/ ?MaybePlaceholder {\n if (this.match(tt.placeholder)) {\n const node = this.startNode();\n this.next();\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n\n // We can't use this.parseIdentifier because\n // we don't want nested placeholders.\n node.name = super.parseIdentifier(/* liberal */ true);\n\n this.assertNoSpace(\"Unexpected space in placeholder.\");\n this.expect(tt.placeholder);\n return this.finishPlaceholder(node, expectedNode);\n }\n }\n\n finishPlaceholder(\n node: N.Node,\n expectedNode: T,\n ): /*N.Placeholder*/ MaybePlaceholder {\n const isFinished = !!(node.expectedNode && node.type === \"Placeholder\");\n node.expectedNode = expectedNode;\n\n return isFinished ? node : this.finishNode(node, \"Placeholder\");\n }\n\n /* ============================================================ *\n * tokenizer/index.js *\n * ============================================================ */\n\n getTokenFromCode(code: number) {\n if (\n code === charCodes.percentSign &&\n this.input.charCodeAt(this.state.pos + 1) === charCodes.percentSign\n ) {\n return this.finishOp(tt.placeholder, 2);\n }\n\n return super.getTokenFromCode(...arguments);\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(): MaybePlaceholder<\"Expression\"> {\n return (\n this.parsePlaceholder(\"Expression\") || super.parseExprAtom(...arguments)\n );\n }\n\n parseIdentifier(): MaybePlaceholder<\"Identifier\"> {\n // NOTE: This function only handles identifiers outside of\n // expressions and binding patterns, since they are already\n // handled by the parseExprAtom and parseBindingAtom functions.\n // This is needed, for example, to parse \"class %%NAME%% {}\".\n return (\n this.parsePlaceholder(\"Identifier\") ||\n super.parseIdentifier(...arguments)\n );\n }\n\n checkReservedWord(word: string): void {\n // Sometimes we call #checkReservedWord(node.name), expecting\n // that node is an Identifier. If it is a Placeholder, name\n // will be undefined.\n if (word !== undefined) super.checkReservedWord(...arguments);\n }\n\n /* ============================================================ *\n * parser/lval.js *\n * ============================================================ */\n\n parseBindingAtom(): MaybePlaceholder<\"Pattern\"> {\n return (\n this.parsePlaceholder(\"Pattern\") || super.parseBindingAtom(...arguments)\n );\n }\n\n checkLVal(expr: N.Expression): void {\n if (expr.type !== \"Placeholder\") super.checkLVal(...arguments);\n }\n\n toAssignable(node: N.Node): N.Node {\n if (\n node &&\n node.type === \"Placeholder\" &&\n node.expectedNode === \"Expression\"\n ) {\n node.expectedNode = \"Pattern\";\n return node;\n }\n return super.toAssignable(...arguments);\n }\n\n /* ============================================================ *\n * parser/statement.js *\n * ============================================================ */\n\n verifyBreakContinue(node: N.BreakStatement | N.ContinueStatement) {\n if (node.label && node.label.type === \"Placeholder\") return;\n super.verifyBreakContinue(...arguments);\n }\n\n parseExpressionStatement(\n node: MaybePlaceholder<\"Statement\">,\n expr: N.Expression,\n ): MaybePlaceholder<\"Statement\"> {\n if (\n expr.type !== \"Placeholder\" ||\n (expr.extra && expr.extra.parenthesized)\n ) {\n return super.parseExpressionStatement(...arguments);\n }\n\n if (this.match(tt.colon)) {\n const stmt: N.LabeledStatement = node;\n stmt.label = this.finishPlaceholder(expr, \"Identifier\");\n this.next();\n stmt.body = this.parseStatement(\"label\");\n return this.finishNode(stmt, \"LabeledStatement\");\n }\n\n this.semicolon();\n\n node.name = expr.name;\n return this.finishPlaceholder(node, \"Statement\");\n }\n\n parseBlock(): MaybePlaceholder<\"BlockStatement\"> {\n return (\n this.parsePlaceholder(\"BlockStatement\") ||\n super.parseBlock(...arguments)\n );\n }\n\n parseFunctionId(): ?MaybePlaceholder<\"Identifier\"> {\n return (\n this.parsePlaceholder(\"Identifier\") ||\n super.parseFunctionId(...arguments)\n );\n }\n\n parseClass(\n node: T,\n isStatement: /* T === ClassDeclaration */ boolean,\n optionalId?: boolean,\n ): T {\n const type = isStatement ? \"ClassDeclaration\" : \"ClassExpression\";\n\n this.next();\n this.takeDecorators(node);\n\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (placeholder) {\n if (\n this.match(tt._extends) ||\n this.match(tt.placeholder) ||\n this.match(tt.braceL)\n ) {\n node.id = placeholder;\n } else if (optionalId || !isStatement) {\n node.id = null;\n node.body = this.finishPlaceholder(placeholder, \"ClassBody\");\n return this.finishNode(node, type);\n } else {\n this.unexpected(null, \"A class name is required\");\n }\n } else {\n this.parseClassId(node, isStatement, optionalId);\n }\n\n this.parseClassSuper(node);\n node.body =\n this.parsePlaceholder(\"ClassBody\") ||\n this.parseClassBody(!!node.superClass);\n return this.finishNode(node, type);\n }\n\n parseExport(node: N.Node): N.Node {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseExport(...arguments);\n\n if (!this.isContextual(\"from\") && !this.match(tt.comma)) {\n // export %%DECL%%;\n node.specifiers = [];\n node.source = null;\n node.declaration = this.finishPlaceholder(placeholder, \"Declaration\");\n return this.finishNode(node, \"ExportNamedDeclaration\");\n }\n\n // export %%NAME%% from \"foo\";\n this.expectPlugin(\"exportDefaultFrom\");\n const specifier = this.startNode();\n specifier.exported = placeholder;\n node.specifiers = [this.finishNode(specifier, \"ExportDefaultSpecifier\")];\n\n return super.parseExport(node);\n }\n\n maybeParseExportDefaultSpecifier(node: N.Node): boolean {\n if (node.specifiers && node.specifiers.length > 0) {\n // \"export %%NAME%%\" has already been parsed by #parseExport.\n return true;\n }\n return super.maybeParseExportDefaultSpecifier(...arguments);\n }\n\n checkExport(node: N.ExportNamedDeclaration): void {\n const { specifiers } = node;\n if (specifiers && specifiers.length) {\n node.specifiers = specifiers.filter(\n node => node.exported.type === \"Placeholder\",\n );\n }\n super.checkExport(node);\n node.specifiers = specifiers;\n }\n\n parseImport(\n node: N.Node,\n ): N.ImportDeclaration | N.TsImportEqualsDeclaration {\n const placeholder = this.parsePlaceholder(\"Identifier\");\n if (!placeholder) return super.parseImport(...arguments);\n\n node.specifiers = [];\n\n if (!this.isContextual(\"from\") && !this.match(tt.comma)) {\n // import %%STRING%%;\n node.source = this.finishPlaceholder(placeholder, \"StringLiteral\");\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n // import %%DEFAULT%% ...\n const specifier = this.startNodeAtNode(placeholder);\n specifier.local = placeholder;\n this.finishNode(specifier, \"ImportDefaultSpecifier\");\n node.specifiers.push(specifier);\n\n if (this.eat(tt.comma)) {\n // import %%DEFAULT%%, * as ...\n const hasStarImport = this.maybeParseStarImportSpecifier(node);\n\n // import %%DEFAULT%%, { ...\n if (!hasStarImport) this.parseNamedImportSpecifiers(node);\n }\n\n this.expectContextual(\"from\");\n node.source = this.parseImportSource();\n this.semicolon();\n return this.finishNode(node, \"ImportDeclaration\");\n }\n\n parseImportSource(): MaybePlaceholder<\"StringLiteral\"> {\n // import ... from %%STRING%%;\n\n return (\n this.parsePlaceholder(\"StringLiteral\") ||\n super.parseImportSource(...arguments)\n );\n }\n };\n","import type Parser from \"../parser\";\nimport { types as tt } from \"../tokenizer/types\";\nimport * as N from \"../types\";\n\nexport default (superClass: Class): Class =>\n class extends superClass {\n parseV8Intrinsic(): N.Expression {\n if (this.match(tt.modulo)) {\n const v8IntrinsicStart = this.state.start;\n // let the `loc` of Identifier starts from `%`\n const node = this.startNode();\n this.eat(tt.modulo);\n if (this.match(tt.name)) {\n const name = this.parseIdentifierName(this.state.start);\n const identifier = this.createIdentifier(node, name);\n identifier.type = \"V8IntrinsicIdentifier\";\n if (this.match(tt.parenL)) {\n return identifier;\n }\n }\n this.unexpected(v8IntrinsicStart);\n }\n }\n\n /* ============================================================ *\n * parser/expression.js *\n * ============================================================ */\n\n parseExprAtom(): N.Expression {\n return this.parseV8Intrinsic() || super.parseExprAtom(...arguments);\n }\n };\n","// @flow\n\nimport type Parser from \"./parser\";\n\nexport type Plugin = string | [string, Object];\n\nexport type PluginList = $ReadOnlyArray;\n\nexport type MixinPlugin = (superClass: Class) => Class;\n\nexport function hasPlugin(plugins: PluginList, name: string): boolean {\n return plugins.some(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n}\n\nexport function getPluginOption(\n plugins: PluginList,\n name: string,\n option: string,\n) {\n const plugin = plugins.find(plugin => {\n if (Array.isArray(plugin)) {\n return plugin[0] === name;\n } else {\n return plugin === name;\n }\n });\n\n if (plugin && Array.isArray(plugin)) {\n return plugin[1][option];\n }\n\n return null;\n}\n\nconst PIPELINE_PROPOSALS = [\"minimal\", \"smart\", \"fsharp\"];\n\nexport function validatePlugins(plugins: PluginList) {\n if (hasPlugin(plugins, \"decorators\")) {\n if (hasPlugin(plugins, \"decorators-legacy\")) {\n throw new Error(\n \"Cannot use the decorators and decorators-legacy plugin together\",\n );\n }\n\n const decoratorsBeforeExport = getPluginOption(\n plugins,\n \"decorators\",\n \"decoratorsBeforeExport\",\n );\n if (decoratorsBeforeExport == null) {\n throw new Error(\n \"The 'decorators' plugin requires a 'decoratorsBeforeExport' option,\" +\n \" whose value must be a boolean. If you are migrating from\" +\n \" Babylon/Babel 6 or want to use the old decorators proposal, you\" +\n \" should use the 'decorators-legacy' plugin instead of 'decorators'.\",\n );\n } else if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n if (hasPlugin(plugins, \"flow\") && hasPlugin(plugins, \"typescript\")) {\n throw new Error(\"Cannot combine flow and typescript plugins.\");\n }\n\n if (hasPlugin(plugins, \"placeholders\") && hasPlugin(plugins, \"v8intrinsic\")) {\n throw new Error(\"Cannot combine placeholders and v8intrinsic plugins.\");\n }\n\n if (\n hasPlugin(plugins, \"pipelineOperator\") &&\n !PIPELINE_PROPOSALS.includes(\n getPluginOption(plugins, \"pipelineOperator\", \"proposal\"),\n )\n ) {\n throw new Error(\n \"'pipelineOperator' requires 'proposal' option whose value should be one of: \" +\n PIPELINE_PROPOSALS.map(p => `'${p}'`).join(\", \"),\n );\n }\n}\n\n// These plugins are defined using a mixin which extends the parser class.\n\nimport estree from \"./plugins/estree\";\nimport flow from \"./plugins/flow\";\nimport jsx from \"./plugins/jsx\";\nimport typescript from \"./plugins/typescript\";\nimport placeholders from \"./plugins/placeholders\";\nimport v8intrinsic from \"./plugins/v8intrinsic\";\n\n// NOTE: order is important. estree must come first; placeholders must come last.\nexport const mixinPlugins: { [name: string]: MixinPlugin } = {\n estree,\n jsx,\n flow,\n typescript,\n v8intrinsic,\n placeholders,\n};\n\nexport const mixinPluginNames: $ReadOnlyArray = Object.keys(\n mixinPlugins,\n);\n","// @flow\n\nimport type { PluginList } from \"./plugin-utils\";\n\n// A second optional argument can be given to further configure\n// the parser process. These options are recognized:\n\nexport type SourceType = \"script\" | \"module\" | \"unambiguous\";\n\nexport type Options = {\n sourceType: SourceType,\n sourceFilename?: string,\n startLine: number,\n allowAwaitOutsideFunction: boolean,\n allowReturnOutsideFunction: boolean,\n allowImportExportEverywhere: boolean,\n allowSuperOutsideMethod: boolean,\n allowUndeclaredExports: boolean,\n plugins: PluginList,\n strictMode: ?boolean,\n ranges: boolean,\n tokens: boolean,\n createParenthesizedExpressions: boolean,\n errorRecovery: boolean,\n};\n\nexport const defaultOptions: Options = {\n // Source type (\"script\" or \"module\") for different semantics\n sourceType: \"script\",\n // Source filename.\n sourceFilename: undefined,\n // Line from which to start counting source. Useful for\n // integration with other tools.\n startLine: 1,\n // When enabled, await at the top level is not considered an\n // error.\n allowAwaitOutsideFunction: false,\n // When enabled, a return at the top level is not considered an\n // error.\n allowReturnOutsideFunction: false,\n // When enabled, import/export statements are not constrained to\n // appearing at the top of the program.\n allowImportExportEverywhere: false,\n // TODO\n allowSuperOutsideMethod: false,\n // When enabled, export statements can reference undeclared variables.\n allowUndeclaredExports: false,\n // An array of plugins to enable\n plugins: [],\n // TODO\n strictMode: null,\n // Nodes have their start and end characters offsets recorded in\n // `start` and `end` properties (directly on the node, rather than\n // the `loc` object, which holds line/column data. To also add a\n // [semi-standardized][range] `range` property holding a `[start,\n // end]` array with the same numbers, set the `ranges` option to\n // `true`.\n //\n // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678\n ranges: false,\n // Adds all parsed tokens to a `tokens` property on the `File` node\n tokens: false,\n // Whether to create ParenthesizedExpression AST nodes (if false\n // the parser sets extra.parenthesized on the expression nodes instead).\n createParenthesizedExpressions: false,\n // When enabled, errors are attached to the AST instead of being directly thrown.\n // Some errors will still throw, because @babel/parser can't always recover.\n errorRecovery: false,\n};\n\n// Interpret and default an options object\n\nexport function getOptions(opts: ?Options): Options {\n const options: any = {};\n for (const key of Object.keys(defaultOptions)) {\n options[key] = opts && opts[key] != null ? opts[key] : defaultOptions[key];\n }\n return options;\n}\n","// @flow\n\nimport { lineBreakG } from \"./whitespace\";\n\nexport type Pos = {\n start: number,\n};\n\n// These are used when `options.locations` is on, for the\n// `startLoc` and `endLoc` properties.\n\nexport class Position {\n line: number;\n column: number;\n\n constructor(line: number, col: number) {\n this.line = line;\n this.column = col;\n }\n}\n\nexport class SourceLocation {\n start: Position;\n end: Position;\n filename: string;\n identifierName: ?string;\n\n constructor(start: Position, end?: Position) {\n this.start = start;\n // $FlowIgnore (may start as null, but initialized later)\n this.end = end;\n }\n}\n\n// The `getLineInfo` function is mostly useful when the\n// `locations` option is off (for performance reasons) and you\n// want to find the line/column position for a given character\n// offset. `input` should be the code string that the offset refers\n// into.\n\nexport function getLineInfo(input: string, offset: number): Position {\n let line = 1;\n let lineStart = 0;\n let match;\n lineBreakG.lastIndex = 0;\n while ((match = lineBreakG.exec(input)) && match.index < offset) {\n line++;\n lineStart = lineBreakG.lastIndex;\n }\n\n return new Position(line, offset - lineStart);\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport type State from \"../tokenizer/state\";\nimport type { PluginsMap } from \"./index\";\nimport type ScopeHandler from \"../util/scope\";\nimport type ClassScopeHandler from \"../util/class-scope\";\nimport type ProductionParameterHandler from \"../util/production-parameter\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n options: Options;\n inModule: boolean;\n scope: ScopeHandler<*>;\n classScope: ClassScopeHandler;\n prodParam: ProductionParameterHandler;\n plugins: PluginsMap;\n filename: ?string;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n input: string;\n length: number;\n\n hasPlugin(name: string): boolean {\n return this.plugins.has(name);\n }\n\n getPluginOption(plugin: string, name: string) {\n // $FlowIssue\n if (this.hasPlugin(plugin)) return this.plugins.get(plugin)[name];\n }\n}\n","// @flow\n\n/**\n * Based on the comment attachment algorithm used in espree and estraverse.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nimport BaseParser from \"./base\";\nimport type { Comment, Node } from \"../types\";\n\nfunction last(stack: $ReadOnlyArray): T {\n return stack[stack.length - 1];\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n this.state.trailingComments.push(comment);\n this.state.leadingComments.push(comment);\n }\n\n adjustCommentsAfterTrailingComma(\n node: Node,\n elements: (Node | null)[],\n // When the current node is followed by a token which hasn't a respective AST node, we\n // need to take all the trailing comments to prevent them from being attached to an\n // unrelated node. e.g. in\n // var { x } /* cmt */ = { y }\n // we don't want /* cmt */ to be attached to { y }.\n // On the other hand, in\n // fn(x) [new line] /* cmt */ [new line] y\n // /* cmt */ is both a trailing comment of fn(x) and a leading comment of y\n takeAllComments?: boolean,\n ) {\n if (this.state.leadingComments.length === 0) {\n return;\n }\n\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null) {\n return;\n }\n\n for (let j = 0; j < this.state.leadingComments.length; j++) {\n if (\n this.state.leadingComments[j].end < this.state.commentPreviousNode.end\n ) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n\n const newTrailingComments = [];\n for (let i = 0; i < this.state.leadingComments.length; i++) {\n const leadingComment = this.state.leadingComments[i];\n if (leadingComment.end < node.end) {\n newTrailingComments.push(leadingComment);\n\n // Perf: we don't need to splice if we are going to reset the array anyway\n if (!takeAllComments) {\n this.state.leadingComments.splice(i, 1);\n i--;\n }\n } else {\n if (node.trailingComments === undefined) {\n node.trailingComments = [];\n }\n node.trailingComments.push(leadingComment);\n }\n }\n if (takeAllComments) this.state.leadingComments = [];\n\n if (newTrailingComments.length > 0) {\n lastElement.trailingComments = newTrailingComments;\n } else if (lastElement.trailingComments !== undefined) {\n lastElement.trailingComments = [];\n }\n }\n\n processComment(node: Node): void {\n if (node.type === \"Program\" && node.body.length > 0) return;\n\n const stack = this.state.commentStack;\n\n let firstChild, lastChild, trailingComments, i, j;\n\n if (this.state.trailingComments.length > 0) {\n // If the first comment in trailingComments comes after the\n // current node, then we're good - all comments in the array will\n // come after the node and so it's safe to add them as official\n // trailingComments.\n if (this.state.trailingComments[0].start >= node.end) {\n trailingComments = this.state.trailingComments;\n this.state.trailingComments = [];\n } else {\n // Otherwise, if the first comment doesn't come after the\n // current node, that means we have a mix of leading and trailing\n // comments in the array and that leadingComments contains the\n // same items as trailingComments. Reset trailingComments to\n // zero items and we'll handle this by evaluating leadingComments\n // later.\n this.state.trailingComments.length = 0;\n }\n } else if (stack.length > 0) {\n const lastInStack = last(stack);\n if (\n lastInStack.trailingComments &&\n lastInStack.trailingComments[0].start >= node.end\n ) {\n trailingComments = lastInStack.trailingComments;\n delete lastInStack.trailingComments;\n }\n }\n\n // Eating the stack.\n if (stack.length > 0 && last(stack).start >= node.start) {\n firstChild = stack.pop();\n }\n\n while (stack.length > 0 && last(stack).start >= node.start) {\n lastChild = stack.pop();\n }\n\n if (!lastChild && firstChild) lastChild = firstChild;\n\n // Adjust comments that follow a trailing comma on the last element in a\n // comma separated list of nodes to be the trailing comments on the last\n // element\n if (firstChild) {\n switch (node.type) {\n case \"ObjectExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.properties);\n break;\n case \"ObjectPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.properties, true);\n break;\n case \"CallExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.arguments);\n break;\n case \"ArrayExpression\":\n this.adjustCommentsAfterTrailingComma(node, node.elements);\n break;\n case \"ArrayPattern\":\n this.adjustCommentsAfterTrailingComma(node, node.elements, true);\n break;\n }\n } else if (\n this.state.commentPreviousNode &&\n ((this.state.commentPreviousNode.type === \"ImportSpecifier\" &&\n node.type !== \"ImportSpecifier\") ||\n (this.state.commentPreviousNode.type === \"ExportSpecifier\" &&\n node.type !== \"ExportSpecifier\"))\n ) {\n this.adjustCommentsAfterTrailingComma(node, [\n this.state.commentPreviousNode,\n ]);\n }\n\n if (lastChild) {\n if (lastChild.leadingComments) {\n if (\n lastChild !== node &&\n lastChild.leadingComments.length > 0 &&\n last(lastChild.leadingComments).end <= node.start\n ) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n } else {\n // A leading comment for an anonymous class had been stolen by its first ClassMethod,\n // so this takes back the leading comment.\n // See also: https://github.com/eslint/espree/issues/158\n for (i = lastChild.leadingComments.length - 2; i >= 0; --i) {\n if (lastChild.leadingComments[i].end <= node.start) {\n node.leadingComments = lastChild.leadingComments.splice(0, i + 1);\n break;\n }\n }\n }\n }\n } else if (this.state.leadingComments.length > 0) {\n if (last(this.state.leadingComments).end <= node.start) {\n if (this.state.commentPreviousNode) {\n for (j = 0; j < this.state.leadingComments.length; j++) {\n if (\n this.state.leadingComments[j].end <\n this.state.commentPreviousNode.end\n ) {\n this.state.leadingComments.splice(j, 1);\n j--;\n }\n }\n }\n if (this.state.leadingComments.length > 0) {\n node.leadingComments = this.state.leadingComments;\n this.state.leadingComments = [];\n }\n } else {\n // https://github.com/eslint/espree/issues/2\n //\n // In special cases, such as return (without a value) and\n // debugger, all comments will end up as leadingComments and\n // will otherwise be eliminated. This step runs when the\n // commentStack is empty and there are comments left\n // in leadingComments.\n //\n // This loop figures out the stopping point between the actual\n // leading and trailing comments by finding the location of the\n // first comment that comes after the given node.\n for (i = 0; i < this.state.leadingComments.length; i++) {\n if (this.state.leadingComments[i].end > node.start) {\n break;\n }\n }\n\n // Split the array based on the location of the first comment\n // that comes after the node. Keep in mind that this could\n // result in an empty array, and if so, the array must be\n // deleted.\n const leadingComments = this.state.leadingComments.slice(0, i);\n\n if (leadingComments.length) {\n node.leadingComments = leadingComments;\n }\n\n // Similarly, trailing comments are attached later. The variable\n // must be reset to null if there are no trailing comments.\n trailingComments = this.state.leadingComments.slice(i);\n if (trailingComments.length === 0) {\n trailingComments = null;\n }\n }\n }\n\n this.state.commentPreviousNode = node;\n\n if (trailingComments) {\n if (\n trailingComments.length &&\n trailingComments[0].start >= node.start &&\n last(trailingComments).end <= node.end\n ) {\n node.innerComments = trailingComments;\n } else {\n node.trailingComments = trailingComments;\n }\n }\n\n stack.push(node);\n }\n}\n","// @flow\n\nimport { getLineInfo, type Position } from \"../util/location\";\nimport CommentsParser from \"./comments\";\n\n// This function is used to raise exceptions on parse errors. It\n// takes an offset integer (into the current `input`) to indicate\n// the location of the error, attaches the position to the end\n// of the error message, and then raises a `SyntaxError` with that\n// message.\n\nexport default class LocationParser extends CommentsParser {\n // Forward-declaration: defined in tokenizer/index.js\n /*::\n +isLookahead: boolean;\n */\n\n getLocationForPosition(pos: number): Position {\n let loc;\n if (pos === this.state.start) loc = this.state.startLoc;\n else if (pos === this.state.lastTokStart) loc = this.state.lastTokStartLoc;\n else if (pos === this.state.end) loc = this.state.endLoc;\n else if (pos === this.state.lastTokEnd) loc = this.state.lastTokEndLoc;\n else loc = getLineInfo(this.input, pos);\n\n return loc;\n }\n\n raise(\n pos: number,\n message: string,\n {\n missingPluginNames,\n code,\n }: {\n missingPluginNames?: Array,\n code?: string,\n } = {},\n ): Error | empty {\n const loc = this.getLocationForPosition(pos);\n\n message += ` (${loc.line}:${loc.column})`;\n // $FlowIgnore\n const err: SyntaxError & { pos: number, loc: Position } = new SyntaxError(\n message,\n );\n err.pos = pos;\n err.loc = loc;\n if (missingPluginNames) {\n err.missingPlugin = missingPluginNames;\n }\n if (code !== undefined) {\n err.code = code;\n }\n\n if (this.options.errorRecovery) {\n if (!this.isLookahead) this.state.errors.push(err);\n return err;\n } else {\n throw err;\n }\n }\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport { Position } from \"../util/location\";\n\nimport { types as ct, type TokContext } from \"./context\";\nimport { types as tt, type TokenType } from \"./types\";\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number,\n\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0,\n};\n\nexport default class State {\n strict: boolean;\n curLine: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init(options: Options): void {\n this.strict =\n options.strictMode === false ? false : options.sourceType === \"module\";\n\n this.curLine = options.startLine;\n this.startLoc = this.endLoc = this.curPosition();\n }\n\n errors: SyntaxError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n inParameters: boolean = false;\n maybeInArrowParameters: boolean = false;\n inPipeline: boolean = false;\n inType: boolean = false;\n noAnonFunctionType: boolean = false;\n inPropertyName: boolean = false;\n hasFlowComment: boolean = false;\n isIterator: boolean = false;\n\n // For the smartPipelines plugin:\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F# plugin\n soloAwait: boolean = false;\n inFSharpPipelineDirectBody: boolean = false;\n\n // Labels in scope.\n labels: Array<{\n kind: ?(\"loop\" | \"switch\"),\n name?: ?string,\n statementStart?: number,\n }> = [];\n\n // Leading decorators. Last element of the stack represents the decorators in current context.\n // Supports nesting of decorators, e.g. @foo(@bar class inner {}) class outer {}\n // where @foo belongs to the outer class and @bar to the inner\n decoratorStack: Array> = [[]];\n\n // Positions to delayed-check that yield/await does not exist in default parameters.\n yieldPos: number = -1;\n awaitPos: number = -1;\n\n // Comment store.\n comments: Array = [];\n\n // Comment attachment store\n trailingComments: Array = [];\n leadingComments: Array = [];\n commentStack: Array<{\n start: number,\n leadingComments: ?Array,\n trailingComments: ?Array,\n type: string,\n }> = [];\n // $FlowIgnore this is initialized when the parser starts.\n commentPreviousNode: N.Node = null;\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n lineStart: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // $FlowIgnore this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // $FlowIgnore this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n lastTokStart: number = 0;\n lastTokEnd: number = 0;\n\n // The context stack is used to superficially track syntactic\n // context to predict whether a regular expression is allowed in a\n // given position.\n context: Array = [ct.braceStatement];\n exprAllowed: boolean = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n containsEsc: boolean = false;\n\n // TODO\n containsOctal: boolean = false;\n octalPosition: ?number = null;\n\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n exportedIdentifiers: Array = [];\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n curPosition(): Position {\n return new Position(this.curLine, this.pos - this.lineStart);\n }\n\n clone(skipArrays?: boolean): State {\n const state = new State();\n const keys = Object.keys(this);\n for (let i = 0, length = keys.length; i < length; i++) {\n const key = keys[i];\n // $FlowIgnore\n let val = this[key];\n\n if (!skipArrays && Array.isArray(val)) {\n val = val.slice();\n }\n\n // $FlowIgnore\n state[key] = val;\n }\n\n return state;\n }\n}\n","// @flow\n\nimport type { Options } from \"../options\";\nimport * as N from \"../types\";\nimport type { Position } from \"../util/location\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier\";\nimport { types as tt, keywords as keywordTypes, type TokenType } from \"./types\";\nimport { type TokContext, types as ct } from \"./context\";\nimport LocationParser from \"../parser/location\";\nimport { SourceLocation } from \"../util/location\";\nimport {\n lineBreak,\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n} from \"../util/whitespace\";\nimport State from \"./state\";\n\nconst VALID_REGEX_FLAGS = new Set([\"g\", \"m\", \"s\", \"i\", \"y\", \"u\"]);\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\n\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: [\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ],\n hex: [\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ],\n};\n\nconst allowedNumericSeparatorSiblings = {};\nallowedNumericSeparatorSiblings.bin = [\n // 0 - 1\n charCodes.digit0,\n charCodes.digit1,\n];\nallowedNumericSeparatorSiblings.oct = [\n // 0 - 7\n ...allowedNumericSeparatorSiblings.bin,\n\n charCodes.digit2,\n charCodes.digit3,\n charCodes.digit4,\n charCodes.digit5,\n charCodes.digit6,\n charCodes.digit7,\n];\nallowedNumericSeparatorSiblings.dec = [\n // 0 - 9\n ...allowedNumericSeparatorSiblings.oct,\n\n charCodes.digit8,\n charCodes.digit9,\n];\n\nallowedNumericSeparatorSiblings.hex = [\n // 0 - 9, A - F, a - f,\n ...allowedNumericSeparatorSiblings.dec,\n\n charCodes.uppercaseA,\n charCodes.uppercaseB,\n charCodes.uppercaseC,\n charCodes.uppercaseD,\n charCodes.uppercaseE,\n charCodes.uppercaseF,\n\n charCodes.lowercaseA,\n charCodes.lowercaseB,\n charCodes.lowercaseC,\n charCodes.lowercaseD,\n charCodes.lowercaseE,\n charCodes.lowercaseF,\n];\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n this.type = state.type;\n this.value = state.value;\n this.start = state.start;\n this.end = state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n type: TokenType;\n value: any;\n start: number;\n end: number;\n loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default class Tokenizer extends LocationParser {\n // Forward-declarations\n // parser/util.js\n /*::\n +unexpected: (pos?: ?number, messageOrType?: string | TokenType) => empty;\n */\n\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n if (!this.isLookahead) {\n this.checkKeywordEscapes();\n if (this.options.tokens) {\n this.pushToken(new Token(this.state));\n }\n }\n\n this.state.lastTokEnd = this.state.end;\n this.state.lastTokStart = this.state.start;\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n // TODO\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n // TODO\n\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n // TODO\n\n lookahead(): State {\n const old = this.state;\n this.state = old.clone(true);\n\n this.isLookahead = true;\n this.next();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n const thisTokEnd = this.state.pos;\n skipWhiteSpace.lastIndex = thisTokEnd;\n const skip = skipWhiteSpace.exec(this.input);\n // $FlowIgnore: The skipWhiteSpace ensures to match any string\n return thisTokEnd + skip[0].length;\n }\n\n lookaheadCharCode(): number {\n return this.input.charCodeAt(this.nextTokenStart());\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (!this.match(tt.num) && !this.match(tt.string)) return;\n this.state.pos = this.state.start;\n while (this.state.pos < this.state.lineStart) {\n this.state.lineStart =\n this.input.lastIndexOf(\"\\n\", this.state.lineStart - 2) + 1;\n --this.state.curLine;\n }\n this.nextToken();\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related\n // properties.\n\n nextToken(): void {\n const curContext = this.curContext();\n if (!curContext || !curContext.preserveSpace) this.skipSpace();\n\n this.state.containsOctal = false;\n this.state.octalPosition = null;\n this.state.start = this.state.pos;\n this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n if (curContext.override) {\n curContext.override(this);\n } else {\n this.getTokenFromCode(this.input.codePointAt(this.state.pos));\n }\n }\n\n pushComment(\n block: boolean,\n text: string,\n start: number,\n end: number,\n startLoc: Position,\n endLoc: Position,\n ): void {\n const comment = {\n type: block ? \"CommentBlock\" : \"CommentLine\",\n value: text,\n start: start,\n end: end,\n loc: new SourceLocation(startLoc, endLoc),\n };\n\n if (this.options.tokens) this.pushToken(comment);\n this.state.comments.push(comment);\n this.addComment(comment);\n }\n\n skipBlockComment(): void {\n const startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(\"*/\", this.state.pos + 2);\n if (end === -1) throw this.raise(start, \"Unterminated comment\");\n\n this.state.pos = end + 2;\n lineBreakG.lastIndex = start;\n let match;\n while (\n (match = lineBreakG.exec(this.input)) &&\n match.index < this.state.pos\n ) {\n ++this.state.curLine;\n this.state.lineStart = match.index + match[0].length;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n this.pushComment(\n true,\n this.input.slice(start + 2, end),\n start,\n this.state.pos,\n startLoc,\n this.state.curPosition(),\n );\n }\n\n skipLineComment(startSkip: number): void {\n const start = this.state.pos;\n const startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n this.pushComment(\n false,\n this.input.slice(start + startSkip, this.state.pos),\n start,\n this.state.pos,\n startLoc,\n this.state.curPosition(),\n );\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk:\n this.skipBlockComment();\n break;\n\n case charCodes.slash:\n this.skipLineComment(2);\n break;\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else {\n break loop;\n }\n }\n }\n }\n\n // Called at the end of every token. Sets `end`, `val`, and\n // maintains `context` and `exprAllowed`, and skips the space after\n // the token, so that the next one's `start` will point at the\n // right position.\n\n finishToken(type: TokenType, val: any): void {\n this.state.end = this.state.pos;\n this.state.endLoc = this.state.curPosition();\n const prevType = this.state.type;\n this.state.type = type;\n this.state.value = val;\n\n if (!this.isLookahead) this.updateContext(prevType);\n }\n\n // ### Token reading\n\n // This is the function that is called to fetch the next token. It\n // is somewhat obscure, because it works in character codes rather\n // than characters, and because operator parsing has been inlined\n // into it.\n //\n // All in the name of speed.\n\n // number sign is \"#\"\n readToken_numberSign(): void {\n if (this.state.pos === 0 && this.readToken_interpreter()) {\n return;\n }\n\n const nextPos = this.state.pos + 1;\n const next = this.input.charCodeAt(nextPos);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n throw this.raise(this.state.pos, \"Unexpected digit after hash token\");\n }\n\n if (\n this.hasPlugin(\"classPrivateProperties\") ||\n this.hasPlugin(\"classPrivateMethods\") ||\n this.getPluginOption(\"pipelineOperator\", \"proposal\") === \"smart\"\n ) {\n this.finishOp(tt.hash, 1);\n } else {\n throw this.raise(this.state.pos, \"Unexpected character '#'\");\n }\n }\n\n readToken_dot(): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next >= charCodes.digit0 && next <= charCodes.digit9) {\n this.readNumber(true);\n return;\n }\n\n if (\n next === charCodes.dot &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dot\n ) {\n this.state.pos += 3;\n this.finishToken(tt.ellipsis);\n } else {\n ++this.state.pos;\n this.finishToken(tt.dot);\n }\n }\n\n readToken_slash(): void {\n // '/'\n if (this.state.exprAllowed && !this.state.inType) {\n ++this.state.pos;\n this.readRegexp();\n return;\n }\n\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.slash, 1);\n }\n }\n\n readToken_interpreter(): boolean {\n if (this.state.pos !== 0 || this.length < 2) return false;\n\n const start = this.state.pos;\n this.state.pos += 1;\n\n let ch = this.input.charCodeAt(this.state.pos);\n if (ch !== charCodes.exclamationMark) return false;\n\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n\n const value = this.input.slice(start + 2, this.state.pos);\n\n this.finishToken(tt.interpreterDirective, value);\n\n return true;\n }\n\n readToken_mult_modulo(code: number): void {\n // '%*'\n let type = code === charCodes.asterisk ? tt.star : tt.modulo;\n let width = 1;\n let next = this.input.charCodeAt(this.state.pos + 1);\n const exprAllowed = this.state.exprAllowed;\n\n // Exponentiation operator **\n if (code === charCodes.asterisk && next === charCodes.asterisk) {\n width++;\n next = this.input.charCodeAt(this.state.pos + 2);\n type = tt.exponent;\n }\n\n if (next === charCodes.equalsTo && !exprAllowed) {\n width++;\n type = tt.assign;\n }\n\n this.finishOp(type, width);\n }\n\n readToken_pipe_amp(code: number): void {\n // '||' '&&' '||=' '&&='\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo) {\n this.finishOp(tt.assign, 3);\n } else {\n this.finishOp(\n code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND,\n 2,\n );\n }\n return;\n }\n\n if (code === charCodes.verticalBar) {\n // '|>'\n if (next === charCodes.greaterThan) {\n this.finishOp(tt.pipeline, 2);\n return;\n }\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n return;\n }\n\n this.finishOp(\n code === charCodes.verticalBar ? tt.bitwiseOR : tt.bitwiseAND,\n 1,\n );\n }\n\n readToken_caret(): void {\n // '^'\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.bitwiseXOR, 1);\n }\n }\n\n readToken_plus_min(code: number): void {\n // '+-'\n const next = this.input.charCodeAt(this.state.pos + 1);\n\n if (next === code) {\n if (\n next === charCodes.dash &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan &&\n (this.state.lastTokEnd === 0 ||\n lineBreak.test(\n this.input.slice(this.state.lastTokEnd, this.state.pos),\n ))\n ) {\n // A `-->` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // `
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+ // creates a new Buffer containing ASCII bytes
+ // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+ a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+ // Prints:
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+ // Prints:
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+ // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+ // 'auffer'
+console.log(buf2.toString());
+ // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+ // prints: this is a tést
+console.log(buf1.toString('ascii'));
+ // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+ // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+ //
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+ //
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+ //
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+ //
+ // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+ //
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+ const data = socket.read();
+ // allocate for retained data
+ const sb = Buffer.allocUnsafeSlow(10);
+ // copy the data into the new allocation
+ data.copy(sb, 0, 0, 10);
+ store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+ return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+ var data = ''
+ req.setEncoding('utf8')
+ req.on('data', function (chunk) {
+ data += chunk
+ })
+ req.on('end', function () {
+ var body = JSON.parse(data)
+ res.end(new Buffer(body.str).toString('hex'))
+ })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+ "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+ socket.on('message', function (message) {
+ message = JSON.parse(message)
+ if (message.type === 'echo') {
+ socket.send(message.data) // send back the user's message
+ }
+ })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/index.d.ts b/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/index.d.ts
new file mode 100644
index 0000000..e9fed80
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/index.d.ts
@@ -0,0 +1,187 @@
+declare module "safe-buffer" {
+ export class Buffer {
+ length: number
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ constructor (str: string, encoding?: string);
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ constructor (size: number);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: Uint8Array);
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ constructor (arrayBuffer: ArrayBuffer);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: any[]);
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ constructor (buffer: Buffer);
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ static from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ static from(buffer: Buffer): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ static from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ static isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ static isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ static byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ static concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ static compare(buf1: Buffer, buf2: Buffer): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initalizing
+ */
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafeSlow(size: number): Buffer;
+ }
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/index.js b/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/index.js
new file mode 100644
index 0000000..22438da
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/index.js
@@ -0,0 +1,62 @@
+/* eslint-disable node/no-deprecated-api */
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+// alternative to using Object.keys for old browsers
+function copyProps (src, dst) {
+ for (var key in src) {
+ dst[key] = src[key]
+ }
+}
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+ module.exports = buffer
+} else {
+ // Copy properties from require('buffer')
+ copyProps(buffer, exports)
+ exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+// Copy static methods from Buffer
+copyProps(Buffer, SafeBuffer)
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+ if (typeof arg === 'number') {
+ throw new TypeError('Argument must not be a number')
+ }
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ var buf = Buffer(size)
+ if (fill !== undefined) {
+ if (typeof encoding === 'string') {
+ buf.fill(fill, encoding)
+ } else {
+ buf.fill(fill)
+ }
+ } else {
+ buf.fill(0)
+ }
+ return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return buffer.SlowBuffer(size)
+}
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/package.json b/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/package.json
new file mode 100644
index 0000000..3392e25
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/safe-buffer/package.json
@@ -0,0 +1,63 @@
+{
+ "_from": "safe-buffer@~5.1.1",
+ "_id": "safe-buffer@5.1.2",
+ "_inBundle": false,
+ "_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "_location": "/are-we-there-yet/safe-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "safe-buffer@~5.1.1",
+ "name": "safe-buffer",
+ "escapedName": "safe-buffer",
+ "rawSpec": "~5.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~5.1.1"
+ },
+ "_requiredBy": [
+ "/are-we-there-yet/readable-stream",
+ "/are-we-there-yet/string_decoder"
+ ],
+ "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "_shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d",
+ "_spec": "safe-buffer@~5.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/are-we-there-yet/node_modules/readable-stream",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "http://feross.org"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/safe-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Safer Node.js Buffer API",
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^4.0.0"
+ },
+ "homepage": "https://github.com/feross/safe-buffer",
+ "keywords": [
+ "buffer",
+ "buffer allocate",
+ "node security",
+ "safe",
+ "safe-buffer",
+ "security",
+ "uninitialized"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "safe-buffer",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/safe-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && tape test/*.js"
+ },
+ "types": "index.d.ts",
+ "version": "5.1.2"
+}
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/.travis.yml b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/.travis.yml
new file mode 100644
index 0000000..3347a72
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/.travis.yml
@@ -0,0 +1,50 @@
+sudo: false
+language: node_js
+before_install:
+ - npm install -g npm@2
+ - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ include:
+ - node_js: '0.8'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.10'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.11'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.12'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 1
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 2
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 3
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 4
+ env: TASK=test
+ - node_js: 5
+ env: TASK=test
+ - node_js: 6
+ env: TASK=test
+ - node_js: 7
+ env: TASK=test
+ - node_js: 8
+ env: TASK=test
+ - node_js: 9
+ env: TASK=test
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE
new file mode 100644
index 0000000..778edb2
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE
@@ -0,0 +1,48 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/README.md b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/README.md
new file mode 100644
index 0000000..5fd5831
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/README.md
@@ -0,0 +1,47 @@
+# string_decoder
+
+***Node-core v8.9.4 string_decoder for userland***
+
+
+[](https://nodei.co/npm/string_decoder/)
+[](https://nodei.co/npm/string_decoder/)
+
+
+```bash
+npm install --save string_decoder
+```
+
+***Node-core string_decoder for userland***
+
+This package is a mirror of the string_decoder implementation in Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
+
+As of version 1.0.0 **string_decoder** uses semantic versioning.
+
+## Previous versions
+
+Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
+
+## Update
+
+The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
+
+## Streams Working Group
+
+`string_decoder` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+See [readable-stream](https://github.com/nodejs/readable-stream) for
+more details.
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js
new file mode 100644
index 0000000..2e89e63
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js
@@ -0,0 +1,296 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+/* */
+
+var isEncoding = Buffer.isEncoding || function (encoding) {
+ encoding = '' + encoding;
+ switch (encoding && encoding.toLowerCase()) {
+ case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
+ return true;
+ default:
+ return false;
+ }
+};
+
+function _normalizeEncoding(enc) {
+ if (!enc) return 'utf8';
+ var retried;
+ while (true) {
+ switch (enc) {
+ case 'utf8':
+ case 'utf-8':
+ return 'utf8';
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return 'utf16le';
+ case 'latin1':
+ case 'binary':
+ return 'latin1';
+ case 'base64':
+ case 'ascii':
+ case 'hex':
+ return enc;
+ default:
+ if (retried) return; // undefined
+ enc = ('' + enc).toLowerCase();
+ retried = true;
+ }
+ }
+};
+
+// Do not cache `Buffer.isEncoding` when checking encoding names as some
+// modules monkey-patch it to support additional encodings
+function normalizeEncoding(enc) {
+ var nenc = _normalizeEncoding(enc);
+ if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
+ return nenc || enc;
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters.
+exports.StringDecoder = StringDecoder;
+function StringDecoder(encoding) {
+ this.encoding = normalizeEncoding(encoding);
+ var nb;
+ switch (this.encoding) {
+ case 'utf16le':
+ this.text = utf16Text;
+ this.end = utf16End;
+ nb = 4;
+ break;
+ case 'utf8':
+ this.fillLast = utf8FillLast;
+ nb = 4;
+ break;
+ case 'base64':
+ this.text = base64Text;
+ this.end = base64End;
+ nb = 3;
+ break;
+ default:
+ this.write = simpleWrite;
+ this.end = simpleEnd;
+ return;
+ }
+ this.lastNeed = 0;
+ this.lastTotal = 0;
+ this.lastChar = Buffer.allocUnsafe(nb);
+}
+
+StringDecoder.prototype.write = function (buf) {
+ if (buf.length === 0) return '';
+ var r;
+ var i;
+ if (this.lastNeed) {
+ r = this.fillLast(buf);
+ if (r === undefined) return '';
+ i = this.lastNeed;
+ this.lastNeed = 0;
+ } else {
+ i = 0;
+ }
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
+ return r || '';
+};
+
+StringDecoder.prototype.end = utf8End;
+
+// Returns only complete characters in a Buffer
+StringDecoder.prototype.text = utf8Text;
+
+// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
+StringDecoder.prototype.fillLast = function (buf) {
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
+ this.lastNeed -= buf.length;
+};
+
+// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
+// continuation byte. If an invalid byte is detected, -2 is returned.
+function utf8CheckByte(byte) {
+ if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
+ return byte >> 6 === 0x02 ? -1 : -2;
+}
+
+// Checks at most 3 bytes at the end of a Buffer in order to detect an
+// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
+// needed to complete the UTF-8 character (if applicable) are returned.
+function utf8CheckIncomplete(self, buf, i) {
+ var j = buf.length - 1;
+ if (j < i) return 0;
+ var nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 1;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 2;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) {
+ if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
+ }
+ return nb;
+ }
+ return 0;
+}
+
+// Validates as many continuation bytes for a multi-byte UTF-8 character as
+// needed or are available. If we see a non-continuation byte where we expect
+// one, we "replace" the validated continuation bytes we've seen so far with
+// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
+// behavior. The continuation byte check is included three times in the case
+// where all of the continuation bytes for a character exist in the same buffer.
+// It is also done this way as a slight performance increase instead of using a
+// loop.
+function utf8CheckExtraBytes(self, buf, p) {
+ if ((buf[0] & 0xC0) !== 0x80) {
+ self.lastNeed = 0;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 1 && buf.length > 1) {
+ if ((buf[1] & 0xC0) !== 0x80) {
+ self.lastNeed = 1;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 2 && buf.length > 2) {
+ if ((buf[2] & 0xC0) !== 0x80) {
+ self.lastNeed = 2;
+ return '\ufffd';
+ }
+ }
+ }
+}
+
+// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
+function utf8FillLast(buf) {
+ var p = this.lastTotal - this.lastNeed;
+ var r = utf8CheckExtraBytes(this, buf, p);
+ if (r !== undefined) return r;
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, p, 0, buf.length);
+ this.lastNeed -= buf.length;
+}
+
+// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
+// partial character, the character's bytes are buffered until the required
+// number of bytes are available.
+function utf8Text(buf, i) {
+ var total = utf8CheckIncomplete(this, buf, i);
+ if (!this.lastNeed) return buf.toString('utf8', i);
+ this.lastTotal = total;
+ var end = buf.length - (total - this.lastNeed);
+ buf.copy(this.lastChar, 0, end);
+ return buf.toString('utf8', i, end);
+}
+
+// For UTF-8, a replacement character is added when ending on a partial
+// character.
+function utf8End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + '\ufffd';
+ return r;
+}
+
+// UTF-16LE typically needs two bytes per character, but even if we have an even
+// number of bytes available, we need to check if we end on a leading/high
+// surrogate. In that case, we need to wait for the next two bytes in order to
+// decode the last character properly.
+function utf16Text(buf, i) {
+ if ((buf.length - i) % 2 === 0) {
+ var r = buf.toString('utf16le', i);
+ if (r) {
+ var c = r.charCodeAt(r.length - 1);
+ if (c >= 0xD800 && c <= 0xDBFF) {
+ this.lastNeed = 2;
+ this.lastTotal = 4;
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ return r.slice(0, -1);
+ }
+ }
+ return r;
+ }
+ this.lastNeed = 1;
+ this.lastTotal = 2;
+ this.lastChar[0] = buf[buf.length - 1];
+ return buf.toString('utf16le', i, buf.length - 1);
+}
+
+// For UTF-16LE we do not explicitly append special replacement characters if we
+// end on a partial character, we simply let v8 handle that.
+function utf16End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) {
+ var end = this.lastTotal - this.lastNeed;
+ return r + this.lastChar.toString('utf16le', 0, end);
+ }
+ return r;
+}
+
+function base64Text(buf, i) {
+ var n = (buf.length - i) % 3;
+ if (n === 0) return buf.toString('base64', i);
+ this.lastNeed = 3 - n;
+ this.lastTotal = 3;
+ if (n === 1) {
+ this.lastChar[0] = buf[buf.length - 1];
+ } else {
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ }
+ return buf.toString('base64', i, buf.length - n);
+}
+
+function base64End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
+ return r;
+}
+
+// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
+function simpleWrite(buf) {
+ return buf.toString(this.encoding);
+}
+
+function simpleEnd(buf) {
+ return buf && buf.length ? this.write(buf) : '';
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/package.json b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/package.json
new file mode 100644
index 0000000..82c8ea5
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/node_modules/string_decoder/package.json
@@ -0,0 +1,59 @@
+{
+ "_from": "string_decoder@~1.1.1",
+ "_id": "string_decoder@1.1.1",
+ "_inBundle": false,
+ "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "_location": "/are-we-there-yet/string_decoder",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "string_decoder@~1.1.1",
+ "name": "string_decoder",
+ "escapedName": "string_decoder",
+ "rawSpec": "~1.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~1.1.1"
+ },
+ "_requiredBy": [
+ "/are-we-there-yet/readable-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
+ "_spec": "string_decoder@~1.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/are-we-there-yet/node_modules/readable-stream",
+ "bugs": {
+ "url": "https://github.com/nodejs/string_decoder/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ },
+ "deprecated": false,
+ "description": "The string_decoder module from Node core",
+ "devDependencies": {
+ "babel-polyfill": "^6.23.0",
+ "core-util-is": "^1.0.2",
+ "inherits": "^2.0.3",
+ "tap": "~0.4.8"
+ },
+ "homepage": "https://github.com/nodejs/string_decoder",
+ "keywords": [
+ "string",
+ "decoder",
+ "browser",
+ "browserify"
+ ],
+ "license": "MIT",
+ "main": "lib/string_decoder.js",
+ "name": "string_decoder",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/string_decoder.git"
+ },
+ "scripts": {
+ "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+ "test": "tap test/parallel/*.js && node test/verify-dependencies"
+ },
+ "version": "1.1.1"
+}
diff --git a/Nodejs/node_modules/are-we-there-yet/package.json b/Nodejs/node_modules/are-we-there-yet/package.json
new file mode 100644
index 0000000..a91f1b7
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/package.json
@@ -0,0 +1,60 @@
+{
+ "_from": "are-we-there-yet@~1.0.0",
+ "_id": "are-we-there-yet@1.0.6",
+ "_inBundle": false,
+ "_integrity": "sha1-otKMkxAqpsyWJFomy5VN4G7FPww=",
+ "_location": "/are-we-there-yet",
+ "_phantomChildren": {
+ "core-util-is": "1.0.2",
+ "inherits": "2.0.4",
+ "isarray": "1.0.0",
+ "process-nextick-args": "2.0.1",
+ "util-deprecate": "1.0.2"
+ },
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "are-we-there-yet@~1.0.0",
+ "name": "are-we-there-yet",
+ "escapedName": "are-we-there-yet",
+ "rawSpec": "~1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "~1.0.0"
+ },
+ "_requiredBy": [
+ "/npmlog"
+ ],
+ "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz",
+ "_shasum": "a2d28c93102aa6cc96245a26cb954de06ec53f0c",
+ "_spec": "are-we-there-yet@~1.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/npmlog",
+ "author": {
+ "name": "Rebecca Turner",
+ "url": "http://re-becca.org"
+ },
+ "bugs": {
+ "url": "https://github.com/iarna/are-we-there-yet/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "delegates": "^1.0.0",
+ "readable-stream": "^2.0.0 || ^1.1.13"
+ },
+ "deprecated": false,
+ "description": "Keep track of the overall completion of many dispirate processes",
+ "devDependencies": {
+ "tap": "^5.2.0"
+ },
+ "homepage": "https://github.com/iarna/are-we-there-yet",
+ "license": "ISC",
+ "main": "index.js",
+ "name": "are-we-there-yet",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/iarna/are-we-there-yet.git"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "version": "1.0.6"
+}
diff --git a/Nodejs/node_modules/are-we-there-yet/test/tracker.js b/Nodejs/node_modules/are-we-there-yet/test/tracker.js
new file mode 100644
index 0000000..18c31c3
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/test/tracker.js
@@ -0,0 +1,56 @@
+"use strict"
+var test = require("tap").test
+var Tracker = require("../index.js").Tracker
+
+var timeoutError = new Error("timeout")
+var testEvent = function (obj,event,next) {
+ var timeout = setTimeout(function(){
+ obj.removeListener(event, eventHandler)
+ next(timeoutError)
+ }, 10)
+ var eventHandler = function () {
+ var args = Array.prototype.slice.call(arguments)
+ args.unshift(null)
+ clearTimeout(timeout)
+ next.apply(null, args)
+ }
+ obj.once(event, eventHandler)
+}
+
+test("Tracker", function (t) {
+ t.plan(10)
+
+ var name = "test"
+ var track = new Tracker(name)
+
+ t.is(track.completed(), 0, "Nothing todo is 0 completion")
+
+ var todo = 100
+ track = new Tracker(name, todo)
+ t.is(track.completed(), 0, "Nothing done is 0 completion")
+
+ testEvent(track, "change", afterCompleteWork)
+ track.completeWork(100)
+ function afterCompleteWork(er, onChangeName) {
+ t.is(er, null, "completeWork: on change event fired")
+ t.is(onChangeName, name, "completeWork: on change emits the correct name")
+ }
+ t.is(track.completed(), 1, "completeWork: 100% completed")
+
+ testEvent(track, "change", afterAddWork)
+ track.addWork(100)
+ function afterAddWork(er, onChangeName) {
+ t.is(er, null, "addWork: on change event fired")
+ t.is(onChangeName, name, "addWork: on change emits the correct name")
+ }
+ t.is(track.completed(), 0.5, "addWork: 50% completed")
+
+
+ track.completeWork(200)
+ t.is(track.completed(), 1, "completeWork: Over completion is still only 100% complete")
+
+ track = new Tracker(name, todo)
+ track.completeWork(50)
+ track.finish()
+ t.is(track.completed(), 1, "finish: Explicitly finishing moves to 100%")
+})
diff --git a/Nodejs/node_modules/are-we-there-yet/test/trackergroup.js b/Nodejs/node_modules/are-we-there-yet/test/trackergroup.js
new file mode 100644
index 0000000..a64e121
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/test/trackergroup.js
@@ -0,0 +1,87 @@
+"use strict"
+var test = require("tap").test
+var Tracker = require("../index.js").Tracker
+var TrackerGroup = require("../index.js").TrackerGroup
+
+var timeoutError = new Error("timeout")
+var testEvent = function (obj,event,next) {
+ var timeout = setTimeout(function(){
+ obj.removeListener(event, eventHandler)
+ next(timeoutError)
+ }, 10)
+ var eventHandler = function () {
+ var args = Array.prototype.slice.call(arguments)
+ args.unshift(null)
+ clearTimeout(timeout)
+ next.apply(null, args)
+ }
+ obj.once(event, eventHandler)
+}
+
+test("TrackerGroup", function (t) {
+ var name = "test"
+
+ var track = new TrackerGroup(name)
+ t.is(track.completed(), 0, "Nothing todo is 0 completion")
+ testEvent(track, "change", afterFinishEmpty)
+ track.finish()
+ var a, b
+ function afterFinishEmpty(er, onChangeName) {
+ t.is(er, null, "finishEmpty: on change event fired")
+ t.is(onChangeName, name, "finishEmpty: on change emits the correct name")
+ t.is(track.completed(), 1, "finishEmpty: Finishing an empty group actually finishes it")
+
+ track = new TrackerGroup(name)
+ a = track.newItem("a", 10, 1)
+ b = track.newItem("b", 10, 1)
+ t.is(track.completed(), 0, "Initially empty")
+ testEvent(track, "change", afterCompleteWork)
+ a.completeWork(5)
+ }
+ function afterCompleteWork(er, onChangeName) {
+ t.is(er, null, "on change event fired")
+ t.is(onChangeName, "a", "on change emits the correct name")
+ t.is(track.completed(), 0.25, "Complete half of one is a quarter overall")
+ testEvent(track, "change", afterFinishAll)
+ track.finish()
+ }
+ function afterFinishAll(er, onChangeName) {
+ t.is(er, null, "finishAll: on change event fired")
+ t.is(onChangeName, name, "finishAll: on change emits the correct name")
+ t.is(track.completed(), 1, "Finishing everything ")
+
+ track = new TrackerGroup(name)
+ a = track.newItem("a", 10, 2)
+ b = track.newItem("b", 10, 1)
+ t.is(track.completed(), 0, "weighted: Initially empty")
+ testEvent(track, "change", afterWeightedCompleteWork)
+ a.completeWork(5)
+ }
+ function afterWeightedCompleteWork(er, onChangeName) {
+ t.is(er, null, "weighted: on change event fired")
+ t.is(onChangeName, "a", "weighted: on change emits the correct name")
+ t.is(Math.round(track.completed()*100), 33, "weighted: Complete half of double weighted")
+ testEvent(track, "change", afterWeightedFinishAll)
+ track.finish()
+ }
+ function afterWeightedFinishAll(er, onChangeName) {
+ t.is(er, null, "weightedFinishAll: on change event fired")
+ t.is(onChangeName, name, "weightedFinishAll: on change emits the correct name")
+ t.is(track.completed(), 1, "weightedFinishaAll: Finishing everything ")
+
+ track = new TrackerGroup(name)
+ a = track.newGroup("a", 10)
+ b = track.newGroup("b", 10)
+ var a1 = a.newItem("a.1",10)
+ a1.completeWork(5)
+ t.is(track.completed(), 0.25, "nested: Initially quarter done")
+ testEvent(track, "change", afterNestedComplete)
+ b.finish()
+ }
+ function afterNestedComplete(er, onChangeName) {
+ t.is(er, null, "nestedComplete: on change event fired")
+ t.is(onChangeName, "b", "nestedComplete: on change emits the correct name")
+ t.is(track.completed(), 0.75, "nestedComplete: Finishing everything ")
+ t.end()
+ }
+})
diff --git a/Nodejs/node_modules/are-we-there-yet/test/trackerstream.js b/Nodejs/node_modules/are-we-there-yet/test/trackerstream.js
new file mode 100644
index 0000000..72b6043
--- /dev/null
+++ b/Nodejs/node_modules/are-we-there-yet/test/trackerstream.js
@@ -0,0 +1,65 @@
+"use strict"
+var test = require("tap").test
+var util = require("util")
+var stream = require("readable-stream")
+var TrackerStream = require("../index.js").TrackerStream
+
+var timeoutError = new Error("timeout")
+var testEvent = function (obj,event,next) {
+ var timeout = setTimeout(function(){
+ obj.removeListener(event, eventHandler)
+ next(timeoutError)
+ }, 10)
+ var eventHandler = function () {
+ var args = Array.prototype.slice.call(arguments)
+ args.unshift(null)
+ clearTimeout(timeout)
+ next.apply(null, args)
+ }
+ obj.once(event, eventHandler)
+}
+
+var Sink = function () {
+ stream.Writable.apply(this,arguments)
+}
+util.inherits(Sink, stream.Writable)
+Sink.prototype._write = function (data, encoding, cb) {
+ cb()
+}
+
+test("TrackerStream", function (t) {
+ t.plan(9)
+
+ var name = "test"
+ var track = new TrackerStream(name)
+
+ t.is(track.completed(), 0, "Nothing todo is 0 completion")
+
+ var todo = 10
+ track = new TrackerStream(name, todo)
+ t.is(track.completed(), 0, "Nothing done is 0 completion")
+
+ track.pipe(new Sink())
+
+ testEvent(track, "change", afterCompleteWork)
+ track.write("0123456789")
+ function afterCompleteWork(er, onChangeName) {
+ t.is(er, null, "write: on change event fired")
+ t.is(onChangeName, name, "write: on change emits the correct name")
+ t.is(track.completed(), 1, "write: 100% completed")
+
+ testEvent(track, "change", afterAddWork)
+ track.addWork(10)
+ }
+ function afterAddWork(er, onChangeName) {
+ t.is(er, null, "addWork: on change event fired")
+ t.is(track.completed(), 0.5, "addWork: 50% completed")
+
+ testEvent(track, "change", afterAllWork)
+ track.write("ABCDEFGHIJKLMNOPQRST")
+ }
+ function afterAllWork(er) {
+ t.is(er, null, "allWork: on change event fired")
+ t.is(track.completed(), 1, "allWork: 100% completed")
+ }
+})
diff --git a/Nodejs/node_modules/array-union/index.d.ts b/Nodejs/node_modules/array-union/index.d.ts
new file mode 100644
index 0000000..379fc1d
--- /dev/null
+++ b/Nodejs/node_modules/array-union/index.d.ts
@@ -0,0 +1,25 @@
+/**
+Create an array of unique values, in order, from the input arrays.
+
+@example
+```
+import arrayUnion = require('array-union');
+
+arrayUnion([1, 1, 2, 3], [2, 3]);
+//=> [1, 2, 3]
+
+arrayUnion(['foo', 'foo', 'bar']);
+//=> ['foo', 'bar']
+
+arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
+//=> ['🐱', '🦄', '🐻', '🌈']
+
+arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
+//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
+```
+*/
+declare function arrayUnion(
+ ...arguments: readonly ArgumentsType[]
+): ArgumentsType;
+
+export = arrayUnion;
diff --git a/Nodejs/node_modules/array-union/index.js b/Nodejs/node_modules/array-union/index.js
new file mode 100644
index 0000000..7f85d3d
--- /dev/null
+++ b/Nodejs/node_modules/array-union/index.js
@@ -0,0 +1,5 @@
+'use strict';
+
+module.exports = (...arguments_) => {
+ return [...new Set([].concat(...arguments_))];
+};
diff --git a/Nodejs/node_modules/array-union/license b/Nodejs/node_modules/array-union/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/Nodejs/node_modules/array-union/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Nodejs/node_modules/array-union/package.json b/Nodejs/node_modules/array-union/package.json
new file mode 100644
index 0000000..daf108e
--- /dev/null
+++ b/Nodejs/node_modules/array-union/package.json
@@ -0,0 +1,70 @@
+{
+ "_from": "array-union@^2.1.0",
+ "_id": "array-union@2.1.0",
+ "_inBundle": false,
+ "_integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
+ "_location": "/array-union",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "array-union@^2.1.0",
+ "name": "array-union",
+ "escapedName": "array-union",
+ "rawSpec": "^2.1.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.1.0"
+ },
+ "_requiredBy": [
+ "/globby"
+ ],
+ "_resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
+ "_shasum": "b798420adbeb1de828d84acd8a2e23d3efe85e8d",
+ "_spec": "array-union@^2.1.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/globby",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/array-union/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Create an array of unique values, in order, from the input arrays",
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.2",
+ "xo": "^0.24.0"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "homepage": "https://github.com/sindresorhus/array-union#readme",
+ "keywords": [
+ "array",
+ "set",
+ "uniq",
+ "unique",
+ "duplicate",
+ "remove",
+ "union",
+ "combine",
+ "merge"
+ ],
+ "license": "MIT",
+ "name": "array-union",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/array-union.git"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "version": "2.1.0"
+}
diff --git a/Nodejs/node_modules/array-union/readme.md b/Nodejs/node_modules/array-union/readme.md
new file mode 100644
index 0000000..2474a1a
--- /dev/null
+++ b/Nodejs/node_modules/array-union/readme.md
@@ -0,0 +1,34 @@
+# array-union [](https://travis-ci.org/sindresorhus/array-union)
+
+> Create an array of unique values, in order, from the input arrays
+
+
+## Install
+
+```
+$ npm install array-union
+```
+
+
+## Usage
+
+```js
+const arrayUnion = require('array-union');
+
+arrayUnion([1, 1, 2, 3], [2, 3]);
+//=> [1, 2, 3]
+
+arrayUnion(['foo', 'foo', 'bar']);
+//=> ['foo', 'bar']
+
+arrayUnion(['🐱', '🦄', '🐻'], ['🦄', '🌈']);
+//=> ['🐱', '🦄', '🐻', '🌈']
+
+arrayUnion(['🐱', '🦄'], ['🐻', '🦄'], ['🐶', '🌈', '🌈']);
+//=> ['🐱', '🦄', '🐻', '🐶', '🌈']
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/Nodejs/node_modules/asn1/LICENSE b/Nodejs/node_modules/asn1/LICENSE
new file mode 100644
index 0000000..9b5dcdb
--- /dev/null
+++ b/Nodejs/node_modules/asn1/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Mark Cavage, All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE
diff --git a/Nodejs/node_modules/asn1/README.md b/Nodejs/node_modules/asn1/README.md
new file mode 100644
index 0000000..2208210
--- /dev/null
+++ b/Nodejs/node_modules/asn1/README.md
@@ -0,0 +1,50 @@
+node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.
+Currently BER encoding is supported; at some point I'll likely have to do DER.
+
+## Usage
+
+Mostly, if you're *actually* needing to read and write ASN.1, you probably don't
+need this readme to explain what and why. If you have no idea what ASN.1 is,
+see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
+
+The source is pretty much self-explanatory, and has read/write methods for the
+common types out there.
+
+### Decoding
+
+The following reads an ASN.1 sequence with a boolean.
+
+ var Ber = require('asn1').Ber;
+
+ var reader = new Ber.Reader(Buffer.from([0x30, 0x03, 0x01, 0x01, 0xff]));
+
+ reader.readSequence();
+ console.log('Sequence len: ' + reader.length);
+ if (reader.peek() === Ber.Boolean)
+ console.log(reader.readBoolean());
+
+### Encoding
+
+The following generates the same payload as above.
+
+ var Ber = require('asn1').Ber;
+
+ var writer = new Ber.Writer();
+
+ writer.startSequence();
+ writer.writeBoolean(true);
+ writer.endSequence();
+
+ console.log(writer.buffer);
+
+## Installation
+
+ npm install asn1
+
+## License
+
+MIT.
+
+## Bugs
+
+See .
diff --git a/Nodejs/node_modules/asn1/lib/ber/errors.js b/Nodejs/node_modules/asn1/lib/ber/errors.js
new file mode 100644
index 0000000..4557b8a
--- /dev/null
+++ b/Nodejs/node_modules/asn1/lib/ber/errors.js
@@ -0,0 +1,13 @@
+// Copyright 2011 Mark Cavage All rights reserved.
+
+
+module.exports = {
+
+ newInvalidAsn1Error: function (msg) {
+ var e = new Error();
+ e.name = 'InvalidAsn1Error';
+ e.message = msg || '';
+ return e;
+ }
+
+};
diff --git a/Nodejs/node_modules/asn1/lib/ber/index.js b/Nodejs/node_modules/asn1/lib/ber/index.js
new file mode 100644
index 0000000..387d132
--- /dev/null
+++ b/Nodejs/node_modules/asn1/lib/ber/index.js
@@ -0,0 +1,27 @@
+// Copyright 2011 Mark Cavage All rights reserved.
+
+var errors = require('./errors');
+var types = require('./types');
+
+var Reader = require('./reader');
+var Writer = require('./writer');
+
+
+// --- Exports
+
+module.exports = {
+
+ Reader: Reader,
+
+ Writer: Writer
+
+};
+
+for (var t in types) {
+ if (types.hasOwnProperty(t))
+ module.exports[t] = types[t];
+}
+for (var e in errors) {
+ if (errors.hasOwnProperty(e))
+ module.exports[e] = errors[e];
+}
diff --git a/Nodejs/node_modules/asn1/lib/ber/reader.js b/Nodejs/node_modules/asn1/lib/ber/reader.js
new file mode 100644
index 0000000..8a7e4ca
--- /dev/null
+++ b/Nodejs/node_modules/asn1/lib/ber/reader.js
@@ -0,0 +1,262 @@
+// Copyright 2011 Mark Cavage All rights reserved.
+
+var assert = require('assert');
+var Buffer = require('safer-buffer').Buffer;
+
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+// --- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+
+
+// --- API
+
+function Reader(data) {
+ if (!data || !Buffer.isBuffer(data))
+ throw new TypeError('data must be a node Buffer');
+
+ this._buf = data;
+ this._size = data.length;
+
+ // These hold the "current" state
+ this._len = 0;
+ this._offset = 0;
+}
+
+Object.defineProperty(Reader.prototype, 'length', {
+ enumerable: true,
+ get: function () { return (this._len); }
+});
+
+Object.defineProperty(Reader.prototype, 'offset', {
+ enumerable: true,
+ get: function () { return (this._offset); }
+});
+
+Object.defineProperty(Reader.prototype, 'remain', {
+ get: function () { return (this._size - this._offset); }
+});
+
+Object.defineProperty(Reader.prototype, 'buffer', {
+ get: function () { return (this._buf.slice(this._offset)); }
+});
+
+
+/**
+ * Reads a single byte and advances offset; you can pass in `true` to make this
+ * a "peek" operation (i.e., get the byte, but don't advance the offset).
+ *
+ * @param {Boolean} peek true means don't move offset.
+ * @return {Number} the next byte, null if not enough data.
+ */
+Reader.prototype.readByte = function (peek) {
+ if (this._size - this._offset < 1)
+ return null;
+
+ var b = this._buf[this._offset] & 0xff;
+
+ if (!peek)
+ this._offset += 1;
+
+ return b;
+};
+
+
+Reader.prototype.peek = function () {
+ return this.readByte(true);
+};
+
+
+/**
+ * Reads a (potentially) variable length off the BER buffer. This call is
+ * not really meant to be called directly, as callers have to manipulate
+ * the internal buffer afterwards.
+ *
+ * As a result of this call, you can call `Reader.length`, until the
+ * next thing called that does a readLength.
+ *
+ * @return {Number} the amount of offset to advance the buffer.
+ * @throws {InvalidAsn1Error} on bad ASN.1
+ */
+Reader.prototype.readLength = function (offset) {
+ if (offset === undefined)
+ offset = this._offset;
+
+ if (offset >= this._size)
+ return null;
+
+ var lenB = this._buf[offset++] & 0xff;
+ if (lenB === null)
+ return null;
+
+ if ((lenB & 0x80) === 0x80) {
+ lenB &= 0x7f;
+
+ if (lenB === 0)
+ throw newInvalidAsn1Error('Indefinite length not supported');
+
+ if (lenB > 4)
+ throw newInvalidAsn1Error('encoding too long');
+
+ if (this._size - offset < lenB)
+ return null;
+
+ this._len = 0;
+ for (var i = 0; i < lenB; i++)
+ this._len = (this._len << 8) + (this._buf[offset++] & 0xff);
+
+ } else {
+ // Wasn't a variable length
+ this._len = lenB;
+ }
+
+ return offset;
+};
+
+
+/**
+ * Parses the next sequence in this BER buffer.
+ *
+ * To get the length of the sequence, call `Reader.length`.
+ *
+ * @return {Number} the sequence's tag.
+ */
+Reader.prototype.readSequence = function (tag) {
+ var seq = this.peek();
+ if (seq === null)
+ return null;
+ if (tag !== undefined && tag !== seq)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + seq.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ this._offset = o;
+ return seq;
+};
+
+
+Reader.prototype.readInt = function () {
+ return this._readTag(ASN1.Integer);
+};
+
+
+Reader.prototype.readBoolean = function () {
+ return (this._readTag(ASN1.Boolean) === 0 ? false : true);
+};
+
+
+Reader.prototype.readEnumeration = function () {
+ return this._readTag(ASN1.Enumeration);
+};
+
+
+Reader.prototype.readString = function (tag, retbuf) {
+ if (!tag)
+ tag = ASN1.OctetString;
+
+ var b = this.peek();
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+
+ if (o === null)
+ return null;
+
+ if (this.length > this._size - o)
+ return null;
+
+ this._offset = o;
+
+ if (this.length === 0)
+ return retbuf ? Buffer.alloc(0) : '';
+
+ var str = this._buf.slice(this._offset, this._offset + this.length);
+ this._offset += this.length;
+
+ return retbuf ? str : str.toString('utf8');
+};
+
+Reader.prototype.readOID = function (tag) {
+ if (!tag)
+ tag = ASN1.OID;
+
+ var b = this.readString(tag, true);
+ if (b === null)
+ return null;
+
+ var values = [];
+ var value = 0;
+
+ for (var i = 0; i < b.length; i++) {
+ var byte = b[i] & 0xff;
+
+ value <<= 7;
+ value += byte & 0x7f;
+ if ((byte & 0x80) === 0) {
+ values.push(value);
+ value = 0;
+ }
+ }
+
+ value = values.shift();
+ values.unshift(value % 40);
+ values.unshift((value / 40) >> 0);
+
+ return values.join('.');
+};
+
+
+Reader.prototype._readTag = function (tag) {
+ assert.ok(tag !== undefined);
+
+ var b = this.peek();
+
+ if (b === null)
+ return null;
+
+ if (b !== tag)
+ throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+ ': got 0x' + b.toString(16));
+
+ var o = this.readLength(this._offset + 1); // stored in `length`
+ if (o === null)
+ return null;
+
+ if (this.length > 4)
+ throw newInvalidAsn1Error('Integer too long: ' + this.length);
+
+ if (this.length > this._size - o)
+ return null;
+ this._offset = o;
+
+ var fb = this._buf[this._offset];
+ var value = 0;
+
+ for (var i = 0; i < this.length; i++) {
+ value <<= 8;
+ value |= (this._buf[this._offset++] & 0xff);
+ }
+
+ if ((fb & 0x80) === 0x80 && i !== 4)
+ value -= (1 << (i * 8));
+
+ return value >> 0;
+};
+
+
+
+// --- Exported API
+
+module.exports = Reader;
diff --git a/Nodejs/node_modules/asn1/lib/ber/types.js b/Nodejs/node_modules/asn1/lib/ber/types.js
new file mode 100644
index 0000000..8aea000
--- /dev/null
+++ b/Nodejs/node_modules/asn1/lib/ber/types.js
@@ -0,0 +1,36 @@
+// Copyright 2011 Mark Cavage All rights reserved.
+
+
+module.exports = {
+ EOC: 0,
+ Boolean: 1,
+ Integer: 2,
+ BitString: 3,
+ OctetString: 4,
+ Null: 5,
+ OID: 6,
+ ObjectDescriptor: 7,
+ External: 8,
+ Real: 9, // float
+ Enumeration: 10,
+ PDV: 11,
+ Utf8String: 12,
+ RelativeOID: 13,
+ Sequence: 16,
+ Set: 17,
+ NumericString: 18,
+ PrintableString: 19,
+ T61String: 20,
+ VideotexString: 21,
+ IA5String: 22,
+ UTCTime: 23,
+ GeneralizedTime: 24,
+ GraphicString: 25,
+ VisibleString: 26,
+ GeneralString: 28,
+ UniversalString: 29,
+ CharacterString: 30,
+ BMPString: 31,
+ Constructor: 32,
+ Context: 128
+};
diff --git a/Nodejs/node_modules/asn1/lib/ber/writer.js b/Nodejs/node_modules/asn1/lib/ber/writer.js
new file mode 100644
index 0000000..3515acf
--- /dev/null
+++ b/Nodejs/node_modules/asn1/lib/ber/writer.js
@@ -0,0 +1,317 @@
+// Copyright 2011 Mark Cavage All rights reserved.
+
+var assert = require('assert');
+var Buffer = require('safer-buffer').Buffer;
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+// --- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+var DEFAULT_OPTS = {
+ size: 1024,
+ growthFactor: 8
+};
+
+
+// --- Helpers
+
+function merge(from, to) {
+ assert.ok(from);
+ assert.equal(typeof (from), 'object');
+ assert.ok(to);
+ assert.equal(typeof (to), 'object');
+
+ var keys = Object.getOwnPropertyNames(from);
+ keys.forEach(function (key) {
+ if (to[key])
+ return;
+
+ var value = Object.getOwnPropertyDescriptor(from, key);
+ Object.defineProperty(to, key, value);
+ });
+
+ return to;
+}
+
+
+
+// --- API
+
+function Writer(options) {
+ options = merge(DEFAULT_OPTS, options || {});
+
+ this._buf = Buffer.alloc(options.size || 1024);
+ this._size = this._buf.length;
+ this._offset = 0;
+ this._options = options;
+
+ // A list of offsets in the buffer where we need to insert
+ // sequence tag/len pairs.
+ this._seq = [];
+}
+
+Object.defineProperty(Writer.prototype, 'buffer', {
+ get: function () {
+ if (this._seq.length)
+ throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)');
+
+ return (this._buf.slice(0, this._offset));
+ }
+});
+
+Writer.prototype.writeByte = function (b) {
+ if (typeof (b) !== 'number')
+ throw new TypeError('argument must be a Number');
+
+ this._ensure(1);
+ this._buf[this._offset++] = b;
+};
+
+
+Writer.prototype.writeInt = function (i, tag) {
+ if (typeof (i) !== 'number')
+ throw new TypeError('argument must be a Number');
+ if (typeof (tag) !== 'number')
+ tag = ASN1.Integer;
+
+ var sz = 4;
+
+ while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) &&
+ (sz > 1)) {
+ sz--;
+ i <<= 8;
+ }
+
+ if (sz > 4)
+ throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');
+
+ this._ensure(2 + sz);
+ this._buf[this._offset++] = tag;
+ this._buf[this._offset++] = sz;
+
+ while (sz-- > 0) {
+ this._buf[this._offset++] = ((i & 0xff000000) >>> 24);
+ i <<= 8;
+ }
+
+};
+
+
+Writer.prototype.writeNull = function () {
+ this.writeByte(ASN1.Null);
+ this.writeByte(0x00);
+};
+
+
+Writer.prototype.writeEnumeration = function (i, tag) {
+ if (typeof (i) !== 'number')
+ throw new TypeError('argument must be a Number');
+ if (typeof (tag) !== 'number')
+ tag = ASN1.Enumeration;
+
+ return this.writeInt(i, tag);
+};
+
+
+Writer.prototype.writeBoolean = function (b, tag) {
+ if (typeof (b) !== 'boolean')
+ throw new TypeError('argument must be a Boolean');
+ if (typeof (tag) !== 'number')
+ tag = ASN1.Boolean;
+
+ this._ensure(3);
+ this._buf[this._offset++] = tag;
+ this._buf[this._offset++] = 0x01;
+ this._buf[this._offset++] = b ? 0xff : 0x00;
+};
+
+
+Writer.prototype.writeString = function (s, tag) {
+ if (typeof (s) !== 'string')
+ throw new TypeError('argument must be a string (was: ' + typeof (s) + ')');
+ if (typeof (tag) !== 'number')
+ tag = ASN1.OctetString;
+
+ var len = Buffer.byteLength(s);
+ this.writeByte(tag);
+ this.writeLength(len);
+ if (len) {
+ this._ensure(len);
+ this._buf.write(s, this._offset);
+ this._offset += len;
+ }
+};
+
+
+Writer.prototype.writeBuffer = function (buf, tag) {
+ if (typeof (tag) !== 'number')
+ throw new TypeError('tag must be a number');
+ if (!Buffer.isBuffer(buf))
+ throw new TypeError('argument must be a buffer');
+
+ this.writeByte(tag);
+ this.writeLength(buf.length);
+ this._ensure(buf.length);
+ buf.copy(this._buf, this._offset, 0, buf.length);
+ this._offset += buf.length;
+};
+
+
+Writer.prototype.writeStringArray = function (strings) {
+ if ((!strings instanceof Array))
+ throw new TypeError('argument must be an Array[String]');
+
+ var self = this;
+ strings.forEach(function (s) {
+ self.writeString(s);
+ });
+};
+
+// This is really to solve DER cases, but whatever for now
+Writer.prototype.writeOID = function (s, tag) {
+ if (typeof (s) !== 'string')
+ throw new TypeError('argument must be a string');
+ if (typeof (tag) !== 'number')
+ tag = ASN1.OID;
+
+ if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
+ throw new Error('argument is not a valid OID string');
+
+ function encodeOctet(bytes, octet) {
+ if (octet < 128) {
+ bytes.push(octet);
+ } else if (octet < 16384) {
+ bytes.push((octet >>> 7) | 0x80);
+ bytes.push(octet & 0x7F);
+ } else if (octet < 2097152) {
+ bytes.push((octet >>> 14) | 0x80);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ } else if (octet < 268435456) {
+ bytes.push((octet >>> 21) | 0x80);
+ bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ } else {
+ bytes.push(((octet >>> 28) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 21) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+ bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+ bytes.push(octet & 0x7F);
+ }
+ }
+
+ var tmp = s.split('.');
+ var bytes = [];
+ bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
+ tmp.slice(2).forEach(function (b) {
+ encodeOctet(bytes, parseInt(b, 10));
+ });
+
+ var self = this;
+ this._ensure(2 + bytes.length);
+ this.writeByte(tag);
+ this.writeLength(bytes.length);
+ bytes.forEach(function (b) {
+ self.writeByte(b);
+ });
+};
+
+
+Writer.prototype.writeLength = function (len) {
+ if (typeof (len) !== 'number')
+ throw new TypeError('argument must be a Number');
+
+ this._ensure(4);
+
+ if (len <= 0x7f) {
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xff) {
+ this._buf[this._offset++] = 0x81;
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xffff) {
+ this._buf[this._offset++] = 0x82;
+ this._buf[this._offset++] = len >> 8;
+ this._buf[this._offset++] = len;
+ } else if (len <= 0xffffff) {
+ this._buf[this._offset++] = 0x83;
+ this._buf[this._offset++] = len >> 16;
+ this._buf[this._offset++] = len >> 8;
+ this._buf[this._offset++] = len;
+ } else {
+ throw newInvalidAsn1Error('Length too long (> 4 bytes)');
+ }
+};
+
+Writer.prototype.startSequence = function (tag) {
+ if (typeof (tag) !== 'number')
+ tag = ASN1.Sequence | ASN1.Constructor;
+
+ this.writeByte(tag);
+ this._seq.push(this._offset);
+ this._ensure(3);
+ this._offset += 3;
+};
+
+
+Writer.prototype.endSequence = function () {
+ var seq = this._seq.pop();
+ var start = seq + 3;
+ var len = this._offset - start;
+
+ if (len <= 0x7f) {
+ this._shift(start, len, -2);
+ this._buf[seq] = len;
+ } else if (len <= 0xff) {
+ this._shift(start, len, -1);
+ this._buf[seq] = 0x81;
+ this._buf[seq + 1] = len;
+ } else if (len <= 0xffff) {
+ this._buf[seq] = 0x82;
+ this._buf[seq + 1] = len >> 8;
+ this._buf[seq + 2] = len;
+ } else if (len <= 0xffffff) {
+ this._shift(start, len, 1);
+ this._buf[seq] = 0x83;
+ this._buf[seq + 1] = len >> 16;
+ this._buf[seq + 2] = len >> 8;
+ this._buf[seq + 3] = len;
+ } else {
+ throw newInvalidAsn1Error('Sequence too long');
+ }
+};
+
+
+Writer.prototype._shift = function (start, len, shift) {
+ assert.ok(start !== undefined);
+ assert.ok(len !== undefined);
+ assert.ok(shift);
+
+ this._buf.copy(this._buf, start + shift, start, start + len);
+ this._offset += shift;
+};
+
+Writer.prototype._ensure = function (len) {
+ assert.ok(len);
+
+ if (this._size - this._offset < len) {
+ var sz = this._size * this._options.growthFactor;
+ if (sz - this._offset < len)
+ sz += len;
+
+ var buf = Buffer.alloc(sz);
+
+ this._buf.copy(buf, 0, 0, this._offset);
+ this._buf = buf;
+ this._size = sz;
+ }
+};
+
+
+
+// --- Exported API
+
+module.exports = Writer;
diff --git a/Nodejs/node_modules/asn1/lib/index.js b/Nodejs/node_modules/asn1/lib/index.js
new file mode 100644
index 0000000..ede3ab2
--- /dev/null
+++ b/Nodejs/node_modules/asn1/lib/index.js
@@ -0,0 +1,20 @@
+// Copyright 2011 Mark Cavage All rights reserved.
+
+// If you have no idea what ASN.1 or BER is, see this:
+// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
+
+var Ber = require('./ber/index');
+
+
+
+// --- Exported API
+
+module.exports = {
+
+ Ber: Ber,
+
+ BerReader: Ber.Reader,
+
+ BerWriter: Ber.Writer
+
+};
diff --git a/Nodejs/node_modules/asn1/package.json b/Nodejs/node_modules/asn1/package.json
new file mode 100644
index 0000000..ab1a2b0
--- /dev/null
+++ b/Nodejs/node_modules/asn1/package.json
@@ -0,0 +1,75 @@
+{
+ "_from": "asn1@~0.2.3",
+ "_id": "asn1@0.2.4",
+ "_inBundle": false,
+ "_integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
+ "_location": "/asn1",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "asn1@~0.2.3",
+ "name": "asn1",
+ "escapedName": "asn1",
+ "rawSpec": "~0.2.3",
+ "saveSpec": null,
+ "fetchSpec": "~0.2.3"
+ },
+ "_requiredBy": [
+ "/sshpk"
+ ],
+ "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
+ "_shasum": "8d2475dfab553bb33e77b54e59e880bb8ce23136",
+ "_spec": "asn1@~0.2.3",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/sshpk",
+ "author": {
+ "name": "Joyent",
+ "url": "joyent.com"
+ },
+ "bugs": {
+ "url": "https://github.com/joyent/node-asn1/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Mark Cavage",
+ "email": "mcavage@gmail.com"
+ },
+ {
+ "name": "David Gwynne",
+ "email": "loki@animata.net"
+ },
+ {
+ "name": "Yunong Xiao",
+ "email": "yunong@joyent.com"
+ },
+ {
+ "name": "Alex Wilson",
+ "email": "alex.wilson@joyent.com"
+ }
+ ],
+ "dependencies": {
+ "safer-buffer": "~2.1.0"
+ },
+ "deprecated": false,
+ "description": "Contains parsers and serializers for ASN.1 (currently BER only)",
+ "devDependencies": {
+ "eslint": "2.13.1",
+ "eslint-plugin-joyent": "~1.3.0",
+ "faucet": "0.0.1",
+ "istanbul": "^0.3.6",
+ "tape": "^3.5.0"
+ },
+ "homepage": "https://github.com/joyent/node-asn1#readme",
+ "license": "MIT",
+ "main": "lib/index.js",
+ "name": "asn1",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/joyent/node-asn1.git"
+ },
+ "scripts": {
+ "test": "tape ./test/ber/*.test.js"
+ },
+ "version": "0.2.4"
+}
diff --git a/Nodejs/node_modules/assert-plus/AUTHORS b/Nodejs/node_modules/assert-plus/AUTHORS
new file mode 100644
index 0000000..1923524
--- /dev/null
+++ b/Nodejs/node_modules/assert-plus/AUTHORS
@@ -0,0 +1,6 @@
+Dave Eddy
+Fred Kuo
+Lars-Magnus Skog
+Mark Cavage
+Patrick Mooney
+Rob Gulewich
diff --git a/Nodejs/node_modules/assert-plus/CHANGES.md b/Nodejs/node_modules/assert-plus/CHANGES.md
new file mode 100644
index 0000000..57d92bf
--- /dev/null
+++ b/Nodejs/node_modules/assert-plus/CHANGES.md
@@ -0,0 +1,14 @@
+# assert-plus Changelog
+
+## 1.0.0
+
+- *BREAKING* assert.number (and derivatives) now accept Infinity as valid input
+- Add assert.finite check. Previous assert.number callers should use this if
+ they expect Infinity inputs to throw.
+
+## 0.2.0
+
+- Fix `assert.object(null)` so it throws
+- Fix optional/arrayOf exports for non-type-of asserts
+- Add optiona/arrayOf exports for Stream/Date/Regex/uuid
+- Add basic unit test coverage
diff --git a/Nodejs/node_modules/assert-plus/README.md b/Nodejs/node_modules/assert-plus/README.md
new file mode 100644
index 0000000..ec200d1
--- /dev/null
+++ b/Nodejs/node_modules/assert-plus/README.md
@@ -0,0 +1,162 @@
+# assert-plus
+
+This library is a super small wrapper over node's assert module that has two
+things: (1) the ability to disable assertions with the environment variable
+NODE\_NDEBUG, and (2) some API wrappers for argument testing. Like
+`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks
+like this:
+
+```javascript
+ var assert = require('assert-plus');
+
+ function fooAccount(options, callback) {
+ assert.object(options, 'options');
+ assert.number(options.id, 'options.id');
+ assert.bool(options.isManager, 'options.isManager');
+ assert.string(options.name, 'options.name');
+ assert.arrayOfString(options.email, 'options.email');
+ assert.func(callback, 'callback');
+
+ // Do stuff
+ callback(null, {});
+ }
+```
+
+# API
+
+All methods that *aren't* part of node's core assert API are simply assumed to
+take an argument, and then a string 'name' that's not a message; `AssertionError`
+will be thrown if the assertion fails with a message like:
+
+ AssertionError: foo (string) is required
+ at test (/home/mark/work/foo/foo.js:3:9)
+ at Object. (/home/mark/work/foo/foo.js:15:1)
+ at Module._compile (module.js:446:26)
+ at Object..js (module.js:464:10)
+ at Module.load (module.js:353:31)
+ at Function._load (module.js:311:12)
+ at Array.0 (module.js:484:10)
+ at EventEmitter._tickCallback (node.js:190:38)
+
+from:
+
+```javascript
+ function test(foo) {
+ assert.string(foo, 'foo');
+ }
+```
+
+There you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`:
+
+```javascript
+ function test(foo) {
+ assert.arrayOfString(foo, 'foo');
+ }
+```
+
+You can assert IFF an argument is not `undefined` (i.e., an optional arg):
+
+```javascript
+ assert.optionalString(foo, 'foo');
+```
+
+Lastly, you can opt-out of assertion checking altogether by setting the
+environment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have
+lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
+production. Be advised: The standard functions re-exported from `assert` are
+also disabled in assert-plus if NDEBUG is specified. Using them directly from
+the `assert` module avoids this behavior.
+
+The complete list of APIs is:
+
+* assert.array
+* assert.bool
+* assert.buffer
+* assert.func
+* assert.number
+* assert.finite
+* assert.object
+* assert.string
+* assert.stream
+* assert.date
+* assert.regexp
+* assert.uuid
+* assert.arrayOfArray
+* assert.arrayOfBool
+* assert.arrayOfBuffer
+* assert.arrayOfFunc
+* assert.arrayOfNumber
+* assert.arrayOfFinite
+* assert.arrayOfObject
+* assert.arrayOfString
+* assert.arrayOfStream
+* assert.arrayOfDate
+* assert.arrayOfRegexp
+* assert.arrayOfUuid
+* assert.optionalArray
+* assert.optionalBool
+* assert.optionalBuffer
+* assert.optionalFunc
+* assert.optionalNumber
+* assert.optionalFinite
+* assert.optionalObject
+* assert.optionalString
+* assert.optionalStream
+* assert.optionalDate
+* assert.optionalRegexp
+* assert.optionalUuid
+* assert.optionalArrayOfArray
+* assert.optionalArrayOfBool
+* assert.optionalArrayOfBuffer
+* assert.optionalArrayOfFunc
+* assert.optionalArrayOfNumber
+* assert.optionalArrayOfFinite
+* assert.optionalArrayOfObject
+* assert.optionalArrayOfString
+* assert.optionalArrayOfStream
+* assert.optionalArrayOfDate
+* assert.optionalArrayOfRegexp
+* assert.optionalArrayOfUuid
+* assert.AssertionError
+* assert.fail
+* assert.ok
+* assert.equal
+* assert.notEqual
+* assert.deepEqual
+* assert.notDeepEqual
+* assert.strictEqual
+* assert.notStrictEqual
+* assert.throws
+* assert.doesNotThrow
+* assert.ifError
+
+# Installation
+
+ npm install assert-plus
+
+## License
+
+The MIT License (MIT)
+Copyright (c) 2012 Mark Cavage
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+## Bugs
+
+See .
diff --git a/Nodejs/node_modules/assert-plus/assert.js b/Nodejs/node_modules/assert-plus/assert.js
new file mode 100644
index 0000000..26f944e
--- /dev/null
+++ b/Nodejs/node_modules/assert-plus/assert.js
@@ -0,0 +1,211 @@
+// Copyright (c) 2012, Mark Cavage. All rights reserved.
+// Copyright 2015 Joyent, Inc.
+
+var assert = require('assert');
+var Stream = require('stream').Stream;
+var util = require('util');
+
+
+///--- Globals
+
+/* JSSTYLED */
+var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
+
+
+///--- Internal
+
+function _capitalize(str) {
+ return (str.charAt(0).toUpperCase() + str.slice(1));
+}
+
+function _toss(name, expected, oper, arg, actual) {
+ throw new assert.AssertionError({
+ message: util.format('%s (%s) is required', name, expected),
+ actual: (actual === undefined) ? typeof (arg) : actual(arg),
+ expected: expected,
+ operator: oper || '===',
+ stackStartFunction: _toss.caller
+ });
+}
+
+function _getClass(arg) {
+ return (Object.prototype.toString.call(arg).slice(8, -1));
+}
+
+function noop() {
+ // Why even bother with asserts?
+}
+
+
+///--- Exports
+
+var types = {
+ bool: {
+ check: function (arg) { return typeof (arg) === 'boolean'; }
+ },
+ func: {
+ check: function (arg) { return typeof (arg) === 'function'; }
+ },
+ string: {
+ check: function (arg) { return typeof (arg) === 'string'; }
+ },
+ object: {
+ check: function (arg) {
+ return typeof (arg) === 'object' && arg !== null;
+ }
+ },
+ number: {
+ check: function (arg) {
+ return typeof (arg) === 'number' && !isNaN(arg);
+ }
+ },
+ finite: {
+ check: function (arg) {
+ return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
+ }
+ },
+ buffer: {
+ check: function (arg) { return Buffer.isBuffer(arg); },
+ operator: 'Buffer.isBuffer'
+ },
+ array: {
+ check: function (arg) { return Array.isArray(arg); },
+ operator: 'Array.isArray'
+ },
+ stream: {
+ check: function (arg) { return arg instanceof Stream; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ date: {
+ check: function (arg) { return arg instanceof Date; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ regexp: {
+ check: function (arg) { return arg instanceof RegExp; },
+ operator: 'instanceof',
+ actual: _getClass
+ },
+ uuid: {
+ check: function (arg) {
+ return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
+ },
+ operator: 'isUUID'
+ }
+};
+
+function _setExports(ndebug) {
+ var keys = Object.keys(types);
+ var out;
+
+ /* re-export standard assert */
+ if (process.env.NODE_NDEBUG) {
+ out = noop;
+ } else {
+ out = function (arg, msg) {
+ if (!arg) {
+ _toss(msg, 'true', arg);
+ }
+ };
+ }
+
+ /* standard checks */
+ keys.forEach(function (k) {
+ if (ndebug) {
+ out[k] = noop;
+ return;
+ }
+ var type = types[k];
+ out[k] = function (arg, msg) {
+ if (!type.check(arg)) {
+ _toss(msg, k, type.operator, arg, type.actual);
+ }
+ };
+ });
+
+ /* optional checks */
+ keys.forEach(function (k) {
+ var name = 'optional' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ out[name] = function (arg, msg) {
+ if (arg === undefined || arg === null) {
+ return;
+ }
+ if (!type.check(arg)) {
+ _toss(msg, k, type.operator, arg, type.actual);
+ }
+ };
+ });
+
+ /* arrayOf checks */
+ keys.forEach(function (k) {
+ var name = 'arrayOf' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ var expected = '[' + k + ']';
+ out[name] = function (arg, msg) {
+ if (!Array.isArray(arg)) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ var i;
+ for (i = 0; i < arg.length; i++) {
+ if (!type.check(arg[i])) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ }
+ };
+ });
+
+ /* optionalArrayOf checks */
+ keys.forEach(function (k) {
+ var name = 'optionalArrayOf' + _capitalize(k);
+ if (ndebug) {
+ out[name] = noop;
+ return;
+ }
+ var type = types[k];
+ var expected = '[' + k + ']';
+ out[name] = function (arg, msg) {
+ if (arg === undefined || arg === null) {
+ return;
+ }
+ if (!Array.isArray(arg)) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ var i;
+ for (i = 0; i < arg.length; i++) {
+ if (!type.check(arg[i])) {
+ _toss(msg, expected, type.operator, arg, type.actual);
+ }
+ }
+ };
+ });
+
+ /* re-export built-in assertions */
+ Object.keys(assert).forEach(function (k) {
+ if (k === 'AssertionError') {
+ out[k] = assert[k];
+ return;
+ }
+ if (ndebug) {
+ out[k] = noop;
+ return;
+ }
+ out[k] = assert[k];
+ });
+
+ /* export ourselves (for unit tests _only_) */
+ out._setExports = _setExports;
+
+ return out;
+}
+
+module.exports = _setExports(process.env.NODE_NDEBUG);
diff --git a/Nodejs/node_modules/assert-plus/package.json b/Nodejs/node_modules/assert-plus/package.json
new file mode 100644
index 0000000..d5a39ef
--- /dev/null
+++ b/Nodejs/node_modules/assert-plus/package.json
@@ -0,0 +1,87 @@
+{
+ "_from": "assert-plus@^1.0.0",
+ "_id": "assert-plus@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
+ "_location": "/assert-plus",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "assert-plus@^1.0.0",
+ "name": "assert-plus",
+ "escapedName": "assert-plus",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/dashdash",
+ "/getpass",
+ "/http-signature",
+ "/jsprim",
+ "/sshpk",
+ "/verror"
+ ],
+ "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
+ "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
+ "_spec": "assert-plus@^1.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/http-signature",
+ "author": {
+ "name": "Mark Cavage",
+ "email": "mcavage@gmail.com"
+ },
+ "bugs": {
+ "url": "https://github.com/mcavage/node-assert-plus/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Dave Eddy",
+ "email": "dave@daveeddy.com"
+ },
+ {
+ "name": "Fred Kuo",
+ "email": "fred.kuo@joyent.com"
+ },
+ {
+ "name": "Lars-Magnus Skog",
+ "email": "ralphtheninja@riseup.net"
+ },
+ {
+ "name": "Mark Cavage",
+ "email": "mcavage@gmail.com"
+ },
+ {
+ "name": "Patrick Mooney",
+ "email": "pmooney@pfmooney.com"
+ },
+ {
+ "name": "Rob Gulewich",
+ "email": "robert.gulewich@joyent.com"
+ }
+ ],
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Extra assertions on top of node's assert module",
+ "devDependencies": {
+ "faucet": "0.0.1",
+ "tape": "4.2.2"
+ },
+ "engines": {
+ "node": ">=0.8"
+ },
+ "homepage": "https://github.com/mcavage/node-assert-plus#readme",
+ "license": "MIT",
+ "main": "./assert.js",
+ "name": "assert-plus",
+ "optionalDependencies": {},
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mcavage/node-assert-plus.git"
+ },
+ "scripts": {
+ "test": "tape tests/*.js | ./node_modules/.bin/faucet"
+ },
+ "version": "1.0.0"
+}
diff --git a/Nodejs/node_modules/async-limiter/.eslintignore b/Nodejs/node_modules/async-limiter/.eslintignore
new file mode 100644
index 0000000..e1661e5
--- /dev/null
+++ b/Nodejs/node_modules/async-limiter/.eslintignore
@@ -0,0 +1,2 @@
+coverage
+.nyc_output
\ No newline at end of file
diff --git a/Nodejs/node_modules/async-limiter/.nycrc b/Nodejs/node_modules/async-limiter/.nycrc
new file mode 100644
index 0000000..874c1de
--- /dev/null
+++ b/Nodejs/node_modules/async-limiter/.nycrc
@@ -0,0 +1,10 @@
+{
+ "check-coverage": false,
+ "lines": 99,
+ "statements": 99,
+ "functions": 99,
+ "branches": 99,
+ "include": [
+ "index.js"
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/async-limiter/.travis.yml b/Nodejs/node_modules/async-limiter/.travis.yml
new file mode 100644
index 0000000..37026e2
--- /dev/null
+++ b/Nodejs/node_modules/async-limiter/.travis.yml
@@ -0,0 +1,9 @@
+language: node_js
+node_js:
+ - "6"
+ - "8"
+ - "10"
+ - "node"
+script: npm run travis
+cache:
+ yarn: true
diff --git a/Nodejs/node_modules/async-limiter/LICENSE b/Nodejs/node_modules/async-limiter/LICENSE
new file mode 100644
index 0000000..9c91fb2
--- /dev/null
+++ b/Nodejs/node_modules/async-limiter/LICENSE
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) 2017 Samuel Reed
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Nodejs/node_modules/async-limiter/index.js b/Nodejs/node_modules/async-limiter/index.js
new file mode 100644
index 0000000..c9bd2f9
--- /dev/null
+++ b/Nodejs/node_modules/async-limiter/index.js
@@ -0,0 +1,67 @@
+'use strict';
+
+function Queue(options) {
+ if (!(this instanceof Queue)) {
+ return new Queue(options);
+ }
+
+ options = options || {};
+ this.concurrency = options.concurrency || Infinity;
+ this.pending = 0;
+ this.jobs = [];
+ this.cbs = [];
+ this._done = done.bind(this);
+}
+
+var arrayAddMethods = [
+ 'push',
+ 'unshift',
+ 'splice'
+];
+
+arrayAddMethods.forEach(function(method) {
+ Queue.prototype[method] = function() {
+ var methodResult = Array.prototype[method].apply(this.jobs, arguments);
+ this._run();
+ return methodResult;
+ };
+});
+
+Object.defineProperty(Queue.prototype, 'length', {
+ get: function() {
+ return this.pending + this.jobs.length;
+ }
+});
+
+Queue.prototype._run = function() {
+ if (this.pending === this.concurrency) {
+ return;
+ }
+ if (this.jobs.length) {
+ var job = this.jobs.shift();
+ this.pending++;
+ job(this._done);
+ this._run();
+ }
+
+ if (this.pending === 0) {
+ while (this.cbs.length !== 0) {
+ var cb = this.cbs.pop();
+ process.nextTick(cb);
+ }
+ }
+};
+
+Queue.prototype.onDone = function(cb) {
+ if (typeof cb === 'function') {
+ this.cbs.push(cb);
+ this._run();
+ }
+};
+
+function done() {
+ this.pending--;
+ this._run();
+}
+
+module.exports = Queue;
diff --git a/Nodejs/node_modules/async-limiter/package.json b/Nodejs/node_modules/async-limiter/package.json
new file mode 100644
index 0000000..cf9b576
--- /dev/null
+++ b/Nodejs/node_modules/async-limiter/package.json
@@ -0,0 +1,69 @@
+{
+ "_from": "async-limiter@~1.0.0",
+ "_id": "async-limiter@1.0.1",
+ "_inBundle": false,
+ "_integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==",
+ "_location": "/async-limiter",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "async-limiter@~1.0.0",
+ "name": "async-limiter",
+ "escapedName": "async-limiter",
+ "rawSpec": "~1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "~1.0.0"
+ },
+ "_requiredBy": [
+ "/ws"
+ ],
+ "_resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
+ "_shasum": "dd379e94f0db8310b08291f9d64c3209766617fd",
+ "_spec": "async-limiter@~1.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/ws",
+ "author": {
+ "name": "Samuel Reed"
+ },
+ "bugs": {
+ "url": "https://github.com/strml/async-limiter/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "asynchronous function queue with adjustable concurrency",
+ "devDependencies": {
+ "coveralls": "^3.0.3",
+ "eslint": "^5.16.0",
+ "eslint-plugin-mocha": "^5.3.0",
+ "intelli-espower-loader": "^1.0.1",
+ "mocha": "^6.1.4",
+ "nyc": "^14.1.1",
+ "power-assert": "^1.6.1"
+ },
+ "homepage": "https://github.com/strml/async-limiter#readme",
+ "keywords": [
+ "throttle",
+ "async",
+ "limiter",
+ "asynchronous",
+ "job",
+ "task",
+ "concurrency",
+ "concurrent"
+ ],
+ "license": "MIT",
+ "name": "async-limiter",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/strml/async-limiter.git"
+ },
+ "scripts": {
+ "coverage": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
+ "example": "node example",
+ "lint": "eslint .",
+ "test": "mocha --require intelli-espower-loader test/",
+ "travis": "npm run lint && npm run test"
+ },
+ "version": "1.0.1"
+}
diff --git a/Nodejs/node_modules/async-limiter/readme.md b/Nodejs/node_modules/async-limiter/readme.md
new file mode 100644
index 0000000..fcaa22f
--- /dev/null
+++ b/Nodejs/node_modules/async-limiter/readme.md
@@ -0,0 +1,132 @@
+# Async-Limiter
+
+A module for limiting concurrent asynchronous actions in flight. Forked from [queue](https://github.com/jessetane/queue).
+
+[](http://www.npmjs.org/async-limiter)
+[](https://travis-ci.org/STRML/async-limiter)
+[](https://coveralls.io/r/STRML/async-limiter)
+
+This module exports a class `Limiter` that implements some of the `Array` API.
+Pass async functions (ones that accept a callback or return a promise) to an instance's additive array methods.
+
+## Motivation
+
+Certain functions, like `zlib`, have [undesirable behavior](https://github.com/nodejs/node/issues/8871#issuecomment-250915913) when
+run at infinite concurrency.
+
+In this case, it is actually faster, and takes far less memory, to limit concurrency.
+
+This module should do the absolute minimum work necessary to queue up functions. PRs are welcome that would
+make this module faster or lighter, but new functionality is not desired.
+
+Style should confirm to nodejs/node style.
+
+## Example
+
+``` javascript
+var Limiter = require('async-limiter')
+
+var t = new Limiter({concurrency: 2});
+var results = []
+
+// add jobs using the familiar Array API
+t.push(function (cb) {
+ results.push('two')
+ cb()
+})
+
+t.push(
+ function (cb) {
+ results.push('four')
+ cb()
+ },
+ function (cb) {
+ results.push('five')
+ cb()
+ }
+)
+
+t.unshift(function (cb) {
+ results.push('one')
+ cb()
+})
+
+t.splice(2, 0, function (cb) {
+ results.push('three')
+ cb()
+})
+
+// Jobs run automatically. If you want a callback when all are done,
+// call 'onDone()'.
+t.onDone(function () {
+ console.log('all done:', results)
+})
+```
+
+## Zlib Example
+
+```js
+const zlib = require('zlib');
+const Limiter = require('async-limiter');
+
+const message = {some: "data"};
+const payload = new Buffer(JSON.stringify(message));
+
+// Try with different concurrency values to see how this actually
+// slows significantly with higher concurrency!
+//
+// 5: 1398.607ms
+// 10: 1375.668ms
+// Infinity: 4423.300ms
+//
+const t = new Limiter({concurrency: 5});
+function deflate(payload, cb) {
+ t.push(function(done) {
+ zlib.deflate(payload, function(err, buffer) {
+ done();
+ cb(err, buffer);
+ });
+ });
+}
+
+console.time('deflate');
+for(let i = 0; i < 30000; ++i) {
+ deflate(payload, function (err, buffer) {});
+}
+t.onDone(function() {
+ console.timeEnd('deflate');
+});
+```
+
+## Install
+
+`npm install async-limiter`
+
+## Test
+
+`npm test`
+
+## API
+
+### `var t = new Limiter([opts])`
+Constructor. `opts` may contain inital values for:
+* `t.concurrency`
+
+## Instance methods
+
+### `t.onDone(fn)`
+`fn` will be called once and only once, when the queue is empty.
+
+## Instance methods mixed in from `Array`
+Mozilla has docs on how these methods work [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
+### `t.push(element1, ..., elementN)`
+### `t.unshift(element1, ..., elementN)`
+### `t.splice(index , howMany[, element1[, ...[, elementN]]])`
+
+## Properties
+### `t.concurrency`
+Max number of jobs the queue should process concurrently, defaults to `Infinity`.
+
+### `t.length`
+Jobs pending + jobs to process (readonly).
+
diff --git a/Nodejs/node_modules/asynckit/LICENSE b/Nodejs/node_modules/asynckit/LICENSE
new file mode 100644
index 0000000..c9eca5d
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Alex Indigo
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Nodejs/node_modules/asynckit/README.md b/Nodejs/node_modules/asynckit/README.md
new file mode 100644
index 0000000..ddcc7e6
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/README.md
@@ -0,0 +1,233 @@
+# asynckit [](https://www.npmjs.com/package/asynckit)
+
+Minimal async jobs utility library, with streams support.
+
+[](https://travis-ci.org/alexindigo/asynckit)
+[](https://travis-ci.org/alexindigo/asynckit)
+[](https://ci.appveyor.com/project/alexindigo/asynckit)
+
+[](https://coveralls.io/github/alexindigo/asynckit?branch=master)
+[](https://david-dm.org/alexindigo/asynckit)
+[](https://www.bithound.io/github/alexindigo/asynckit)
+
+
+
+AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects.
+Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method.
+
+It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators.
+
+| compression | size |
+| :----------------- | -------: |
+| asynckit.js | 12.34 kB |
+| asynckit.min.js | 4.11 kB |
+| asynckit.min.js.gz | 1.47 kB |
+
+
+## Install
+
+```sh
+$ npm install --save asynckit
+```
+
+## Examples
+
+### Parallel Jobs
+
+Runs iterator over provided array in parallel. Stores output in the `result` array,
+on the matching positions. In unlikely event of an error from one of the jobs,
+will terminate rest of the active jobs (if abort function is provided)
+and return error along with salvaged data to the main callback function.
+
+#### Input Array
+
+```javascript
+var parallel = require('asynckit').parallel
+ , assert = require('assert')
+ ;
+
+var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
+ , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
+ , target = []
+ ;
+
+parallel(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+});
+
+// async job accepts one element from the array
+// and a callback function
+function asyncJob(item, cb)
+{
+ // different delays (in ms) per item
+ var delay = item * 25;
+
+ // pretend different jobs take different time to finish
+ // and not in consequential order
+ var timeoutId = setTimeout(function() {
+ target.push(item);
+ cb(null, item * 2);
+ }, delay);
+
+ // allow to cancel "leftover" jobs upon error
+ // return function, invoking of which will abort this job
+ return clearTimeout.bind(null, timeoutId);
+}
+```
+
+More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js).
+
+#### Input Object
+
+Also it supports named jobs, listed via object.
+
+```javascript
+var parallel = require('asynckit/parallel')
+ , assert = require('assert')
+ ;
+
+var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
+ , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
+ , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
+ , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ]
+ , target = []
+ , keys = []
+ ;
+
+parallel(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+ assert.deepEqual(keys, expectedKeys);
+});
+
+// supports full value, key, callback (shortcut) interface
+function asyncJob(item, key, cb)
+{
+ // different delays (in ms) per item
+ var delay = item * 25;
+
+ // pretend different jobs take different time to finish
+ // and not in consequential order
+ var timeoutId = setTimeout(function() {
+ keys.push(key);
+ target.push(item);
+ cb(null, item * 2);
+ }, delay);
+
+ // allow to cancel "leftover" jobs upon error
+ // return function, invoking of which will abort this job
+ return clearTimeout.bind(null, timeoutId);
+}
+```
+
+More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js).
+
+### Serial Jobs
+
+Runs iterator over provided array sequentially. Stores output in the `result` array,
+on the matching positions. In unlikely event of an error from one of the jobs,
+will not proceed to the rest of the items in the list
+and return error along with salvaged data to the main callback function.
+
+#### Input Array
+
+```javascript
+var serial = require('asynckit/serial')
+ , assert = require('assert')
+ ;
+
+var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
+ , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+ , target = []
+ ;
+
+serial(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+});
+
+// extended interface (item, key, callback)
+// also supported for arrays
+function asyncJob(item, key, cb)
+{
+ target.push(key);
+
+ // it will be automatically made async
+ // even it iterator "returns" in the same event loop
+ cb(null, item * 2);
+}
+```
+
+More examples could be found in [test/test-serial-array.js](test/test-serial-array.js).
+
+#### Input Object
+
+Also it supports named jobs, listed via object.
+
+```javascript
+var serial = require('asynckit').serial
+ , assert = require('assert')
+ ;
+
+var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
+ , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+ , target = []
+ ;
+
+var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
+ , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
+ , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
+ , target = []
+ ;
+
+
+serial(source, asyncJob, function(err, result)
+{
+ assert.deepEqual(result, expectedResult);
+ assert.deepEqual(target, expectedTarget);
+});
+
+// shortcut interface (item, callback)
+// works for object as well as for the arrays
+function asyncJob(item, cb)
+{
+ target.push(item);
+
+ // it will be automatically made async
+ // even it iterator "returns" in the same event loop
+ cb(null, item * 2);
+}
+```
+
+More examples could be found in [test/test-serial-object.js](test/test-serial-object.js).
+
+_Note: Since _object_ is an _unordered_ collection of properties,
+it may produce unexpected results with sequential iterations.
+Whenever order of the jobs' execution is important please use `serialOrdered` method._
+
+### Ordered Serial Iterations
+
+TBD
+
+For example [compare-property](compare-property) package.
+
+### Streaming interface
+
+TBD
+
+## Want to Know More?
+
+More examples can be found in [test folder](test/).
+
+Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions.
+
+## License
+
+AsyncKit is licensed under the MIT license.
diff --git a/Nodejs/node_modules/asynckit/bench.js b/Nodejs/node_modules/asynckit/bench.js
new file mode 100644
index 0000000..c612f1a
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/bench.js
@@ -0,0 +1,76 @@
+/* eslint no-console: "off" */
+
+var asynckit = require('./')
+ , async = require('async')
+ , assert = require('assert')
+ , expected = 0
+ ;
+
+var Benchmark = require('benchmark');
+var suite = new Benchmark.Suite;
+
+var source = [];
+for (var z = 1; z < 100; z++)
+{
+ source.push(z);
+ expected += z;
+}
+
+suite
+// add tests
+
+.add('async.map', function(deferred)
+{
+ var total = 0;
+
+ async.map(source,
+ function(i, cb)
+ {
+ setImmediate(function()
+ {
+ total += i;
+ cb(null, total);
+ });
+ },
+ function(err, result)
+ {
+ assert.ifError(err);
+ assert.equal(result[result.length - 1], expected);
+ deferred.resolve();
+ });
+}, {'defer': true})
+
+
+.add('asynckit.parallel', function(deferred)
+{
+ var total = 0;
+
+ asynckit.parallel(source,
+ function(i, cb)
+ {
+ setImmediate(function()
+ {
+ total += i;
+ cb(null, total);
+ });
+ },
+ function(err, result)
+ {
+ assert.ifError(err);
+ assert.equal(result[result.length - 1], expected);
+ deferred.resolve();
+ });
+}, {'defer': true})
+
+
+// add listeners
+.on('cycle', function(ev)
+{
+ console.log(String(ev.target));
+})
+.on('complete', function()
+{
+ console.log('Fastest is ' + this.filter('fastest').map('name'));
+})
+// run async
+.run({ 'async': true });
diff --git a/Nodejs/node_modules/asynckit/index.js b/Nodejs/node_modules/asynckit/index.js
new file mode 100644
index 0000000..455f945
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/index.js
@@ -0,0 +1,6 @@
+module.exports =
+{
+ parallel : require('./parallel.js'),
+ serial : require('./serial.js'),
+ serialOrdered : require('./serialOrdered.js')
+};
diff --git a/Nodejs/node_modules/asynckit/lib/abort.js b/Nodejs/node_modules/asynckit/lib/abort.js
new file mode 100644
index 0000000..114367e
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/abort.js
@@ -0,0 +1,29 @@
+// API
+module.exports = abort;
+
+/**
+ * Aborts leftover active jobs
+ *
+ * @param {object} state - current state object
+ */
+function abort(state)
+{
+ Object.keys(state.jobs).forEach(clean.bind(state));
+
+ // reset leftover jobs
+ state.jobs = {};
+}
+
+/**
+ * Cleans up leftover job by invoking abort function for the provided job id
+ *
+ * @this state
+ * @param {string|number} key - job id to abort
+ */
+function clean(key)
+{
+ if (typeof this.jobs[key] == 'function')
+ {
+ this.jobs[key]();
+ }
+}
diff --git a/Nodejs/node_modules/asynckit/lib/async.js b/Nodejs/node_modules/asynckit/lib/async.js
new file mode 100644
index 0000000..7f1288a
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/async.js
@@ -0,0 +1,34 @@
+var defer = require('./defer.js');
+
+// API
+module.exports = async;
+
+/**
+ * Runs provided callback asynchronously
+ * even if callback itself is not
+ *
+ * @param {function} callback - callback to invoke
+ * @returns {function} - augmented callback
+ */
+function async(callback)
+{
+ var isAsync = false;
+
+ // check if async happened
+ defer(function() { isAsync = true; });
+
+ return function async_callback(err, result)
+ {
+ if (isAsync)
+ {
+ callback(err, result);
+ }
+ else
+ {
+ defer(function nextTick_callback()
+ {
+ callback(err, result);
+ });
+ }
+ };
+}
diff --git a/Nodejs/node_modules/asynckit/lib/defer.js b/Nodejs/node_modules/asynckit/lib/defer.js
new file mode 100644
index 0000000..b67110c
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/defer.js
@@ -0,0 +1,26 @@
+module.exports = defer;
+
+/**
+ * Runs provided function on next iteration of the event loop
+ *
+ * @param {function} fn - function to run
+ */
+function defer(fn)
+{
+ var nextTick = typeof setImmediate == 'function'
+ ? setImmediate
+ : (
+ typeof process == 'object' && typeof process.nextTick == 'function'
+ ? process.nextTick
+ : null
+ );
+
+ if (nextTick)
+ {
+ nextTick(fn);
+ }
+ else
+ {
+ setTimeout(fn, 0);
+ }
+}
diff --git a/Nodejs/node_modules/asynckit/lib/iterate.js b/Nodejs/node_modules/asynckit/lib/iterate.js
new file mode 100644
index 0000000..5d2839a
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/iterate.js
@@ -0,0 +1,75 @@
+var async = require('./async.js')
+ , abort = require('./abort.js')
+ ;
+
+// API
+module.exports = iterate;
+
+/**
+ * Iterates over each job object
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {object} state - current job status
+ * @param {function} callback - invoked when all elements processed
+ */
+function iterate(list, iterator, state, callback)
+{
+ // store current index
+ var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
+
+ state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
+ {
+ // don't repeat yourself
+ // skip secondary callbacks
+ if (!(key in state.jobs))
+ {
+ return;
+ }
+
+ // clean up jobs
+ delete state.jobs[key];
+
+ if (error)
+ {
+ // don't process rest of the results
+ // stop still active jobs
+ // and reset the list
+ abort(state);
+ }
+ else
+ {
+ state.results[key] = output;
+ }
+
+ // return salvaged results
+ callback(error, state.results);
+ });
+}
+
+/**
+ * Runs iterator over provided job element
+ *
+ * @param {function} iterator - iterator to invoke
+ * @param {string|number} key - key/index of the element in the list of jobs
+ * @param {mixed} item - job description
+ * @param {function} callback - invoked after iterator is done with the job
+ * @returns {function|mixed} - job abort function or something else
+ */
+function runJob(iterator, key, item, callback)
+{
+ var aborter;
+
+ // allow shortcut if iterator expects only two arguments
+ if (iterator.length == 2)
+ {
+ aborter = iterator(item, async(callback));
+ }
+ // otherwise go with full three arguments
+ else
+ {
+ aborter = iterator(item, key, async(callback));
+ }
+
+ return aborter;
+}
diff --git a/Nodejs/node_modules/asynckit/lib/readable_asynckit.js b/Nodejs/node_modules/asynckit/lib/readable_asynckit.js
new file mode 100644
index 0000000..78ad240
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/readable_asynckit.js
@@ -0,0 +1,91 @@
+var streamify = require('./streamify.js')
+ , defer = require('./defer.js')
+ ;
+
+// API
+module.exports = ReadableAsyncKit;
+
+/**
+ * Base constructor for all streams
+ * used to hold properties/methods
+ */
+function ReadableAsyncKit()
+{
+ ReadableAsyncKit.super_.apply(this, arguments);
+
+ // list of active jobs
+ this.jobs = {};
+
+ // add stream methods
+ this.destroy = destroy;
+ this._start = _start;
+ this._read = _read;
+}
+
+/**
+ * Destroys readable stream,
+ * by aborting outstanding jobs
+ *
+ * @returns {void}
+ */
+function destroy()
+{
+ if (this.destroyed)
+ {
+ return;
+ }
+
+ this.destroyed = true;
+
+ if (typeof this.terminator == 'function')
+ {
+ this.terminator();
+ }
+}
+
+/**
+ * Starts provided jobs in async manner
+ *
+ * @private
+ */
+function _start()
+{
+ // first argument – runner function
+ var runner = arguments[0]
+ // take away first argument
+ , args = Array.prototype.slice.call(arguments, 1)
+ // second argument - input data
+ , input = args[0]
+ // last argument - result callback
+ , endCb = streamify.callback.call(this, args[args.length - 1])
+ ;
+
+ args[args.length - 1] = endCb;
+ // third argument - iterator
+ args[1] = streamify.iterator.call(this, args[1]);
+
+ // allow time for proper setup
+ defer(function()
+ {
+ if (!this.destroyed)
+ {
+ this.terminator = runner.apply(null, args);
+ }
+ else
+ {
+ endCb(null, Array.isArray(input) ? [] : {});
+ }
+ }.bind(this));
+}
+
+
+/**
+ * Implement _read to comply with Readable streams
+ * Doesn't really make sense for flowing object mode
+ *
+ * @private
+ */
+function _read()
+{
+
+}
diff --git a/Nodejs/node_modules/asynckit/lib/readable_parallel.js b/Nodejs/node_modules/asynckit/lib/readable_parallel.js
new file mode 100644
index 0000000..5d2929f
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/readable_parallel.js
@@ -0,0 +1,25 @@
+var parallel = require('../parallel.js');
+
+// API
+module.exports = ReadableParallel;
+
+/**
+ * Streaming wrapper to `asynckit.parallel`
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {stream.Readable#}
+ */
+function ReadableParallel(list, iterator, callback)
+{
+ if (!(this instanceof ReadableParallel))
+ {
+ return new ReadableParallel(list, iterator, callback);
+ }
+
+ // turn on object mode
+ ReadableParallel.super_.call(this, {objectMode: true});
+
+ this._start(parallel, list, iterator, callback);
+}
diff --git a/Nodejs/node_modules/asynckit/lib/readable_serial.js b/Nodejs/node_modules/asynckit/lib/readable_serial.js
new file mode 100644
index 0000000..7822698
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/readable_serial.js
@@ -0,0 +1,25 @@
+var serial = require('../serial.js');
+
+// API
+module.exports = ReadableSerial;
+
+/**
+ * Streaming wrapper to `asynckit.serial`
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {stream.Readable#}
+ */
+function ReadableSerial(list, iterator, callback)
+{
+ if (!(this instanceof ReadableSerial))
+ {
+ return new ReadableSerial(list, iterator, callback);
+ }
+
+ // turn on object mode
+ ReadableSerial.super_.call(this, {objectMode: true});
+
+ this._start(serial, list, iterator, callback);
+}
diff --git a/Nodejs/node_modules/asynckit/lib/readable_serial_ordered.js b/Nodejs/node_modules/asynckit/lib/readable_serial_ordered.js
new file mode 100644
index 0000000..3de89c4
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/readable_serial_ordered.js
@@ -0,0 +1,29 @@
+var serialOrdered = require('../serialOrdered.js');
+
+// API
+module.exports = ReadableSerialOrdered;
+// expose sort helpers
+module.exports.ascending = serialOrdered.ascending;
+module.exports.descending = serialOrdered.descending;
+
+/**
+ * Streaming wrapper to `asynckit.serialOrdered`
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} sortMethod - custom sort function
+ * @param {function} callback - invoked when all elements processed
+ * @returns {stream.Readable#}
+ */
+function ReadableSerialOrdered(list, iterator, sortMethod, callback)
+{
+ if (!(this instanceof ReadableSerialOrdered))
+ {
+ return new ReadableSerialOrdered(list, iterator, sortMethod, callback);
+ }
+
+ // turn on object mode
+ ReadableSerialOrdered.super_.call(this, {objectMode: true});
+
+ this._start(serialOrdered, list, iterator, sortMethod, callback);
+}
diff --git a/Nodejs/node_modules/asynckit/lib/state.js b/Nodejs/node_modules/asynckit/lib/state.js
new file mode 100644
index 0000000..cbea7ad
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/state.js
@@ -0,0 +1,37 @@
+// API
+module.exports = state;
+
+/**
+ * Creates initial state object
+ * for iteration over list
+ *
+ * @param {array|object} list - list to iterate over
+ * @param {function|null} sortMethod - function to use for keys sort,
+ * or `null` to keep them as is
+ * @returns {object} - initial state object
+ */
+function state(list, sortMethod)
+{
+ var isNamedList = !Array.isArray(list)
+ , initState =
+ {
+ index : 0,
+ keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
+ jobs : {},
+ results : isNamedList ? {} : [],
+ size : isNamedList ? Object.keys(list).length : list.length
+ }
+ ;
+
+ if (sortMethod)
+ {
+ // sort array keys based on it's values
+ // sort object's keys just on own merit
+ initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
+ {
+ return sortMethod(list[a], list[b]);
+ });
+ }
+
+ return initState;
+}
diff --git a/Nodejs/node_modules/asynckit/lib/streamify.js b/Nodejs/node_modules/asynckit/lib/streamify.js
new file mode 100644
index 0000000..f56a1c9
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/streamify.js
@@ -0,0 +1,141 @@
+var async = require('./async.js');
+
+// API
+module.exports = {
+ iterator: wrapIterator,
+ callback: wrapCallback
+};
+
+/**
+ * Wraps iterators with long signature
+ *
+ * @this ReadableAsyncKit#
+ * @param {function} iterator - function to wrap
+ * @returns {function} - wrapped function
+ */
+function wrapIterator(iterator)
+{
+ var stream = this;
+
+ return function(item, key, cb)
+ {
+ var aborter
+ , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key))
+ ;
+
+ stream.jobs[key] = wrappedCb;
+
+ // it's either shortcut (item, cb)
+ if (iterator.length == 2)
+ {
+ aborter = iterator(item, wrappedCb);
+ }
+ // or long format (item, key, cb)
+ else
+ {
+ aborter = iterator(item, key, wrappedCb);
+ }
+
+ return aborter;
+ };
+}
+
+/**
+ * Wraps provided callback function
+ * allowing to execute snitch function before
+ * real callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {function} callback - function to wrap
+ * @returns {function} - wrapped function
+ */
+function wrapCallback(callback)
+{
+ var stream = this;
+
+ var wrapped = function(error, result)
+ {
+ return finisher.call(stream, error, result, callback);
+ };
+
+ return wrapped;
+}
+
+/**
+ * Wraps provided iterator callback function
+ * makes sure snitch only called once,
+ * but passes secondary calls to the original callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {function} callback - callback to wrap
+ * @param {number|string} key - iteration key
+ * @returns {function} wrapped callback
+ */
+function wrapIteratorCallback(callback, key)
+{
+ var stream = this;
+
+ return function(error, output)
+ {
+ // don't repeat yourself
+ if (!(key in stream.jobs))
+ {
+ callback(error, output);
+ return;
+ }
+
+ // clean up jobs
+ delete stream.jobs[key];
+
+ return streamer.call(stream, error, {key: key, value: output}, callback);
+ };
+}
+
+/**
+ * Stream wrapper for iterator callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {mixed} error - error response
+ * @param {mixed} output - iterator output
+ * @param {function} callback - callback that expects iterator results
+ */
+function streamer(error, output, callback)
+{
+ if (error && !this.error)
+ {
+ this.error = error;
+ this.pause();
+ this.emit('error', error);
+ // send back value only, as expected
+ callback(error, output && output.value);
+ return;
+ }
+
+ // stream stuff
+ this.push(output);
+
+ // back to original track
+ // send back value only, as expected
+ callback(error, output && output.value);
+}
+
+/**
+ * Stream wrapper for finishing callback
+ *
+ * @this ReadableAsyncKit#
+ * @param {mixed} error - error response
+ * @param {mixed} output - iterator output
+ * @param {function} callback - callback that expects final results
+ */
+function finisher(error, output, callback)
+{
+ // signal end of the stream
+ // only for successfully finished streams
+ if (!error)
+ {
+ this.push(null);
+ }
+
+ // back to original track
+ callback(error, output);
+}
diff --git a/Nodejs/node_modules/asynckit/lib/terminator.js b/Nodejs/node_modules/asynckit/lib/terminator.js
new file mode 100644
index 0000000..d6eb992
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/lib/terminator.js
@@ -0,0 +1,29 @@
+var abort = require('./abort.js')
+ , async = require('./async.js')
+ ;
+
+// API
+module.exports = terminator;
+
+/**
+ * Terminates jobs in the attached state context
+ *
+ * @this AsyncKitState#
+ * @param {function} callback - final callback to invoke after termination
+ */
+function terminator(callback)
+{
+ if (!Object.keys(this.jobs).length)
+ {
+ return;
+ }
+
+ // fast forward iteration index
+ this.index = this.size;
+
+ // abort jobs
+ abort(this);
+
+ // send back results we have so far
+ async(callback)(null, this.results);
+}
diff --git a/Nodejs/node_modules/asynckit/package.json b/Nodejs/node_modules/asynckit/package.json
new file mode 100644
index 0000000..b067e2b
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/package.json
@@ -0,0 +1,91 @@
+{
+ "_from": "asynckit@^0.4.0",
+ "_id": "asynckit@0.4.0",
+ "_inBundle": false,
+ "_integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
+ "_location": "/asynckit",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "asynckit@^0.4.0",
+ "name": "asynckit",
+ "escapedName": "asynckit",
+ "rawSpec": "^0.4.0",
+ "saveSpec": null,
+ "fetchSpec": "^0.4.0"
+ },
+ "_requiredBy": [
+ "/form-data"
+ ],
+ "_resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+ "_shasum": "c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79",
+ "_spec": "asynckit@^0.4.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/form-data",
+ "author": {
+ "name": "Alex Indigo",
+ "email": "iam@alexindigo.com"
+ },
+ "bugs": {
+ "url": "https://github.com/alexindigo/asynckit/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Minimal async jobs utility library, with streams support",
+ "devDependencies": {
+ "browserify": "^13.0.0",
+ "browserify-istanbul": "^2.0.0",
+ "coveralls": "^2.11.9",
+ "eslint": "^2.9.0",
+ "istanbul": "^0.4.3",
+ "obake": "^0.1.2",
+ "phantomjs-prebuilt": "^2.1.7",
+ "pre-commit": "^1.1.3",
+ "reamde": "^1.1.0",
+ "rimraf": "^2.5.2",
+ "size-table": "^0.2.0",
+ "tap-spec": "^4.1.1",
+ "tape": "^4.5.1"
+ },
+ "homepage": "https://github.com/alexindigo/asynckit#readme",
+ "keywords": [
+ "async",
+ "jobs",
+ "parallel",
+ "serial",
+ "iterator",
+ "array",
+ "object",
+ "stream",
+ "destroy",
+ "terminate",
+ "abort"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "asynckit",
+ "pre-commit": [
+ "clean",
+ "lint",
+ "test",
+ "browser",
+ "report",
+ "size"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/alexindigo/asynckit.git"
+ },
+ "scripts": {
+ "browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec",
+ "clean": "rimraf coverage",
+ "debug": "tape test/test-*.js",
+ "lint": "eslint *.js lib/*.js test/*.js",
+ "report": "istanbul report",
+ "size": "browserify index.js | size-table asynckit",
+ "test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec",
+ "win-test": "tape test/test-*.js"
+ },
+ "version": "0.4.0"
+}
diff --git a/Nodejs/node_modules/asynckit/parallel.js b/Nodejs/node_modules/asynckit/parallel.js
new file mode 100644
index 0000000..3c50344
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/parallel.js
@@ -0,0 +1,43 @@
+var iterate = require('./lib/iterate.js')
+ , initState = require('./lib/state.js')
+ , terminator = require('./lib/terminator.js')
+ ;
+
+// Public API
+module.exports = parallel;
+
+/**
+ * Runs iterator over provided array elements in parallel
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function parallel(list, iterator, callback)
+{
+ var state = initState(list);
+
+ while (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, function(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ // looks like it's the last one
+ if (Object.keys(state.jobs).length === 0)
+ {
+ callback(null, state.results);
+ return;
+ }
+ });
+
+ state.index++;
+ }
+
+ return terminator.bind(state, callback);
+}
diff --git a/Nodejs/node_modules/asynckit/serial.js b/Nodejs/node_modules/asynckit/serial.js
new file mode 100644
index 0000000..6cd949a
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/serial.js
@@ -0,0 +1,17 @@
+var serialOrdered = require('./serialOrdered.js');
+
+// Public API
+module.exports = serial;
+
+/**
+ * Runs iterator over provided array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serial(list, iterator, callback)
+{
+ return serialOrdered(list, iterator, null, callback);
+}
diff --git a/Nodejs/node_modules/asynckit/serialOrdered.js b/Nodejs/node_modules/asynckit/serialOrdered.js
new file mode 100644
index 0000000..607eafe
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/serialOrdered.js
@@ -0,0 +1,75 @@
+var iterate = require('./lib/iterate.js')
+ , initState = require('./lib/state.js')
+ , terminator = require('./lib/terminator.js')
+ ;
+
+// Public API
+module.exports = serialOrdered;
+// sorting helpers
+module.exports.ascending = ascending;
+module.exports.descending = descending;
+
+/**
+ * Runs iterator over provided sorted array elements in series
+ *
+ * @param {array|object} list - array or object (named list) to iterate over
+ * @param {function} iterator - iterator to run
+ * @param {function} sortMethod - custom sort function
+ * @param {function} callback - invoked when all elements processed
+ * @returns {function} - jobs terminator
+ */
+function serialOrdered(list, iterator, sortMethod, callback)
+{
+ var state = initState(list, sortMethod);
+
+ iterate(list, iterator, state, function iteratorHandler(error, result)
+ {
+ if (error)
+ {
+ callback(error, result);
+ return;
+ }
+
+ state.index++;
+
+ // are we there yet?
+ if (state.index < (state['keyedList'] || list).length)
+ {
+ iterate(list, iterator, state, iteratorHandler);
+ return;
+ }
+
+ // done here
+ callback(null, state.results);
+ });
+
+ return terminator.bind(state, callback);
+}
+
+/*
+ * -- Sort methods
+ */
+
+/**
+ * sort helper to sort array elements in ascending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function ascending(a, b)
+{
+ return a < b ? -1 : a > b ? 1 : 0;
+}
+
+/**
+ * sort helper to sort array elements in descending order
+ *
+ * @param {mixed} a - an item to compare
+ * @param {mixed} b - an item to compare
+ * @returns {number} - comparison result
+ */
+function descending(a, b)
+{
+ return -1 * ascending(a, b);
+}
diff --git a/Nodejs/node_modules/asynckit/stream.js b/Nodejs/node_modules/asynckit/stream.js
new file mode 100644
index 0000000..d43465f
--- /dev/null
+++ b/Nodejs/node_modules/asynckit/stream.js
@@ -0,0 +1,21 @@
+var inherits = require('util').inherits
+ , Readable = require('stream').Readable
+ , ReadableAsyncKit = require('./lib/readable_asynckit.js')
+ , ReadableParallel = require('./lib/readable_parallel.js')
+ , ReadableSerial = require('./lib/readable_serial.js')
+ , ReadableSerialOrdered = require('./lib/readable_serial_ordered.js')
+ ;
+
+// API
+module.exports =
+{
+ parallel : ReadableParallel,
+ serial : ReadableSerial,
+ serialOrdered : ReadableSerialOrdered,
+};
+
+inherits(ReadableAsyncKit, Readable);
+
+inherits(ReadableParallel, ReadableAsyncKit);
+inherits(ReadableSerial, ReadableAsyncKit);
+inherits(ReadableSerialOrdered, ReadableAsyncKit);
diff --git a/Nodejs/node_modules/aws-sign2/LICENSE b/Nodejs/node_modules/aws-sign2/LICENSE
new file mode 100644
index 0000000..a4a9aee
--- /dev/null
+++ b/Nodejs/node_modules/aws-sign2/LICENSE
@@ -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
\ No newline at end of file
diff --git a/Nodejs/node_modules/aws-sign2/README.md b/Nodejs/node_modules/aws-sign2/README.md
new file mode 100644
index 0000000..763564e
--- /dev/null
+++ b/Nodejs/node_modules/aws-sign2/README.md
@@ -0,0 +1,4 @@
+aws-sign
+========
+
+AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.
diff --git a/Nodejs/node_modules/aws-sign2/index.js b/Nodejs/node_modules/aws-sign2/index.js
new file mode 100644
index 0000000..fb35f6d
--- /dev/null
+++ b/Nodejs/node_modules/aws-sign2/index.js
@@ -0,0 +1,212 @@
+
+/*!
+ * Copyright 2010 LearnBoost
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var crypto = require('crypto')
+ , parse = require('url').parse
+ ;
+
+/**
+ * Valid keys.
+ */
+
+var keys =
+ [ 'acl'
+ , 'location'
+ , 'logging'
+ , 'notification'
+ , 'partNumber'
+ , 'policy'
+ , 'requestPayment'
+ , 'torrent'
+ , 'uploadId'
+ , 'uploads'
+ , 'versionId'
+ , 'versioning'
+ , 'versions'
+ , 'website'
+ ]
+
+/**
+ * Return an "Authorization" header value with the given `options`
+ * in the form of "AWS :"
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function authorization (options) {
+ return 'AWS ' + options.key + ':' + sign(options)
+}
+
+module.exports = authorization
+module.exports.authorization = authorization
+
+/**
+ * Simple HMAC-SHA1 Wrapper
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function hmacSha1 (options) {
+ return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')
+}
+
+module.exports.hmacSha1 = hmacSha1
+
+/**
+ * Create a base64 sha1 HMAC for `options`.
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function sign (options) {
+ options.message = stringToSign(options)
+ return hmacSha1(options)
+}
+module.exports.sign = sign
+
+/**
+ * Create a base64 sha1 HMAC for `options`.
+ *
+ * Specifically to be used with S3 presigned URLs
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function signQuery (options) {
+ options.message = queryStringToSign(options)
+ return hmacSha1(options)
+}
+module.exports.signQuery= signQuery
+
+/**
+ * Return a string for sign() with the given `options`.
+ *
+ * Spec:
+ *
+ * \n
+ * \n
+ * \n
+ * \n
+ * [headers\n]
+ *
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function stringToSign (options) {
+ var headers = options.amazonHeaders || ''
+ if (headers) headers += '\n'
+ var r =
+ [ options.verb
+ , options.md5
+ , options.contentType
+ , options.date ? options.date.toUTCString() : ''
+ , headers + options.resource
+ ]
+ return r.join('\n')
+}
+module.exports.stringToSign = stringToSign
+
+/**
+ * Return a string for sign() with the given `options`, but is meant exclusively
+ * for S3 presigned URLs
+ *
+ * Spec:
+ *
+ * \n
+ *
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function queryStringToSign (options){
+ return 'GET\n\n\n' + options.date + '\n' + options.resource
+}
+module.exports.queryStringToSign = queryStringToSign
+
+/**
+ * Perform the following:
+ *
+ * - ignore non-amazon headers
+ * - lowercase fields
+ * - sort lexicographically
+ * - trim whitespace between ":"
+ * - join with newline
+ *
+ * @param {Object} headers
+ * @return {String}
+ * @api private
+ */
+
+function canonicalizeHeaders (headers) {
+ var buf = []
+ , fields = Object.keys(headers)
+ ;
+ for (var i = 0, len = fields.length; i < len; ++i) {
+ var field = fields[i]
+ , val = headers[field]
+ , field = field.toLowerCase()
+ ;
+ if (0 !== field.indexOf('x-amz')) continue
+ buf.push(field + ':' + val)
+ }
+ return buf.sort().join('\n')
+}
+module.exports.canonicalizeHeaders = canonicalizeHeaders
+
+/**
+ * Perform the following:
+ *
+ * - ignore non sub-resources
+ * - sort lexicographically
+ *
+ * @param {String} resource
+ * @return {String}
+ * @api private
+ */
+
+function canonicalizeResource (resource) {
+ var url = parse(resource, true)
+ , path = url.pathname
+ , buf = []
+ ;
+
+ Object.keys(url.query).forEach(function(key){
+ if (!~keys.indexOf(key)) return
+ var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])
+ buf.push(key + val)
+ })
+
+ return path + (buf.length ? '?' + buf.sort().join('&') : '')
+}
+module.exports.canonicalizeResource = canonicalizeResource
diff --git a/Nodejs/node_modules/aws-sign2/package.json b/Nodejs/node_modules/aws-sign2/package.json
new file mode 100644
index 0000000..336ff00
--- /dev/null
+++ b/Nodejs/node_modules/aws-sign2/package.json
@@ -0,0 +1,50 @@
+{
+ "_from": "aws-sign2@~0.7.0",
+ "_id": "aws-sign2@0.7.0",
+ "_inBundle": false,
+ "_integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
+ "_location": "/aws-sign2",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "aws-sign2@~0.7.0",
+ "name": "aws-sign2",
+ "escapedName": "aws-sign2",
+ "rawSpec": "~0.7.0",
+ "saveSpec": null,
+ "fetchSpec": "~0.7.0"
+ },
+ "_requiredBy": [
+ "/request"
+ ],
+ "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
+ "_shasum": "b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8",
+ "_spec": "aws-sign2@~0.7.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/request",
+ "author": {
+ "name": "Mikeal Rogers",
+ "email": "mikeal.rogers@gmail.com",
+ "url": "http://www.futurealoof.com"
+ },
+ "bugs": {
+ "url": "https://github.com/mikeal/aws-sign/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.",
+ "devDependencies": {},
+ "engines": {
+ "node": "*"
+ },
+ "homepage": "https://github.com/mikeal/aws-sign#readme",
+ "license": "Apache-2.0",
+ "main": "index.js",
+ "name": "aws-sign2",
+ "optionalDependencies": {},
+ "repository": {
+ "url": "git+https://github.com/mikeal/aws-sign.git"
+ },
+ "version": "0.7.0"
+}
diff --git a/Nodejs/node_modules/aws4/.travis.yml b/Nodejs/node_modules/aws4/.travis.yml
new file mode 100644
index 0000000..178bf31
--- /dev/null
+++ b/Nodejs/node_modules/aws4/.travis.yml
@@ -0,0 +1,9 @@
+language: node_js
+node_js:
+ - "0.10"
+ - "0.12"
+ - "4"
+ - "6"
+ - "8"
+ - "10"
+ - "12"
diff --git a/Nodejs/node_modules/aws4/LICENSE b/Nodejs/node_modules/aws4/LICENSE
new file mode 100644
index 0000000..4f321e5
--- /dev/null
+++ b/Nodejs/node_modules/aws4/LICENSE
@@ -0,0 +1,19 @@
+Copyright 2013 Michael Hart (michael.hart.au@gmail.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Nodejs/node_modules/aws4/README.md b/Nodejs/node_modules/aws4/README.md
new file mode 100644
index 0000000..1e9d61b
--- /dev/null
+++ b/Nodejs/node_modules/aws4/README.md
@@ -0,0 +1,523 @@
+aws4
+----
+
+[](http://travis-ci.org/mhart/aws4)
+
+A small utility to sign vanilla Node.js http(s) request options using Amazon's
+[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).
+
+If you want to sign and send AWS requests in a modern browser, or an environment like [Cloudflare Workers](https://developers.cloudflare.com/workers/), then check out [aws4fetch](https://github.com/mhart/aws4fetch) – otherwise you can also bundle this library for use [in the browser](./browser).
+
+This signature is supported by nearly all Amazon services, including
+[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),
+[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
+[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html),
+[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/),
+[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html),
+[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/),
+[SNS](http://docs.aws.amazon.com/sns/latest/api/),
+[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/),
+[STS](http://docs.aws.amazon.com/STS/latest/APIReference/),
+[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/),
+[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/),
+[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/),
+[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/),
+[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/),
+[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/),
+[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/),
+[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/),
+[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html),
+[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html),
+[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/),
+[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html),
+[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/),
+[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/),
+[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html),
+[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/),
+[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/),
+[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/),
+[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/),
+[SES](http://docs.aws.amazon.com/ses/latest/APIReference/),
+[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/),
+[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/),
+[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html),
+[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/),
+[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/),
+[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/),
+[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html),
+[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/),
+[Config](http://docs.aws.amazon.com/config/latest/APIReference/),
+[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html),
+[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and
+[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html).
+
+Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are
+[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and
+[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html)
+(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)).
+
+It also provides defaults for a number of core AWS headers and
+request parameters, making it very easy to query AWS services, or
+build out a fully-featured AWS library.
+
+Example
+-------
+
+```javascript
+var http = require('http'),
+ https = require('https'),
+ aws4 = require('aws4')
+
+// given an options object you could pass to http.request
+var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
+
+// alternatively (as aws4 can infer the host):
+opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
+
+// alternatively (as us-east-1 is default):
+opts = {service: 'sqs', path: '/?Action=ListQueues'}
+
+aws4.sign(opts) // assumes AWS credentials are available in process.env
+
+console.log(opts)
+/*
+{
+ host: 'sqs.us-east-1.amazonaws.com',
+ path: '/?Action=ListQueues',
+ headers: {
+ Host: 'sqs.us-east-1.amazonaws.com',
+ 'X-Amz-Date': '20121226T061030Z',
+ Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
+ }
+}
+*/
+
+// we can now use this to query AWS using the standard node.js http API
+http.request(opts, function(res) { res.pipe(process.stdout) }).end()
+/*
+
+
+...
+*/
+```
+
+More options
+------------
+
+```javascript
+// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
+aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
+
+// can also add the signature to query strings
+aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
+
+// create a utility function to pipe to stdout (with https this time)
+function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
+
+// aws4 can infer the HTTP method if a body is passed in
+// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
+request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
+/*
+
+...
+*/
+
+// can specify any custom option or header as per usual
+request(aws4.sign({
+ service: 'dynamodb',
+ region: 'ap-southeast-2',
+ method: 'POST',
+ path: '/',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.0',
+ 'X-Amz-Target': 'DynamoDB_20120810.ListTables'
+ },
+ body: '{}'
+}))
+/*
+{"TableNames":[]}
+...
+*/
+
+// works with all other services that support Signature Version 4
+
+request(aws4.sign({service: 's3', path: '/', signQuery: true}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'appstream', path: '/applications'}))
+/*
+{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
+...
+*/
+
+request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
+/*
+{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
+...
+*/
+
+request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
+/*
+{"NextPageToken":null,"Pipelines":[]}
+...
+*/
+
+request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
+/*
+{"Functions":[],"NextMarker":null}
+...
+*/
+
+request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
+/*
+
+...
+*/
+
+request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
+/*
+{"Marker":null,"VaultList":[]}
+...
+*/
+
+request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
+}}))
+/*
+{"Gateways":[]}
+...
+*/
+
+request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'DataPipeline.ListPipelines'
+}}))
+/*
+{"hasMoreResults":false,"pipelineIdList":[]}
+...
+*/
+
+request(aws4.sign({service: 'opsworks', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
+}}))
+/*
+{"Stacks":[]}
+...
+*/
+
+request(aws4.sign({service: 'route53domains', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
+}}))
+/*
+{"Domains":[]}
+...
+*/
+
+request(aws4.sign({service: 'kinesis', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Kinesis_20131202.ListStreams'
+}}))
+/*
+{"HasMoreStreams":false,"StreamNames":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
+}}))
+/*
+{"trailList":[]}
+...
+*/
+
+request(aws4.sign({service: 'logs', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
+}}))
+/*
+{"logGroups":[]}
+...
+*/
+
+request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
+}}))
+/*
+{"applications":[]}
+...
+*/
+
+request(aws4.sign({service: 'directconnect', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'OvertureService.DescribeConnections'
+}}))
+/*
+{"connections":[]}
+...
+*/
+
+request(aws4.sign({service: 'kms', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'TrentService.ListKeys'
+}}))
+/*
+{"Keys":[],"Truncated":false}
+...
+*/
+
+request(aws4.sign({service: 'config', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
+}}))
+/*
+{"DeliveryChannels":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
+}}))
+/*
+{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
+...
+*/
+
+request(aws4.sign({
+ service: 'swf',
+ body: '{"registrationStatus":"REGISTERED"}',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.0',
+ 'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
+ }
+}))
+/*
+{"domainInfos":[]}
+...
+*/
+
+request(aws4.sign({
+ service: 'cognito-identity',
+ body: '{"MaxResults": 1}',
+ headers: {
+ 'Content-Type': 'application/x-amz-json-1.1',
+ 'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
+ }
+}))
+/*
+{"IdentityPools":[]}
+...
+*/
+
+request(aws4.sign({
+ service: 'mobileanalytics',
+ path: '/2014-06-05/events',
+ body: JSON.stringify({events:[{
+ eventType: 'a',
+ timestamp: new Date().toISOString(),
+ session: {},
+ }]}),
+ headers: {
+ 'Content-Type': 'application/json',
+ 'X-Amz-Client-Context': JSON.stringify({
+ client: {client_id: 'a', app_title: 'a'},
+ custom: {},
+ env: {platform: 'a'},
+ services: {},
+ }),
+ }
+}))
+/*
+(HTTP 202, empty response)
+*/
+
+// Generate CodeCommit Git access password
+var signer = new aws4.RequestSigner({
+ service: 'codecommit',
+ host: 'git-codecommit.us-east-1.amazonaws.com',
+ method: 'GIT',
+ path: '/v1/repos/MyAwesomeRepo',
+})
+var password = signer.getDateTime() + 'Z' + signer.signature()
+```
+
+API
+---
+
+### aws4.sign(requestOptions, [credentials])
+
+This calculates and populates the `Authorization` header of
+`requestOptions`, and any other necessary AWS headers and/or request
+options. Returns `requestOptions` as a convenience for chaining.
+
+`requestOptions` is an object holding the same options that the node.js
+[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback)
+function takes.
+
+The following properties of `requestOptions` are used in the signing or
+populated if they don't already exist:
+
+- `hostname` or `host` (will be determined from `service` and `region` if not given)
+- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`)
+- `path` (will use `'/'` if not given)
+- `body` (will use `''` if not given)
+- `service` (will be calculated from `hostname` or `host` if not given)
+- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given)
+- `headers['Host']` (will use `hostname` or `host` or be calculated if not given)
+- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'`
+ if not given and there is a `body`)
+- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used)
+
+Your AWS credentials (which can be found in your
+[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials))
+can be specified in one of two ways:
+
+- As the second argument, like this:
+
+```javascript
+aws4.sign(requestOptions, {
+ secretAccessKey: "",
+ accessKeyId: "",
+ sessionToken: ""
+})
+```
+
+- From `process.env`, such as this:
+
+```
+export AWS_SECRET_ACCESS_KEY=""
+export AWS_ACCESS_KEY_ID=""
+export AWS_SESSION_TOKEN=""
+```
+
+(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available)
+
+The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing
+with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html).
+
+Installation
+------------
+
+With [npm](http://npmjs.org/) do:
+
+```
+npm install aws4
+```
+
+Can also be used [in the browser](./browser).
+
+Thanks
+------
+
+Thanks to [@jed](https://github.com/jed) for his
+[dynamo-client](https://github.com/jed/dynamo-client) lib where I first
+committed and subsequently extracted this code.
+
+Also thanks to the
+[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving
+me a start on implementing the v4 signature.
+
diff --git a/Nodejs/node_modules/aws4/aws4.js b/Nodejs/node_modules/aws4/aws4.js
new file mode 100644
index 0000000..9014894
--- /dev/null
+++ b/Nodejs/node_modules/aws4/aws4.js
@@ -0,0 +1,345 @@
+var aws4 = exports,
+ url = require('url'),
+ querystring = require('querystring'),
+ crypto = require('crypto'),
+ lru = require('./lru'),
+ credentialsCache = lru(1000)
+
+// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html
+
+function hmac(key, string, encoding) {
+ return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)
+}
+
+function hash(string, encoding) {
+ return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)
+}
+
+// This function assumes the string has already been percent encoded
+function encodeRfc3986(urlEncodedString) {
+ return urlEncodedString.replace(/[!'()*]/g, function(c) {
+ return '%' + c.charCodeAt(0).toString(16).toUpperCase()
+ })
+}
+
+function encodeRfc3986Full(str) {
+ return encodeRfc3986(encodeURIComponent(str))
+}
+
+// request: { path | body, [host], [method], [headers], [service], [region] }
+// credentials: { accessKeyId, secretAccessKey, [sessionToken] }
+function RequestSigner(request, credentials) {
+
+ if (typeof request === 'string') request = url.parse(request)
+
+ var headers = request.headers = (request.headers || {}),
+ hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)
+
+ this.request = request
+ this.credentials = credentials || this.defaultCredentials()
+
+ this.service = request.service || hostParts[0] || ''
+ this.region = request.region || hostParts[1] || 'us-east-1'
+
+ // SES uses a different domain from the service name
+ if (this.service === 'email') this.service = 'ses'
+
+ if (!request.method && request.body)
+ request.method = 'POST'
+
+ if (!headers.Host && !headers.host) {
+ headers.Host = request.hostname || request.host || this.createHost()
+
+ // If a port is specified explicitly, use it as is
+ if (request.port)
+ headers.Host += ':' + request.port
+ }
+ if (!request.hostname && !request.host)
+ request.hostname = headers.Host || headers.host
+
+ this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT'
+}
+
+RequestSigner.prototype.matchHost = function(host) {
+ var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com(\.cn)?$/)
+ var hostParts = (match || []).slice(1, 3)
+
+ // ES's hostParts are sometimes the other way round, if the value that is expected
+ // to be region equals ‘es’ switch them back
+ // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com
+ if (hostParts[1] === 'es')
+ hostParts = hostParts.reverse()
+
+ return hostParts
+}
+
+// http://docs.aws.amazon.com/general/latest/gr/rande.html
+RequestSigner.prototype.isSingleRegion = function() {
+ // Special case for S3 and SimpleDB in us-east-1
+ if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true
+
+ return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']
+ .indexOf(this.service) >= 0
+}
+
+RequestSigner.prototype.createHost = function() {
+ var region = this.isSingleRegion() ? '' :
+ (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region,
+ service = this.service === 'ses' ? 'email' : this.service
+ return service + region + '.amazonaws.com'
+}
+
+RequestSigner.prototype.prepareRequest = function() {
+ this.parsePath()
+
+ var request = this.request, headers = request.headers, query
+
+ if (request.signQuery) {
+
+ this.parsedPath.query = query = this.parsedPath.query || {}
+
+ if (this.credentials.sessionToken)
+ query['X-Amz-Security-Token'] = this.credentials.sessionToken
+
+ if (this.service === 's3' && !query['X-Amz-Expires'])
+ query['X-Amz-Expires'] = 86400
+
+ if (query['X-Amz-Date'])
+ this.datetime = query['X-Amz-Date']
+ else
+ query['X-Amz-Date'] = this.getDateTime()
+
+ query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'
+ query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()
+ query['X-Amz-SignedHeaders'] = this.signedHeaders()
+
+ } else {
+
+ if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {
+ if (request.body && !headers['Content-Type'] && !headers['content-type'])
+ headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'
+
+ if (request.body && !headers['Content-Length'] && !headers['content-length'])
+ headers['Content-Length'] = Buffer.byteLength(request.body)
+
+ if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token'])
+ headers['X-Amz-Security-Token'] = this.credentials.sessionToken
+
+ if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256'])
+ headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')
+
+ if (headers['X-Amz-Date'] || headers['x-amz-date'])
+ this.datetime = headers['X-Amz-Date'] || headers['x-amz-date']
+ else
+ headers['X-Amz-Date'] = this.getDateTime()
+ }
+
+ delete headers.Authorization
+ delete headers.authorization
+ }
+}
+
+RequestSigner.prototype.sign = function() {
+ if (!this.parsedPath) this.prepareRequest()
+
+ if (this.request.signQuery) {
+ this.parsedPath.query['X-Amz-Signature'] = this.signature()
+ } else {
+ this.request.headers.Authorization = this.authHeader()
+ }
+
+ this.request.path = this.formatPath()
+
+ return this.request
+}
+
+RequestSigner.prototype.getDateTime = function() {
+ if (!this.datetime) {
+ var headers = this.request.headers,
+ date = new Date(headers.Date || headers.date || new Date)
+
+ this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '')
+
+ // Remove the trailing 'Z' on the timestamp string for CodeCommit git access
+ if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1)
+ }
+ return this.datetime
+}
+
+RequestSigner.prototype.getDate = function() {
+ return this.getDateTime().substr(0, 8)
+}
+
+RequestSigner.prototype.authHeader = function() {
+ return [
+ 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),
+ 'SignedHeaders=' + this.signedHeaders(),
+ 'Signature=' + this.signature(),
+ ].join(', ')
+}
+
+RequestSigner.prototype.signature = function() {
+ var date = this.getDate(),
+ cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),
+ kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)
+ if (!kCredentials) {
+ kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)
+ kRegion = hmac(kDate, this.region)
+ kService = hmac(kRegion, this.service)
+ kCredentials = hmac(kService, 'aws4_request')
+ credentialsCache.set(cacheKey, kCredentials)
+ }
+ return hmac(kCredentials, this.stringToSign(), 'hex')
+}
+
+RequestSigner.prototype.stringToSign = function() {
+ return [
+ 'AWS4-HMAC-SHA256',
+ this.getDateTime(),
+ this.credentialString(),
+ hash(this.canonicalString(), 'hex'),
+ ].join('\n')
+}
+
+RequestSigner.prototype.canonicalString = function() {
+ if (!this.parsedPath) this.prepareRequest()
+
+ var pathStr = this.parsedPath.path,
+ query = this.parsedPath.query,
+ headers = this.request.headers,
+ queryStr = '',
+ normalizePath = this.service !== 's3',
+ decodePath = this.service === 's3' || this.request.doNotEncodePath,
+ decodeSlashesInPath = this.service === 's3',
+ firstValOnly = this.service === 's3',
+ bodyHash
+
+ if (this.service === 's3' && this.request.signQuery) {
+ bodyHash = 'UNSIGNED-PAYLOAD'
+ } else if (this.isCodeCommitGit) {
+ bodyHash = ''
+ } else {
+ bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] ||
+ hash(this.request.body || '', 'hex')
+ }
+
+ if (query) {
+ var reducedQuery = Object.keys(query).reduce(function(obj, key) {
+ if (!key) return obj
+ obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] :
+ (firstValOnly ? query[key][0] : query[key])
+ return obj
+ }, {})
+ var encodedQueryPieces = []
+ Object.keys(reducedQuery).sort().forEach(function(key) {
+ if (!Array.isArray(reducedQuery[key])) {
+ encodedQueryPieces.push(key + '=' + encodeRfc3986Full(reducedQuery[key]))
+ } else {
+ reducedQuery[key].map(encodeRfc3986Full).sort()
+ .forEach(function(val) { encodedQueryPieces.push(key + '=' + val) })
+ }
+ })
+ queryStr = encodedQueryPieces.join('&')
+ }
+ if (pathStr !== '/') {
+ if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
+ pathStr = pathStr.split('/').reduce(function(path, piece) {
+ if (normalizePath && piece === '..') {
+ path.pop()
+ } else if (!normalizePath || piece !== '.') {
+ if (decodePath) piece = decodeURIComponent(piece).replace(/\+/g, ' ')
+ path.push(encodeRfc3986Full(piece))
+ }
+ return path
+ }, []).join('/')
+ if (pathStr[0] !== '/') pathStr = '/' + pathStr
+ if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
+ }
+
+ return [
+ this.request.method || 'GET',
+ pathStr,
+ queryStr,
+ this.canonicalHeaders() + '\n',
+ this.signedHeaders(),
+ bodyHash,
+ ].join('\n')
+}
+
+RequestSigner.prototype.canonicalHeaders = function() {
+ var headers = this.request.headers
+ function trimAll(header) {
+ return header.toString().trim().replace(/\s+/g, ' ')
+ }
+ return Object.keys(headers)
+ .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })
+ .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })
+ .join('\n')
+}
+
+RequestSigner.prototype.signedHeaders = function() {
+ return Object.keys(this.request.headers)
+ .map(function(key) { return key.toLowerCase() })
+ .sort()
+ .join(';')
+}
+
+RequestSigner.prototype.credentialString = function() {
+ return [
+ this.getDate(),
+ this.region,
+ this.service,
+ 'aws4_request',
+ ].join('/')
+}
+
+RequestSigner.prototype.defaultCredentials = function() {
+ var env = process.env
+ return {
+ accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,
+ secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,
+ sessionToken: env.AWS_SESSION_TOKEN,
+ }
+}
+
+RequestSigner.prototype.parsePath = function() {
+ var path = this.request.path || '/'
+
+ // S3 doesn't always encode characters > 127 correctly and
+ // all services don't encode characters > 255 correctly
+ // So if there are non-reserved chars (and it's not already all % encoded), just encode them all
+ if (/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(path)) {
+ path = encodeURI(decodeURI(path))
+ }
+
+ var queryIx = path.indexOf('?'),
+ query = null
+
+ if (queryIx >= 0) {
+ query = querystring.parse(path.slice(queryIx + 1))
+ path = path.slice(0, queryIx)
+ }
+
+ this.parsedPath = {
+ path: path,
+ query: query,
+ }
+}
+
+RequestSigner.prototype.formatPath = function() {
+ var path = this.parsedPath.path,
+ query = this.parsedPath.query
+
+ if (!query) return path
+
+ // Services don't support empty query string keys
+ if (query[''] != null) delete query['']
+
+ return path + '?' + encodeRfc3986(querystring.stringify(query))
+}
+
+aws4.RequestSigner = RequestSigner
+
+aws4.sign = function(request, credentials) {
+ return new RequestSigner(request, credentials).sign()
+}
diff --git a/Nodejs/node_modules/aws4/lru.js b/Nodejs/node_modules/aws4/lru.js
new file mode 100644
index 0000000..333f66a
--- /dev/null
+++ b/Nodejs/node_modules/aws4/lru.js
@@ -0,0 +1,96 @@
+module.exports = function(size) {
+ return new LruCache(size)
+}
+
+function LruCache(size) {
+ this.capacity = size | 0
+ this.map = Object.create(null)
+ this.list = new DoublyLinkedList()
+}
+
+LruCache.prototype.get = function(key) {
+ var node = this.map[key]
+ if (node == null) return undefined
+ this.used(node)
+ return node.val
+}
+
+LruCache.prototype.set = function(key, val) {
+ var node = this.map[key]
+ if (node != null) {
+ node.val = val
+ } else {
+ if (!this.capacity) this.prune()
+ if (!this.capacity) return false
+ node = new DoublyLinkedNode(key, val)
+ this.map[key] = node
+ this.capacity--
+ }
+ this.used(node)
+ return true
+}
+
+LruCache.prototype.used = function(node) {
+ this.list.moveToFront(node)
+}
+
+LruCache.prototype.prune = function() {
+ var node = this.list.pop()
+ if (node != null) {
+ delete this.map[node.key]
+ this.capacity++
+ }
+}
+
+
+function DoublyLinkedList() {
+ this.firstNode = null
+ this.lastNode = null
+}
+
+DoublyLinkedList.prototype.moveToFront = function(node) {
+ if (this.firstNode == node) return
+
+ this.remove(node)
+
+ if (this.firstNode == null) {
+ this.firstNode = node
+ this.lastNode = node
+ node.prev = null
+ node.next = null
+ } else {
+ node.prev = null
+ node.next = this.firstNode
+ node.next.prev = node
+ this.firstNode = node
+ }
+}
+
+DoublyLinkedList.prototype.pop = function() {
+ var lastNode = this.lastNode
+ if (lastNode != null) {
+ this.remove(lastNode)
+ }
+ return lastNode
+}
+
+DoublyLinkedList.prototype.remove = function(node) {
+ if (this.firstNode == node) {
+ this.firstNode = node.next
+ } else if (node.prev != null) {
+ node.prev.next = node.next
+ }
+ if (this.lastNode == node) {
+ this.lastNode = node.prev
+ } else if (node.next != null) {
+ node.next.prev = node.prev
+ }
+}
+
+
+function DoublyLinkedNode(key, val) {
+ this.key = key
+ this.val = val
+ this.prev = null
+ this.next = null
+}
diff --git a/Nodejs/node_modules/aws4/package.json b/Nodejs/node_modules/aws4/package.json
new file mode 100644
index 0000000..029f041
--- /dev/null
+++ b/Nodejs/node_modules/aws4/package.json
@@ -0,0 +1,105 @@
+{
+ "_from": "aws4@^1.8.0",
+ "_id": "aws4@1.9.1",
+ "_inBundle": false,
+ "_integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==",
+ "_location": "/aws4",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "aws4@^1.8.0",
+ "name": "aws4",
+ "escapedName": "aws4",
+ "rawSpec": "^1.8.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.8.0"
+ },
+ "_requiredBy": [
+ "/request"
+ ],
+ "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
+ "_shasum": "7e33d8f7d449b3f673cd72deb9abdc552dbe528e",
+ "_spec": "aws4@^1.8.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/request",
+ "author": {
+ "name": "Michael Hart",
+ "email": "michael.hart.au@gmail.com",
+ "url": "http://github.com/mhart"
+ },
+ "bugs": {
+ "url": "https://github.com/mhart/aws4/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Signs and prepares requests using AWS Signature Version 4",
+ "devDependencies": {
+ "mocha": "^2.4.5",
+ "should": "^8.2.2"
+ },
+ "homepage": "https://github.com/mhart/aws4#readme",
+ "keywords": [
+ "amazon",
+ "aws",
+ "signature",
+ "s3",
+ "ec2",
+ "autoscaling",
+ "cloudformation",
+ "elasticloadbalancing",
+ "elb",
+ "elasticbeanstalk",
+ "cloudsearch",
+ "dynamodb",
+ "kinesis",
+ "lambda",
+ "glacier",
+ "sqs",
+ "sns",
+ "iam",
+ "sts",
+ "ses",
+ "swf",
+ "storagegateway",
+ "datapipeline",
+ "directconnect",
+ "redshift",
+ "opsworks",
+ "rds",
+ "monitoring",
+ "cloudtrail",
+ "cloudfront",
+ "codedeploy",
+ "elasticache",
+ "elasticmapreduce",
+ "elastictranscoder",
+ "emr",
+ "cloudwatch",
+ "mobileanalytics",
+ "cognitoidentity",
+ "cognitosync",
+ "cognito",
+ "containerservice",
+ "ecs",
+ "appstream",
+ "keymanagementservice",
+ "kms",
+ "config",
+ "cloudhsm",
+ "route53",
+ "route53domains",
+ "logs"
+ ],
+ "license": "MIT",
+ "main": "aws4.js",
+ "name": "aws4",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mhart/aws4.git"
+ },
+ "scripts": {
+ "integration": "node ./test/slow.js",
+ "test": "mocha ./test/fast.js -b -t 100s -R list"
+ },
+ "version": "1.9.1"
+}
diff --git a/Nodejs/node_modules/balanced-match/.npmignore b/Nodejs/node_modules/balanced-match/.npmignore
new file mode 100644
index 0000000..ae5d8c3
--- /dev/null
+++ b/Nodejs/node_modules/balanced-match/.npmignore
@@ -0,0 +1,5 @@
+test
+.gitignore
+.travis.yml
+Makefile
+example.js
diff --git a/Nodejs/node_modules/balanced-match/LICENSE.md b/Nodejs/node_modules/balanced-match/LICENSE.md
new file mode 100644
index 0000000..2cdc8e4
--- /dev/null
+++ b/Nodejs/node_modules/balanced-match/LICENSE.md
@@ -0,0 +1,21 @@
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Nodejs/node_modules/balanced-match/README.md b/Nodejs/node_modules/balanced-match/README.md
new file mode 100644
index 0000000..08e918c
--- /dev/null
+++ b/Nodejs/node_modules/balanced-match/README.md
@@ -0,0 +1,91 @@
+# balanced-match
+
+Match balanced string pairs, like `{` and `}` or `` and ` `. Supports regular expressions as well!
+
+[](http://travis-ci.org/juliangruber/balanced-match)
+[](https://www.npmjs.org/package/balanced-match)
+
+[](https://ci.testling.com/juliangruber/balanced-match)
+
+## Example
+
+Get the first matching pair of braces:
+
+```js
+var balanced = require('balanced-match');
+
+console.log(balanced('{', '}', 'pre{in{nested}}post'));
+console.log(balanced('{', '}', 'pre{first}between{second}post'));
+console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'));
+```
+
+The matches are:
+
+```bash
+$ node example.js
+{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
+{ start: 3,
+ end: 9,
+ pre: 'pre',
+ body: 'first',
+ post: 'between{second}post' }
+{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
+```
+
+## API
+
+### var m = balanced(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+object with those keys:
+
+* **start** the index of the first match of `a`
+* **end** the index of the matching `b`
+* **pre** the preamble, `a` and `b` not included
+* **body** the match, `a` and `b` not included
+* **post** the postscript, `a` and `b` not included
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
+
+### var r = balanced.range(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+array with indexes: `[ , ]`.
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install balanced-match
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Nodejs/node_modules/balanced-match/index.js b/Nodejs/node_modules/balanced-match/index.js
new file mode 100644
index 0000000..1685a76
--- /dev/null
+++ b/Nodejs/node_modules/balanced-match/index.js
@@ -0,0 +1,59 @@
+'use strict';
+module.exports = balanced;
+function balanced(a, b, str) {
+ if (a instanceof RegExp) a = maybeMatch(a, str);
+ if (b instanceof RegExp) b = maybeMatch(b, str);
+
+ var r = range(a, b, str);
+
+ return r && {
+ start: r[0],
+ end: r[1],
+ pre: str.slice(0, r[0]),
+ body: str.slice(r[0] + a.length, r[1]),
+ post: str.slice(r[1] + b.length)
+ };
+}
+
+function maybeMatch(reg, str) {
+ var m = str.match(reg);
+ return m ? m[0] : null;
+}
+
+balanced.range = range;
+function range(a, b, str) {
+ var begs, beg, left, right, result;
+ var ai = str.indexOf(a);
+ var bi = str.indexOf(b, ai + 1);
+ var i = ai;
+
+ if (ai >= 0 && bi > 0) {
+ begs = [];
+ left = str.length;
+
+ while (i >= 0 && !result) {
+ if (i == ai) {
+ begs.push(i);
+ ai = str.indexOf(a, i + 1);
+ } else if (begs.length == 1) {
+ result = [ begs.pop(), bi ];
+ } else {
+ beg = begs.pop();
+ if (beg < left) {
+ left = beg;
+ right = bi;
+ }
+
+ bi = str.indexOf(b, i + 1);
+ }
+
+ i = ai < bi && ai >= 0 ? ai : bi;
+ }
+
+ if (begs.length) {
+ result = [ left, right ];
+ }
+ }
+
+ return result;
+}
diff --git a/Nodejs/node_modules/balanced-match/package.json b/Nodejs/node_modules/balanced-match/package.json
new file mode 100644
index 0000000..797d144
--- /dev/null
+++ b/Nodejs/node_modules/balanced-match/package.json
@@ -0,0 +1,77 @@
+{
+ "_from": "balanced-match@^1.0.0",
+ "_id": "balanced-match@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "_location": "/balanced-match",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "balanced-match@^1.0.0",
+ "name": "balanced-match",
+ "escapedName": "balanced-match",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/brace-expansion"
+ ],
+ "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+ "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
+ "_spec": "balanced-match@^1.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/brace-expansion",
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "bugs": {
+ "url": "https://github.com/juliangruber/balanced-match/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {},
+ "deprecated": false,
+ "description": "Match balanced character pairs, like \"{\" and \"}\"",
+ "devDependencies": {
+ "matcha": "^0.7.0",
+ "tape": "^4.6.0"
+ },
+ "homepage": "https://github.com/juliangruber/balanced-match",
+ "keywords": [
+ "match",
+ "regexp",
+ "test",
+ "balanced",
+ "parse"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "balanced-match",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/balanced-match.git"
+ },
+ "scripts": {
+ "bench": "make bench",
+ "test": "make test"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/20..latest",
+ "firefox/nightly",
+ "chrome/25..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ },
+ "version": "1.0.0"
+}
diff --git a/Nodejs/node_modules/base64-js/LICENSE b/Nodejs/node_modules/base64-js/LICENSE
new file mode 100644
index 0000000..6d52b8a
--- /dev/null
+++ b/Nodejs/node_modules/base64-js/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Jameson Little
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/base64-js/README.md b/Nodejs/node_modules/base64-js/README.md
new file mode 100644
index 0000000..0395c33
--- /dev/null
+++ b/Nodejs/node_modules/base64-js/README.md
@@ -0,0 +1,32 @@
+base64-js
+=========
+
+`base64-js` does basic base64 encoding/decoding in pure JS.
+
+[](http://travis-ci.org/beatgammit/base64-js)
+
+Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.
+
+Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
+
+## install
+
+With [npm](https://npmjs.org) do:
+
+`npm install base64-js` and `var base64js = require('base64-js')`
+
+For use in web browsers do:
+
+``
+
+## methods
+
+`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
+
+* `byteLength` - Takes a base64 string and returns length of byte array
+* `toByteArray` - Takes a base64 string and returns a byte array
+* `fromByteArray` - Takes a byte array and returns a base64 string
+
+## license
+
+MIT
diff --git a/Nodejs/node_modules/base64-js/base64js.min.js b/Nodejs/node_modules/base64-js/base64js.min.js
new file mode 100644
index 0000000..b0279c0
--- /dev/null
+++ b/Nodejs/node_modules/base64-js/base64js.min.js
@@ -0,0 +1 @@
+(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function d(a,f,i){function u(n,r){if(!f[n]){if(!a[n]){var e="function"==typeof require&&require;if(!r&&e)return e(n,!0);if(v)return v(n,!0);var t=new Error("Cannot find module '"+n+"'");throw t.code="MODULE_NOT_FOUND",t}var o=f[n]={exports:{}};a[n][0].call(o.exports,function(r){var e=a[n][1][r];return u(e||r)},o,o.exports,d,a,f,i)}return f[n].exports}for(var v="function"==typeof require&&require,r=0;r0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=r.indexOf("=");if(n===-1)n=e;var t=n===e?0:4-n%4;return[n,t]}function f(r){var e=c(r);var n=e[0];var t=e[1];return(n+t)*3/4-t}function h(r,e,n){return(e+n)*3/4-n}function i(r){var e;var n=c(r);var t=n[0];var o=n[1];var a=new d(h(r,t,o));var f=0;var i=o>0?t-4:t;var u;for(u=0;u>16&255;a[f++]=e>>8&255;a[f++]=e&255}if(o===2){e=v[r.charCodeAt(u)]<<2|v[r.charCodeAt(u+1)]>>4;a[f++]=e&255}if(o===1){e=v[r.charCodeAt(u)]<<10|v[r.charCodeAt(u+1)]<<4|v[r.charCodeAt(u+2)]>>2;a[f++]=e>>8&255;a[f++]=e&255}return a}function s(r){return u[r>>18&63]+u[r>>12&63]+u[r>>6&63]+u[r&63]}function l(r,e,n){var t;var o=[];for(var a=e;ai?i:f+a))}if(t===1){e=r[n-1];o.push(u[e>>2]+u[e<<4&63]+"==")}else if(t===2){e=(r[n-2]<<8)+r[n-1];o.push(u[e>>10]+u[e>>4&63]+u[e<<2&63]+"=")}return o.join("")}},{}]},{},[])("/")});
diff --git a/Nodejs/node_modules/base64-js/index.js b/Nodejs/node_modules/base64-js/index.js
new file mode 100644
index 0000000..f087f5b
--- /dev/null
+++ b/Nodejs/node_modules/base64-js/index.js
@@ -0,0 +1,152 @@
+'use strict'
+
+exports.byteLength = byteLength
+exports.toByteArray = toByteArray
+exports.fromByteArray = fromByteArray
+
+var lookup = []
+var revLookup = []
+var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
+
+var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+for (var i = 0, len = code.length; i < len; ++i) {
+ lookup[i] = code[i]
+ revLookup[code.charCodeAt(i)] = i
+}
+
+// Support decoding URL-safe base64 strings, as Node.js does.
+// See: https://en.wikipedia.org/wiki/Base64#URL_applications
+revLookup['-'.charCodeAt(0)] = 62
+revLookup['_'.charCodeAt(0)] = 63
+
+function getLens (b64) {
+ var len = b64.length
+
+ if (len % 4 > 0) {
+ throw new Error('Invalid string. Length must be a multiple of 4')
+ }
+
+ // Trim off extra bytes after placeholder bytes are found
+ // See: https://github.com/beatgammit/base64-js/issues/42
+ var validLen = b64.indexOf('=')
+ if (validLen === -1) validLen = len
+
+ var placeHoldersLen = validLen === len
+ ? 0
+ : 4 - (validLen % 4)
+
+ return [validLen, placeHoldersLen]
+}
+
+// base64 is 4/3 + up to two characters of the original data
+function byteLength (b64) {
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function _byteLength (b64, validLen, placeHoldersLen) {
+ return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+}
+
+function toByteArray (b64) {
+ var tmp
+ var lens = getLens(b64)
+ var validLen = lens[0]
+ var placeHoldersLen = lens[1]
+
+ var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+ var curByte = 0
+
+ // if there are placeholders, only get up to the last complete 4 chars
+ var len = placeHoldersLen > 0
+ ? validLen - 4
+ : validLen
+
+ var i
+ for (i = 0; i < len; i += 4) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 18) |
+ (revLookup[b64.charCodeAt(i + 1)] << 12) |
+ (revLookup[b64.charCodeAt(i + 2)] << 6) |
+ revLookup[b64.charCodeAt(i + 3)]
+ arr[curByte++] = (tmp >> 16) & 0xFF
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 2) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 2) |
+ (revLookup[b64.charCodeAt(i + 1)] >> 4)
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ if (placeHoldersLen === 1) {
+ tmp =
+ (revLookup[b64.charCodeAt(i)] << 10) |
+ (revLookup[b64.charCodeAt(i + 1)] << 4) |
+ (revLookup[b64.charCodeAt(i + 2)] >> 2)
+ arr[curByte++] = (tmp >> 8) & 0xFF
+ arr[curByte++] = tmp & 0xFF
+ }
+
+ return arr
+}
+
+function tripletToBase64 (num) {
+ return lookup[num >> 18 & 0x3F] +
+ lookup[num >> 12 & 0x3F] +
+ lookup[num >> 6 & 0x3F] +
+ lookup[num & 0x3F]
+}
+
+function encodeChunk (uint8, start, end) {
+ var tmp
+ var output = []
+ for (var i = start; i < end; i += 3) {
+ tmp =
+ ((uint8[i] << 16) & 0xFF0000) +
+ ((uint8[i + 1] << 8) & 0xFF00) +
+ (uint8[i + 2] & 0xFF)
+ output.push(tripletToBase64(tmp))
+ }
+ return output.join('')
+}
+
+function fromByteArray (uint8) {
+ var tmp
+ var len = uint8.length
+ var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+ var parts = []
+ var maxChunkLength = 16383 // must be multiple of 3
+
+ // go through the array every three bytes, we'll deal with trailing stuff later
+ for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+ parts.push(encodeChunk(
+ uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
+ ))
+ }
+
+ // pad the end with zeros, but make sure to not forget the extra bytes
+ if (extraBytes === 1) {
+ tmp = uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 2] +
+ lookup[(tmp << 4) & 0x3F] +
+ '=='
+ )
+ } else if (extraBytes === 2) {
+ tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+ parts.push(
+ lookup[tmp >> 10] +
+ lookup[(tmp >> 4) & 0x3F] +
+ lookup[(tmp << 2) & 0x3F] +
+ '='
+ )
+ }
+
+ return parts.join('')
+}
diff --git a/Nodejs/node_modules/base64-js/package.json b/Nodejs/node_modules/base64-js/package.json
new file mode 100644
index 0000000..938585e
--- /dev/null
+++ b/Nodejs/node_modules/base64-js/package.json
@@ -0,0 +1,60 @@
+{
+ "_from": "base64-js@^1.3.0",
+ "_id": "base64-js@1.3.1",
+ "_inBundle": false,
+ "_integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==",
+ "_location": "/base64-js",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "base64-js@^1.3.0",
+ "name": "base64-js",
+ "escapedName": "base64-js",
+ "rawSpec": "^1.3.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.3.0"
+ },
+ "_requiredBy": [
+ "/mqtt"
+ ],
+ "_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz",
+ "_shasum": "58ece8cb75dd07e71ed08c736abc5fac4dbf8df1",
+ "_spec": "base64-js@^1.3.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/mqtt",
+ "author": {
+ "name": "T. Jameson Little",
+ "email": "t.jameson.little@gmail.com"
+ },
+ "bugs": {
+ "url": "https://github.com/beatgammit/base64-js/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Base64 encoding/decoding in pure JS",
+ "devDependencies": {
+ "benchmark": "^2.1.4",
+ "browserify": "^16.3.0",
+ "standard": "*",
+ "tape": "4.x",
+ "uglify-js": "^3.6.0"
+ },
+ "homepage": "https://github.com/beatgammit/base64-js",
+ "keywords": [
+ "base64"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "base64-js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/beatgammit/base64-js.git"
+ },
+ "scripts": {
+ "build": "browserify -s base64js -r ./ | uglifyjs -m > base64js.min.js",
+ "lint": "standard",
+ "test": "npm run lint && npm run unit",
+ "unit": "tape test/*.js"
+ },
+ "version": "1.3.1"
+}
diff --git a/Nodejs/node_modules/bcrypt-pbkdf/CONTRIBUTING.md b/Nodejs/node_modules/bcrypt-pbkdf/CONTRIBUTING.md
new file mode 100644
index 0000000..401d34e
--- /dev/null
+++ b/Nodejs/node_modules/bcrypt-pbkdf/CONTRIBUTING.md
@@ -0,0 +1,13 @@
+# Contributing
+
+This repository uses [cr.joyent.us](https://cr.joyent.us) (Gerrit) for new
+changes. Anyone can submit changes. To get started, see the [cr.joyent.us user
+guide](https://github.com/joyent/joyent-gerrit/blob/master/docs/user/README.md).
+This repo does not use GitHub pull requests.
+
+See the [Joyent Engineering
+Guidelines](https://github.com/joyent/eng/blob/master/docs/index.md) for general
+best practices expected in this repository.
+
+If you're changing something non-trivial or user-facing, you may want to submit
+an issue first.
diff --git a/Nodejs/node_modules/bcrypt-pbkdf/LICENSE b/Nodejs/node_modules/bcrypt-pbkdf/LICENSE
new file mode 100644
index 0000000..fc58d2a
--- /dev/null
+++ b/Nodejs/node_modules/bcrypt-pbkdf/LICENSE
@@ -0,0 +1,66 @@
+The Blowfish portions are under the following license:
+
+Blowfish block cipher for OpenBSD
+Copyright 1997 Niels Provos
+All rights reserved.
+
+Implementation advice by David Mazieres .
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+The bcrypt_pbkdf portions are under the following license:
+
+Copyright (c) 2013 Ted Unangst
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+
+
+Performance improvements (Javascript-specific):
+
+Copyright 2016, Joyent Inc
+Author: Alex Wilson
+
+Permission to use, copy, modify, and distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/Nodejs/node_modules/bcrypt-pbkdf/README.md b/Nodejs/node_modules/bcrypt-pbkdf/README.md
new file mode 100644
index 0000000..7551f33
--- /dev/null
+++ b/Nodejs/node_modules/bcrypt-pbkdf/README.md
@@ -0,0 +1,45 @@
+Port of the OpenBSD `bcrypt_pbkdf` function to pure Javascript. `npm`-ified
+version of [Devi Mandiri's port](https://github.com/devi/tmp/blob/master/js/bcrypt_pbkdf.js),
+with some minor performance improvements. The code is copied verbatim (and
+un-styled) from Devi's work.
+
+This product includes software developed by Niels Provos.
+
+## API
+
+### `bcrypt_pbkdf.pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds)`
+
+Derive a cryptographic key of arbitrary length from a given password and salt,
+using the OpenBSD `bcrypt_pbkdf` function. This is a combination of Blowfish and
+SHA-512.
+
+See [this article](http://www.tedunangst.com/flak/post/bcrypt-pbkdf) for
+further information.
+
+Parameters:
+
+ * `pass`, a Uint8Array of length `passlen`
+ * `passlen`, an integer Number
+ * `salt`, a Uint8Array of length `saltlen`
+ * `saltlen`, an integer Number
+ * `key`, a Uint8Array of length `keylen`, will be filled with output
+ * `keylen`, an integer Number
+ * `rounds`, an integer Number, number of rounds of the PBKDF to run
+
+### `bcrypt_pbkdf.hash(sha2pass, sha2salt, out)`
+
+Calculate a Blowfish hash, given SHA2-512 output of a password and salt. Used as
+part of the inner round function in the PBKDF.
+
+Parameters:
+
+ * `sha2pass`, a Uint8Array of length 64
+ * `sha2salt`, a Uint8Array of length 64
+ * `out`, a Uint8Array of length 32, will be filled with output
+
+## License
+
+This source form is a 1:1 port from the OpenBSD `blowfish.c` and `bcrypt_pbkdf.c`.
+As a result, it retains the original copyright and license. The two files are
+under slightly different (but compatible) licenses, and are here combined in
+one file. For each of the full license texts see `LICENSE`.
diff --git a/Nodejs/node_modules/bcrypt-pbkdf/index.js b/Nodejs/node_modules/bcrypt-pbkdf/index.js
new file mode 100644
index 0000000..b1b5ad4
--- /dev/null
+++ b/Nodejs/node_modules/bcrypt-pbkdf/index.js
@@ -0,0 +1,556 @@
+'use strict';
+
+var crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash;
+
+/*
+ * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a
+ * result, it retains the original copyright and license. The two files are
+ * under slightly different (but compatible) licenses, and are here combined in
+ * one file.
+ *
+ * Credit for the actual porting work goes to:
+ * Devi Mandiri
+ */
+
+/*
+ * The Blowfish portions are under the following license:
+ *
+ * Blowfish block cipher for OpenBSD
+ * Copyright 1997 Niels Provos
+ * All rights reserved.
+ *
+ * Implementation advice by David Mazieres .
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * The bcrypt_pbkdf portions are under the following license:
+ *
+ * Copyright (c) 2013 Ted Unangst
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/*
+ * Performance improvements (Javascript-specific):
+ *
+ * Copyright 2016, Joyent Inc
+ * Author: Alex Wilson
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+// Ported from OpenBSD bcrypt_pbkdf.c v1.9
+
+var BLF_J = 0;
+
+var Blowfish = function() {
+ this.S = [
+ new Uint32Array([
+ 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
+ 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
+ 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
+ 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
+ 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
+ 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
+ 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
+ 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
+ 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
+ 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
+ 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
+ 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
+ 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
+ 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
+ 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
+ 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
+ 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
+ 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
+ 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
+ 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
+ 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
+ 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
+ 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
+ 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
+ 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
+ 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
+ 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
+ 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
+ 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
+ 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
+ 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
+ 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
+ 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
+ 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
+ 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
+ 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
+ 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
+ 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
+ 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
+ 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
+ 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
+ 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
+ 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
+ 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
+ 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
+ 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
+ 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
+ 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
+ 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
+ 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
+ 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
+ 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
+ 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
+ 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
+ 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
+ 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
+ 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
+ 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
+ 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
+ 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
+ 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
+ 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
+ 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
+ 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]),
+ new Uint32Array([
+ 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
+ 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
+ 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
+ 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
+ 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
+ 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
+ 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
+ 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
+ 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
+ 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
+ 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
+ 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
+ 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
+ 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
+ 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
+ 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
+ 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
+ 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
+ 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
+ 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
+ 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
+ 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
+ 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
+ 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
+ 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
+ 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
+ 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
+ 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
+ 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
+ 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
+ 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
+ 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
+ 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
+ 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
+ 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
+ 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
+ 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
+ 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
+ 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
+ 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
+ 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
+ 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
+ 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
+ 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
+ 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
+ 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
+ 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
+ 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
+ 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
+ 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
+ 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
+ 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
+ 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
+ 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
+ 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
+ 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
+ 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
+ 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
+ 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
+ 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
+ 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
+ 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
+ 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
+ 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]),
+ new Uint32Array([
+ 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
+ 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
+ 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
+ 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
+ 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
+ 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
+ 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
+ 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
+ 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
+ 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
+ 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
+ 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
+ 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
+ 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
+ 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
+ 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
+ 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
+ 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
+ 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
+ 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
+ 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
+ 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
+ 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
+ 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
+ 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
+ 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
+ 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
+ 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
+ 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
+ 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
+ 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
+ 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
+ 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
+ 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
+ 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
+ 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
+ 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
+ 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
+ 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
+ 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
+ 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
+ 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
+ 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
+ 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
+ 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
+ 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
+ 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
+ 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
+ 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
+ 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
+ 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
+ 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
+ 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
+ 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
+ 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
+ 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
+ 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
+ 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
+ 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
+ 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
+ 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
+ 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
+ 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
+ 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]),
+ new Uint32Array([
+ 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
+ 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
+ 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
+ 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
+ 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
+ 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
+ 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
+ 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
+ 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
+ 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
+ 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
+ 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
+ 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
+ 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
+ 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
+ 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
+ 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
+ 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
+ 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
+ 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
+ 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
+ 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
+ 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
+ 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
+ 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
+ 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
+ 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
+ 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
+ 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
+ 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
+ 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
+ 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
+ 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
+ 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
+ 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
+ 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
+ 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
+ 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
+ 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
+ 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
+ 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
+ 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
+ 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
+ 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
+ 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
+ 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
+ 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
+ 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
+ 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
+ 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
+ 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
+ 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
+ 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
+ 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
+ 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
+ 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
+ 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
+ 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
+ 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
+ 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
+ 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
+ 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
+ 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
+ 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6])
+ ];
+ this.P = new Uint32Array([
+ 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
+ 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
+ 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
+ 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
+ 0x9216d5d9, 0x8979fb1b]);
+};
+
+function F(S, x8, i) {
+ return (((S[0][x8[i+3]] +
+ S[1][x8[i+2]]) ^
+ S[2][x8[i+1]]) +
+ S[3][x8[i]]);
+};
+
+Blowfish.prototype.encipher = function(x, x8) {
+ if (x8 === undefined) {
+ x8 = new Uint8Array(x.buffer);
+ if (x.byteOffset !== 0)
+ x8 = x8.subarray(x.byteOffset);
+ }
+ x[0] ^= this.P[0];
+ for (var i = 1; i < 16; i += 2) {
+ x[1] ^= F(this.S, x8, 0) ^ this.P[i];
+ x[0] ^= F(this.S, x8, 4) ^ this.P[i+1];
+ }
+ var t = x[0];
+ x[0] = x[1] ^ this.P[17];
+ x[1] = t;
+};
+
+Blowfish.prototype.decipher = function(x) {
+ var x8 = new Uint8Array(x.buffer);
+ if (x.byteOffset !== 0)
+ x8 = x8.subarray(x.byteOffset);
+ x[0] ^= this.P[17];
+ for (var i = 16; i > 0; i -= 2) {
+ x[1] ^= F(this.S, x8, 0) ^ this.P[i];
+ x[0] ^= F(this.S, x8, 4) ^ this.P[i-1];
+ }
+ var t = x[0];
+ x[0] = x[1] ^ this.P[0];
+ x[1] = t;
+};
+
+function stream2word(data, databytes){
+ var i, temp = 0;
+ for (i = 0; i < 4; i++, BLF_J++) {
+ if (BLF_J >= databytes) BLF_J = 0;
+ temp = (temp << 8) | data[BLF_J];
+ }
+ return temp;
+};
+
+Blowfish.prototype.expand0state = function(key, keybytes) {
+ var d = new Uint32Array(2), i, k;
+ var d8 = new Uint8Array(d.buffer);
+
+ for (i = 0, BLF_J = 0; i < 18; i++) {
+ this.P[i] ^= stream2word(key, keybytes);
+ }
+ BLF_J = 0;
+
+ for (i = 0; i < 18; i += 2) {
+ this.encipher(d, d8);
+ this.P[i] = d[0];
+ this.P[i+1] = d[1];
+ }
+
+ for (i = 0; i < 4; i++) {
+ for (k = 0; k < 256; k += 2) {
+ this.encipher(d, d8);
+ this.S[i][k] = d[0];
+ this.S[i][k+1] = d[1];
+ }
+ }
+};
+
+Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) {
+ var d = new Uint32Array(2), i, k;
+
+ for (i = 0, BLF_J = 0; i < 18; i++) {
+ this.P[i] ^= stream2word(key, keybytes);
+ }
+
+ for (i = 0, BLF_J = 0; i < 18; i += 2) {
+ d[0] ^= stream2word(data, databytes);
+ d[1] ^= stream2word(data, databytes);
+ this.encipher(d);
+ this.P[i] = d[0];
+ this.P[i+1] = d[1];
+ }
+
+ for (i = 0; i < 4; i++) {
+ for (k = 0; k < 256; k += 2) {
+ d[0] ^= stream2word(data, databytes);
+ d[1] ^= stream2word(data, databytes);
+ this.encipher(d);
+ this.S[i][k] = d[0];
+ this.S[i][k+1] = d[1];
+ }
+ }
+ BLF_J = 0;
+};
+
+Blowfish.prototype.enc = function(data, blocks) {
+ for (var i = 0; i < blocks; i++) {
+ this.encipher(data.subarray(i*2));
+ }
+};
+
+Blowfish.prototype.dec = function(data, blocks) {
+ for (var i = 0; i < blocks; i++) {
+ this.decipher(data.subarray(i*2));
+ }
+};
+
+var BCRYPT_BLOCKS = 8,
+ BCRYPT_HASHSIZE = 32;
+
+function bcrypt_hash(sha2pass, sha2salt, out) {
+ var state = new Blowfish(),
+ cdata = new Uint32Array(BCRYPT_BLOCKS), i,
+ ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,
+ 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,
+ 105,116,101]); //"OxychromaticBlowfishSwatDynamite"
+
+ state.expandstate(sha2salt, 64, sha2pass, 64);
+ for (i = 0; i < 64; i++) {
+ state.expand0state(sha2salt, 64);
+ state.expand0state(sha2pass, 64);
+ }
+
+ for (i = 0; i < BCRYPT_BLOCKS; i++)
+ cdata[i] = stream2word(ciphertext, ciphertext.byteLength);
+ for (i = 0; i < 64; i++)
+ state.enc(cdata, cdata.byteLength / 8);
+
+ for (i = 0; i < BCRYPT_BLOCKS; i++) {
+ out[4*i+3] = cdata[i] >>> 24;
+ out[4*i+2] = cdata[i] >>> 16;
+ out[4*i+1] = cdata[i] >>> 8;
+ out[4*i+0] = cdata[i];
+ }
+};
+
+function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {
+ var sha2pass = new Uint8Array(64),
+ sha2salt = new Uint8Array(64),
+ out = new Uint8Array(BCRYPT_HASHSIZE),
+ tmpout = new Uint8Array(BCRYPT_HASHSIZE),
+ countsalt = new Uint8Array(saltlen+4),
+ i, j, amt, stride, dest, count,
+ origkeylen = keylen;
+
+ if (rounds < 1)
+ return -1;
+ if (passlen === 0 || saltlen === 0 || keylen === 0 ||
+ keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20))
+ return -1;
+
+ stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);
+ amt = Math.floor((keylen + stride - 1) / stride);
+
+ for (i = 0; i < saltlen; i++)
+ countsalt[i] = salt[i];
+
+ crypto_hash_sha512(sha2pass, pass, passlen);
+
+ for (count = 1; keylen > 0; count++) {
+ countsalt[saltlen+0] = count >>> 24;
+ countsalt[saltlen+1] = count >>> 16;
+ countsalt[saltlen+2] = count >>> 8;
+ countsalt[saltlen+3] = count;
+
+ crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);
+ bcrypt_hash(sha2pass, sha2salt, tmpout);
+ for (i = out.byteLength; i--;)
+ out[i] = tmpout[i];
+
+ for (i = 1; i < rounds; i++) {
+ crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);
+ bcrypt_hash(sha2pass, sha2salt, tmpout);
+ for (j = 0; j < out.byteLength; j++)
+ out[j] ^= tmpout[j];
+ }
+
+ amt = Math.min(amt, keylen);
+ for (i = 0; i < amt; i++) {
+ dest = i * stride + (count - 1);
+ if (dest >= origkeylen)
+ break;
+ key[dest] = out[i];
+ }
+ keylen -= i;
+ }
+
+ return 0;
+};
+
+module.exports = {
+ BLOCKS: BCRYPT_BLOCKS,
+ HASHSIZE: BCRYPT_HASHSIZE,
+ hash: bcrypt_hash,
+ pbkdf: bcrypt_pbkdf
+};
diff --git a/Nodejs/node_modules/bcrypt-pbkdf/package.json b/Nodejs/node_modules/bcrypt-pbkdf/package.json
new file mode 100644
index 0000000..bd4aa57
--- /dev/null
+++ b/Nodejs/node_modules/bcrypt-pbkdf/package.json
@@ -0,0 +1,44 @@
+{
+ "_from": "bcrypt-pbkdf@^1.0.0",
+ "_id": "bcrypt-pbkdf@1.0.2",
+ "_inBundle": false,
+ "_integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
+ "_location": "/bcrypt-pbkdf",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "bcrypt-pbkdf@^1.0.0",
+ "name": "bcrypt-pbkdf",
+ "escapedName": "bcrypt-pbkdf",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/sshpk"
+ ],
+ "_resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
+ "_shasum": "a4301d389b6a43f9b67ff3ca11a3f6637e360e9e",
+ "_spec": "bcrypt-pbkdf@^1.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/sshpk",
+ "bugs": {
+ "url": "https://github.com/joyent/node-bcrypt-pbkdf/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "tweetnacl": "^0.14.3"
+ },
+ "deprecated": false,
+ "description": "Port of the OpenBSD bcrypt_pbkdf function to pure JS",
+ "devDependencies": {},
+ "homepage": "https://github.com/joyent/node-bcrypt-pbkdf#readme",
+ "license": "BSD-3-Clause",
+ "main": "index.js",
+ "name": "bcrypt-pbkdf",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/joyent/node-bcrypt-pbkdf.git"
+ },
+ "version": "1.0.2"
+}
diff --git a/Nodejs/node_modules/bl/.jshintrc b/Nodejs/node_modules/bl/.jshintrc
new file mode 100644
index 0000000..c8ef3ca
--- /dev/null
+++ b/Nodejs/node_modules/bl/.jshintrc
@@ -0,0 +1,59 @@
+{
+ "predef": [ ]
+ , "bitwise": false
+ , "camelcase": false
+ , "curly": false
+ , "eqeqeq": false
+ , "forin": false
+ , "immed": false
+ , "latedef": false
+ , "noarg": true
+ , "noempty": true
+ , "nonew": true
+ , "plusplus": false
+ , "quotmark": true
+ , "regexp": false
+ , "undef": true
+ , "unused": true
+ , "strict": false
+ , "trailing": true
+ , "maxlen": 120
+ , "asi": true
+ , "boss": true
+ , "debug": true
+ , "eqnull": true
+ , "esnext": true
+ , "evil": true
+ , "expr": true
+ , "funcscope": false
+ , "globalstrict": false
+ , "iterator": false
+ , "lastsemic": true
+ , "laxbreak": true
+ , "laxcomma": true
+ , "loopfunc": true
+ , "multistr": false
+ , "onecase": false
+ , "proto": false
+ , "regexdash": false
+ , "scripturl": true
+ , "smarttabs": false
+ , "shadow": false
+ , "sub": true
+ , "supernew": false
+ , "validthis": true
+ , "browser": true
+ , "couch": false
+ , "devel": false
+ , "dojo": false
+ , "mootools": false
+ , "node": true
+ , "nonstandard": true
+ , "prototypejs": false
+ , "rhino": false
+ , "worker": true
+ , "wsh": false
+ , "nomen": false
+ , "onevar": false
+ , "passfail": false
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/.travis.yml b/Nodejs/node_modules/bl/.travis.yml
new file mode 100644
index 0000000..373bb4a
--- /dev/null
+++ b/Nodejs/node_modules/bl/.travis.yml
@@ -0,0 +1,16 @@
+sudo: false
+language: node_js
+node_js:
+ - '0.10'
+ - '0.12'
+ - '4'
+ - '6'
+ - '8'
+ - '9'
+branches:
+ only:
+ - master
+notifications:
+ email:
+ - rod@vagg.org
+ - matteo.collina@gmail.com
diff --git a/Nodejs/node_modules/bl/LICENSE.md b/Nodejs/node_modules/bl/LICENSE.md
new file mode 100644
index 0000000..ff35a34
--- /dev/null
+++ b/Nodejs/node_modules/bl/LICENSE.md
@@ -0,0 +1,13 @@
+The MIT License (MIT)
+=====================
+
+Copyright (c) 2013-2016 bl contributors
+----------------------------------
+
+*bl contributors listed at *
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Nodejs/node_modules/bl/README.md b/Nodejs/node_modules/bl/README.md
new file mode 100644
index 0000000..9eebd88
--- /dev/null
+++ b/Nodejs/node_modules/bl/README.md
@@ -0,0 +1,208 @@
+# bl *(BufferList)*
+
+[](https://travis-ci.org/rvagg/bl)
+
+**A Node.js Buffer list collector, reader and streamer thingy.**
+
+[](https://nodei.co/npm/bl/)
+[](https://nodei.co/npm/bl/)
+
+**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
+
+The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
+
+```js
+const BufferList = require('bl')
+
+var bl = new BufferList()
+bl.append(new Buffer('abcd'))
+bl.append(new Buffer('efg'))
+bl.append('hi') // bl will also accept & convert Strings
+bl.append(new Buffer('j'))
+bl.append(new Buffer([ 0x3, 0x4 ]))
+
+console.log(bl.length) // 12
+
+console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
+console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
+console.log(bl.slice(3, 6).toString('ascii')) // 'def'
+console.log(bl.slice(3, 8).toString('ascii')) // 'defgh'
+console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
+
+// or just use toString!
+console.log(bl.toString()) // 'abcdefghij\u0003\u0004'
+console.log(bl.toString('ascii', 3, 8)) // 'defgh'
+console.log(bl.toString('ascii', 5, 10)) // 'fghij'
+
+// other standard Buffer readables
+console.log(bl.readUInt16BE(10)) // 0x0304
+console.log(bl.readUInt16LE(10)) // 0x0403
+```
+
+Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
+
+```js
+const bl = require('bl')
+ , fs = require('fs')
+
+fs.createReadStream('README.md')
+ .pipe(bl(function (err, data) { // note 'new' isn't strictly required
+ // `data` is a complete Buffer object containing the full data
+ console.log(data.toString())
+ }))
+```
+
+Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
+
+Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
+```js
+const hyperquest = require('hyperquest')
+ , bl = require('bl')
+ , url = 'https://raw.github.com/rvagg/bl/master/README.md'
+
+hyperquest(url).pipe(bl(function (err, data) {
+ console.log(data.toString())
+}))
+```
+
+Or, use it as a readable stream to recompose a list of Buffers to an output source:
+
+```js
+const BufferList = require('bl')
+ , fs = require('fs')
+
+var bl = new BufferList()
+bl.append(new Buffer('abcd'))
+bl.append(new Buffer('efg'))
+bl.append(new Buffer('hi'))
+bl.append(new Buffer('j'))
+
+bl.pipe(fs.createWriteStream('gibberish.txt'))
+```
+
+## API
+
+ * new BufferList([ callback ])
+ * bl.length
+ * bl.append(buffer)
+ * bl.get(index)
+ * bl.slice([ start[, end ] ])
+ * bl.shallowSlice([ start[, end ] ])
+ * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
+ * bl.duplicate()
+ * bl.consume(bytes)
+ * bl.toString([encoding, [ start, [ end ]]])
+ * bl.readDoubleBE() , bl.readDoubleLE() , bl.readFloatBE() , bl.readFloatLE() , bl.readInt32BE() , bl.readInt32LE() , bl.readUInt32BE() , bl.readUInt32LE() , bl.readInt16BE() , bl.readInt16LE() , bl.readUInt16BE() , bl.readUInt16LE() , bl.readInt8() , bl.readUInt8()
+ * Streams
+
+--------------------------------------------------------
+
+### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
+The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
+
+Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
+
+`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
+
+```js
+var bl = require('bl')
+var myinstance = bl()
+
+// equivalent to:
+
+var BufferList = require('bl')
+var myinstance = new BufferList()
+```
+
+--------------------------------------------------------
+
+### bl.length
+Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
+
+--------------------------------------------------------
+
+### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
+`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
+
+--------------------------------------------------------
+
+### bl.get(index)
+`get()` will return the byte at the specified index.
+
+--------------------------------------------------------
+
+### bl.slice([ start, [ end ] ])
+`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
+
+If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
+
+--------------------------------------------------------
+
+### bl.shallowSlice([ start, [ end ] ])
+`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
+
+No copies will be performed. All buffers in the result share memory with the original list.
+
+--------------------------------------------------------
+
+### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
+`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
+
+--------------------------------------------------------
+
+### bl.duplicate()
+`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
+
+```js
+var bl = new BufferList()
+
+bl.append('hello')
+bl.append(' world')
+bl.append('\n')
+
+bl.duplicate().pipe(process.stdout, { end: false })
+
+console.log(bl.toString())
+```
+
+--------------------------------------------------------
+
+### bl.consume(bytes)
+`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data.
+
+--------------------------------------------------------
+
+### bl.toString([encoding, [ start, [ end ]]])
+`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
+
+--------------------------------------------------------
+
+### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
+
+All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
+
+See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work.
+
+--------------------------------------------------------
+
+### Streams
+**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.
+
+--------------------------------------------------------
+
+## Contributors
+
+**bl** is brought to you by the following hackers:
+
+ * [Rod Vagg](https://github.com/rvagg)
+ * [Matteo Collina](https://github.com/mcollina)
+ * [Jarett Cruger](https://github.com/jcrugzz)
+
+=======
+
+
+## License & copyright
+
+Copyright (c) 2013-2016 bl contributors (listed above).
+
+bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
diff --git a/Nodejs/node_modules/bl/bl.js b/Nodejs/node_modules/bl/bl.js
new file mode 100644
index 0000000..db536f3
--- /dev/null
+++ b/Nodejs/node_modules/bl/bl.js
@@ -0,0 +1,281 @@
+var DuplexStream = require('readable-stream/duplex')
+ , util = require('util')
+ , Buffer = require('safe-buffer').Buffer
+
+
+function BufferList (callback) {
+ if (!(this instanceof BufferList))
+ return new BufferList(callback)
+
+ this._bufs = []
+ this.length = 0
+
+ if (typeof callback == 'function') {
+ this._callback = callback
+
+ var piper = function piper (err) {
+ if (this._callback) {
+ this._callback(err)
+ this._callback = null
+ }
+ }.bind(this)
+
+ this.on('pipe', function onPipe (src) {
+ src.on('error', piper)
+ })
+ this.on('unpipe', function onUnpipe (src) {
+ src.removeListener('error', piper)
+ })
+ } else {
+ this.append(callback)
+ }
+
+ DuplexStream.call(this)
+}
+
+
+util.inherits(BufferList, DuplexStream)
+
+
+BufferList.prototype._offset = function _offset (offset) {
+ var tot = 0, i = 0, _t
+ if (offset === 0) return [ 0, 0 ]
+ for (; i < this._bufs.length; i++) {
+ _t = tot + this._bufs[i].length
+ if (offset < _t || i == this._bufs.length - 1)
+ return [ i, offset - tot ]
+ tot = _t
+ }
+}
+
+
+BufferList.prototype.append = function append (buf) {
+ var i = 0
+
+ if (Buffer.isBuffer(buf)) {
+ this._appendBuffer(buf);
+ } else if (Array.isArray(buf)) {
+ for (; i < buf.length; i++)
+ this.append(buf[i])
+ } else if (buf instanceof BufferList) {
+ // unwrap argument into individual BufferLists
+ for (; i < buf._bufs.length; i++)
+ this.append(buf._bufs[i])
+ } else if (buf != null) {
+ // coerce number arguments to strings, since Buffer(number) does
+ // uninitialized memory allocation
+ if (typeof buf == 'number')
+ buf = buf.toString()
+
+ this._appendBuffer(Buffer.from(buf));
+ }
+
+ return this
+}
+
+
+BufferList.prototype._appendBuffer = function appendBuffer (buf) {
+ this._bufs.push(buf)
+ this.length += buf.length
+}
+
+
+BufferList.prototype._write = function _write (buf, encoding, callback) {
+ this._appendBuffer(buf)
+
+ if (typeof callback == 'function')
+ callback()
+}
+
+
+BufferList.prototype._read = function _read (size) {
+ if (!this.length)
+ return this.push(null)
+
+ size = Math.min(size, this.length)
+ this.push(this.slice(0, size))
+ this.consume(size)
+}
+
+
+BufferList.prototype.end = function end (chunk) {
+ DuplexStream.prototype.end.call(this, chunk)
+
+ if (this._callback) {
+ this._callback(null, this.slice())
+ this._callback = null
+ }
+}
+
+
+BufferList.prototype.get = function get (index) {
+ return this.slice(index, index + 1)[0]
+}
+
+
+BufferList.prototype.slice = function slice (start, end) {
+ if (typeof start == 'number' && start < 0)
+ start += this.length
+ if (typeof end == 'number' && end < 0)
+ end += this.length
+ return this.copy(null, 0, start, end)
+}
+
+
+BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
+ if (typeof srcStart != 'number' || srcStart < 0)
+ srcStart = 0
+ if (typeof srcEnd != 'number' || srcEnd > this.length)
+ srcEnd = this.length
+ if (srcStart >= this.length)
+ return dst || Buffer.alloc(0)
+ if (srcEnd <= 0)
+ return dst || Buffer.alloc(0)
+
+ var copy = !!dst
+ , off = this._offset(srcStart)
+ , len = srcEnd - srcStart
+ , bytes = len
+ , bufoff = (copy && dstStart) || 0
+ , start = off[1]
+ , l
+ , i
+
+ // copy/slice everything
+ if (srcStart === 0 && srcEnd == this.length) {
+ if (!copy) { // slice, but full concat if multiple buffers
+ return this._bufs.length === 1
+ ? this._bufs[0]
+ : Buffer.concat(this._bufs, this.length)
+ }
+
+ // copy, need to copy individual buffers
+ for (i = 0; i < this._bufs.length; i++) {
+ this._bufs[i].copy(dst, bufoff)
+ bufoff += this._bufs[i].length
+ }
+
+ return dst
+ }
+
+ // easy, cheap case where it's a subset of one of the buffers
+ if (bytes <= this._bufs[off[0]].length - start) {
+ return copy
+ ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
+ : this._bufs[off[0]].slice(start, start + bytes)
+ }
+
+ if (!copy) // a slice, we need something to copy in to
+ dst = Buffer.allocUnsafe(len)
+
+ for (i = off[0]; i < this._bufs.length; i++) {
+ l = this._bufs[i].length - start
+
+ if (bytes > l) {
+ this._bufs[i].copy(dst, bufoff, start)
+ } else {
+ this._bufs[i].copy(dst, bufoff, start, start + bytes)
+ break
+ }
+
+ bufoff += l
+ bytes -= l
+
+ if (start)
+ start = 0
+ }
+
+ return dst
+}
+
+BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
+ start = start || 0
+ end = end || this.length
+
+ if (start < 0)
+ start += this.length
+ if (end < 0)
+ end += this.length
+
+ var startOffset = this._offset(start)
+ , endOffset = this._offset(end)
+ , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
+
+ if (endOffset[1] == 0)
+ buffers.pop()
+ else
+ buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1])
+
+ if (startOffset[1] != 0)
+ buffers[0] = buffers[0].slice(startOffset[1])
+
+ return new BufferList(buffers)
+}
+
+BufferList.prototype.toString = function toString (encoding, start, end) {
+ return this.slice(start, end).toString(encoding)
+}
+
+BufferList.prototype.consume = function consume (bytes) {
+ while (this._bufs.length) {
+ if (bytes >= this._bufs[0].length) {
+ bytes -= this._bufs[0].length
+ this.length -= this._bufs[0].length
+ this._bufs.shift()
+ } else {
+ this._bufs[0] = this._bufs[0].slice(bytes)
+ this.length -= bytes
+ break
+ }
+ }
+ return this
+}
+
+
+BufferList.prototype.duplicate = function duplicate () {
+ var i = 0
+ , copy = new BufferList()
+
+ for (; i < this._bufs.length; i++)
+ copy.append(this._bufs[i])
+
+ return copy
+}
+
+
+BufferList.prototype.destroy = function destroy () {
+ this._bufs.length = 0
+ this.length = 0
+ this.push(null)
+}
+
+
+;(function () {
+ var methods = {
+ 'readDoubleBE' : 8
+ , 'readDoubleLE' : 8
+ , 'readFloatBE' : 4
+ , 'readFloatLE' : 4
+ , 'readInt32BE' : 4
+ , 'readInt32LE' : 4
+ , 'readUInt32BE' : 4
+ , 'readUInt32LE' : 4
+ , 'readInt16BE' : 2
+ , 'readInt16LE' : 2
+ , 'readUInt16BE' : 2
+ , 'readUInt16LE' : 2
+ , 'readInt8' : 1
+ , 'readUInt8' : 1
+ }
+
+ for (var m in methods) {
+ (function (m) {
+ BufferList.prototype[m] = function (offset) {
+ return this.slice(offset, offset + methods[m])[m](0)
+ }
+ }(m))
+ }
+}())
+
+
+module.exports = BufferList
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/.travis.yml b/Nodejs/node_modules/bl/node_modules/readable-stream/.travis.yml
new file mode 100644
index 0000000..f62cdac
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/.travis.yml
@@ -0,0 +1,34 @@
+sudo: false
+language: node_js
+before_install:
+ - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ include:
+ - node_js: '0.8'
+ env: NPM_LEGACY=true
+ - node_js: '0.10'
+ env: NPM_LEGACY=true
+ - node_js: '0.11'
+ env: NPM_LEGACY=true
+ - node_js: '0.12'
+ env: NPM_LEGACY=true
+ - node_js: 1
+ env: NPM_LEGACY=true
+ - node_js: 2
+ env: NPM_LEGACY=true
+ - node_js: 3
+ env: NPM_LEGACY=true
+ - node_js: 4
+ - node_js: 5
+ - node_js: 6
+ - node_js: 7
+ - node_js: 8
+ - node_js: 9
+script: "npm run test"
+env:
+ global:
+ - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
+ - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md b/Nodejs/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md
new file mode 100644
index 0000000..f478d58
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/CONTRIBUTING.md
@@ -0,0 +1,38 @@
+# Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+* (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+* (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+* (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+* (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
+
+## Moderation Policy
+
+The [Node.js Moderation Policy] applies to this WG.
+
+## Code of Conduct
+
+The [Node.js Code of Conduct][] applies to this WG.
+
+[Node.js Code of Conduct]:
+https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
+[Node.js Moderation Policy]:
+https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md b/Nodejs/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md
new file mode 100644
index 0000000..16ffb93
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/GOVERNANCE.md
@@ -0,0 +1,136 @@
+### Streams Working Group
+
+The Node.js Streams is jointly governed by a Working Group
+(WG)
+that is responsible for high-level guidance of the project.
+
+The WG has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+* Conduct guidelines
+* Maintaining the list of additional Collaborators
+
+For the current list of WG members, see the project
+[README.md](./README.md#current-project-team-members).
+
+### Collaborators
+
+The readable-stream GitHub repository is
+maintained by the WG and additional Collaborators who are added by the
+WG on an ongoing basis.
+
+Individuals making significant and valuable contributions are made
+Collaborators and given commit-access to the project. These
+individuals are identified by the WG and their addition as
+Collaborators is discussed during the WG meeting.
+
+_Note:_ If you make a significant contribution and are not considered
+for commit-access log an issue or contact a WG member directly and it
+will be brought up in the next WG meeting.
+
+Modifications of the contents of the readable-stream repository are
+made on
+a collaborative basis. Anybody with a GitHub account may propose a
+modification via pull request and it will be considered by the project
+Collaborators. All pull requests must be reviewed and accepted by a
+Collaborator with sufficient expertise who is able to take full
+responsibility for the change. In the case of pull requests proposed
+by an existing Collaborator, an additional Collaborator is required
+for sign-off. Consensus should be sought if additional Collaborators
+participate and there is disagreement around a particular
+modification. See _Consensus Seeking Process_ below for further detail
+on the consensus model used for governance.
+
+Collaborators may opt to elevate significant or controversial
+modifications, or modifications that have not found consensus to the
+WG for discussion by assigning the ***WG-agenda*** tag to a pull
+request or issue. The WG should serve as the final arbiter where
+required.
+
+For the current list of Collaborators, see the project
+[README.md](./README.md#members).
+
+### WG Membership
+
+WG seats are not time-limited. There is no fixed size of the WG.
+However, the expected target is between 6 and 12, to ensure adequate
+coverage of important areas of expertise, balanced with the ability to
+make decisions efficiently.
+
+There is no specific set of requirements or qualifications for WG
+membership beyond these rules.
+
+The WG may add additional members to the WG by unanimous consensus.
+
+A WG member may be removed from the WG by voluntary resignation, or by
+unanimous consensus of all other WG members.
+
+Changes to WG membership should be posted in the agenda, and may be
+suggested as any other agenda item (see "WG Meetings" below).
+
+If an addition or removal is proposed during a meeting, and the full
+WG is not in attendance to participate, then the addition or removal
+is added to the agenda for the subsequent meeting. This is to ensure
+that all members are given the opportunity to participate in all
+membership decisions. If a WG member is unable to attend a meeting
+where a planned membership decision is being made, then their consent
+is assumed.
+
+No more than 1/3 of the WG members may be affiliated with the same
+employer. If removal or resignation of a WG member, or a change of
+employment by a WG member, creates a situation where more than 1/3 of
+the WG membership shares an employer, then the situation must be
+immediately remedied by the resignation or removal of one or more WG
+members affiliated with the over-represented employer(s).
+
+### WG Meetings
+
+The WG meets occasionally on a Google Hangout On Air. A designated moderator
+approved by the WG runs the meeting. Each meeting should be
+published to YouTube.
+
+Items are added to the WG agenda that are considered contentious or
+are modifications of governance, contribution policy, WG membership,
+or release process.
+
+The intention of the agenda is not to approve or review all patches;
+that should happen continuously on GitHub and be handled by the larger
+group of Collaborators.
+
+Any community member or contributor can ask that something be added to
+the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
+WG member or the moderator can add the item to the agenda by adding
+the ***WG-agenda*** tag to the issue.
+
+Prior to each WG meeting the moderator will share the Agenda with
+members of the WG. WG members can add any items they like to the
+agenda at the beginning of each meeting. The moderator and the WG
+cannot veto or remove items.
+
+The WG may invite persons or representatives from certain projects to
+participate in a non-voting capacity.
+
+The moderator is responsible for summarizing the discussion of each
+agenda item and sends it as a pull request after the meeting.
+
+### Consensus Seeking Process
+
+The WG follows a
+[Consensus
+Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
+decision-making model.
+
+When an agenda item has appeared to reach a consensus the moderator
+will ask "Does anyone object?" as a final call for dissent from the
+consensus.
+
+If an agenda item cannot reach a consensus a WG member can call for
+either a closing vote or a vote to table the issue to the next
+meeting. The call for a vote must be seconded by a majority of the WG
+or else the discussion will continue. Simple majority wins.
+
+Note that changes to WG membership require a majority consensus. See
+"WG Membership" above.
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/LICENSE b/Nodejs/node_modules/bl/node_modules/readable-stream/LICENSE
new file mode 100644
index 0000000..2873b3b
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/LICENSE
@@ -0,0 +1,47 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/README.md b/Nodejs/node_modules/bl/node_modules/readable-stream/README.md
new file mode 100644
index 0000000..23fe3f3
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/README.md
@@ -0,0 +1,58 @@
+# readable-stream
+
+***Node-core v8.11.1 streams for userland*** [](https://travis-ci.org/nodejs/readable-stream)
+
+
+[](https://nodei.co/npm/readable-stream/)
+[](https://nodei.co/npm/readable-stream/)
+
+
+[](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
+
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+# Streams Working Group
+
+`readable-stream` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+
+## Team Members
+
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>
+ - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>
+ - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>
+ - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>
+* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>
+ - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
+* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com>
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/Nodejs/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
new file mode 100644
index 0000000..83275f1
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
@@ -0,0 +1,60 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+ but, we lose the opportunity to change the model
+ may not be backwards incompatible (double check keys)
+
+ **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+ * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
+
+
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/duplex-browser.js b/Nodejs/node_modules/bl/node_modules/readable-stream/duplex-browser.js
new file mode 100644
index 0000000..f8b2db8
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/duplex-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_duplex.js');
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/duplex.js b/Nodejs/node_modules/bl/node_modules/readable-stream/duplex.js
new file mode 100644
index 0000000..46924cb
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/duplex.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Duplex
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000..57003c3
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,131 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+/**/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) {
+ keys.push(key);
+ }return keys;
+};
+/* */
+
+module.exports = Duplex;
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+{
+ // avoid scope creep, the keys array can then be collected
+ var keys = objectKeys(Writable.prototype);
+ for (var v = 0; v < keys.length; v++) {
+ var method = keys[v];
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
+ }
+}
+
+function Duplex(options) {
+ if (!(this instanceof Duplex)) return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false) this.readable = false;
+
+ if (options && options.writable === false) this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended) return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ pna.nextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+ self.end();
+}
+
+Object.defineProperty(Duplex.prototype, 'destroyed', {
+ get: function () {
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed && this._writableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ this._writableState.destroyed = value;
+ }
+});
+
+Duplex.prototype._destroy = function (err, cb) {
+ this.push(null);
+ this.end();
+
+ pna.nextTick(cb, err);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000..612edb4
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,47 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough)) return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+ cb(null, chunk);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000..0f80764
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,1019 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+module.exports = Readable;
+
+/**/
+var isArray = require('isarray');
+/* */
+
+/**/
+var Duplex;
+/* */
+
+Readable.ReadableState = ReadableState;
+
+/**/
+var EE = require('events').EventEmitter;
+
+var EElistenerCount = function (emitter, type) {
+ return emitter.listeners(type).length;
+};
+/* */
+
+/**/
+var Stream = require('./internal/streams/stream');
+/* */
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/* */
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+/**/
+var debugUtil = require('util');
+var debug = void 0;
+if (debugUtil && debugUtil.debuglog) {
+ debug = debugUtil.debuglog('stream');
+} else {
+ debug = function () {};
+}
+/* */
+
+var BufferList = require('./internal/streams/BufferList');
+var destroyImpl = require('./internal/streams/destroy');
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
+
+function prependListener(emitter, event, fn) {
+ // Sadly this is not cacheable as some libraries bundle their own
+ // event emitter implementation with them.
+ if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
+
+ // This is a hack to make sure that our error handler is attached before any
+ // userland ones. NEVER DO THIS. This is here only because this code needs
+ // to continue to work with older versions of Node.js that do not include
+ // the prependListener() method. The goal is to eventually remove this hack.
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
+}
+
+function ReadableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ var isDuplex = stream instanceof Duplex;
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ var readableHwm = options.readableHighWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = Math.floor(this.highWaterMark);
+
+ // A linked list is used to store data chunks instead of an array because the
+ // linked list can remove elements from the beginning faster than
+ // array.shift()
+ this.buffer = new BufferList();
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = null;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // a flag to be able to tell if the event 'readable'/'data' is emitted
+ // immediately, or on a later tick. We set this to true at first, because
+ // any actions that shouldn't happen until "later" should generally also
+ // not happen before the first read call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+ this.resumeScheduled = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+
+function Readable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ if (!(this instanceof Readable)) return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ if (options) {
+ if (typeof options.read === 'function') this._read = options.read;
+
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+ }
+
+ Stream.call(this);
+}
+
+Object.defineProperty(Readable.prototype, 'destroyed', {
+ get: function () {
+ if (this._readableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._readableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ }
+});
+
+Readable.prototype.destroy = destroyImpl.destroy;
+Readable.prototype._undestroy = destroyImpl.undestroy;
+Readable.prototype._destroy = function (err, cb) {
+ this.push(null);
+ cb(err);
+};
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+ var state = this._readableState;
+ var skipChunkCheck;
+
+ if (!state.objectMode) {
+ if (typeof chunk === 'string') {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = Buffer.from(chunk, encoding);
+ encoding = '';
+ }
+ skipChunkCheck = true;
+ }
+ } else {
+ skipChunkCheck = true;
+ }
+
+ return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function (chunk) {
+ return readableAddChunk(this, chunk, null, true, false);
+};
+
+function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
+ var state = stream._readableState;
+ if (chunk === null) {
+ state.reading = false;
+ onEofChunk(stream, state);
+ } else {
+ var er;
+ if (!skipChunkCheck) er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+
+ if (addToFront) {
+ if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
+ } else if (state.ended) {
+ stream.emit('error', new Error('stream.push() after EOF'));
+ } else {
+ state.reading = false;
+ if (state.decoder && !encoding) {
+ chunk = state.decoder.write(chunk);
+ if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
+ } else {
+ addChunk(stream, state, chunk, false);
+ }
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ }
+ }
+
+ return needMoreData(state);
+}
+
+function addChunk(stream, state, chunk, addToFront) {
+ if (state.flowing && state.length === 0 && !state.sync) {
+ stream.emit('data', chunk);
+ stream.read(0);
+ } else {
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+
+ if (state.needReadable) emitReadable(stream);
+ }
+ maybeReadMore(stream, state);
+}
+
+function chunkInvalid(state, chunk) {
+ var er;
+ if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+}
+
+Readable.prototype.isPaused = function () {
+ return this._readableState.flowing === false;
+};
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+ this._readableState.encoding = enc;
+ return this;
+};
+
+// Don't raise the hwm > 8MB
+var MAX_HWM = 0x800000;
+function computeNewHighWaterMark(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2 to prevent increasing hwm excessively in
+ // tiny amounts
+ n--;
+ n |= n >>> 1;
+ n |= n >>> 2;
+ n |= n >>> 4;
+ n |= n >>> 8;
+ n |= n >>> 16;
+ n++;
+ }
+ return n;
+}
+
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function howMuchToRead(n, state) {
+ if (n <= 0 || state.length === 0 && state.ended) return 0;
+ if (state.objectMode) return 1;
+ if (n !== n) {
+ // Only flow one buffer at a time
+ if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
+ }
+ // If we're asking for more than the current hwm, then raise the hwm.
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
+ if (n <= state.length) return n;
+ // Don't have enough
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ }
+ return state.length;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function (n) {
+ debug('read', n);
+ n = parseInt(n, 10);
+ var state = this._readableState;
+ var nOrig = n;
+
+ if (n !== 0) state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
+ debug('read: emitReadable', state.length, state.ended);
+ if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0) endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+ debug('need readable', doRead);
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
+ doRead = true;
+ debug('length less than watermark', doRead);
+ }
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading) {
+ doRead = false;
+ debug('reading or ended', doRead);
+ } else if (doRead) {
+ debug('do read');
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0) state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (!state.reading) n = howMuchToRead(nOrig, state);
+ }
+
+ var ret;
+ if (n > 0) ret = fromList(n, state);else ret = null;
+
+ if (ret === null) {
+ state.needReadable = true;
+ n = 0;
+ } else {
+ state.length -= n;
+ }
+
+ if (state.length === 0) {
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (!state.ended) state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended) endReadable(this);
+ }
+
+ if (ret !== null) this.emit('data', ret);
+
+ return ret;
+};
+
+function onEofChunk(stream, state) {
+ if (state.ended) return;
+ if (state.decoder) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // emit 'readable' now to make sure it gets picked up.
+ emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ debug('emitReadable', state.flowing);
+ state.emittedReadable = true;
+ if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
+ }
+}
+
+function emitReadable_(stream) {
+ debug('emit readable');
+ stream.emit('readable');
+ flow(stream);
+}
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ pna.nextTick(maybeReadMore_, stream, state);
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
+ debug('maybeReadMore read 0');
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;else len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function (n) {
+ this.emit('error', new Error('_read() is not implemented'));
+};
+
+Readable.prototype.pipe = function (dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+
+ var endFn = doEnd ? onend : unpipe;
+ if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable, unpipeInfo) {
+ debug('onunpipe');
+ if (readable === src) {
+ if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
+ unpipeInfo.hasUnpiped = true;
+ cleanup();
+ }
+ }
+ }
+
+ function onend() {
+ debug('onend');
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ var cleanedUp = false;
+ function cleanup() {
+ debug('cleanup');
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', unpipe);
+ src.removeListener('data', ondata);
+
+ cleanedUp = true;
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+ }
+
+ // If the user pushes more data while we're writing to dest then we'll end up
+ // in ondata again. However, we only want to increase awaitDrain once because
+ // dest will only emit one 'drain' event for the multiple writes.
+ // => Introduce a guard on increasing awaitDrain.
+ var increasedAwaitDrain = false;
+ src.on('data', ondata);
+ function ondata(chunk) {
+ debug('ondata');
+ increasedAwaitDrain = false;
+ var ret = dest.write(chunk);
+ if (false === ret && !increasedAwaitDrain) {
+ // If the user unpiped during `dest.write()`, it is possible
+ // to get stuck in a permanently paused state if that write
+ // also returned false.
+ // => Check whether `dest` is still a piping destination.
+ if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
+ debug('false write response, pause', src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
+ increasedAwaitDrain = true;
+ }
+ src.pause();
+ }
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ debug('onerror', er);
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
+ }
+
+ // Make sure our error handler is attached before userland ones.
+ prependListener(dest, 'error', onerror);
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ debug('onfinish');
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ debug('unpipe');
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ debug('pipe resume');
+ src.resume();
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function () {
+ var state = src._readableState;
+ debug('pipeOnDrain', state.awaitDrain);
+ if (state.awaitDrain) state.awaitDrain--;
+ if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+ state.flowing = true;
+ flow(src);
+ }
+ };
+}
+
+Readable.prototype.unpipe = function (dest) {
+ var state = this._readableState;
+ var unpipeInfo = { hasUnpiped: false };
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0) return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes) return this;
+
+ if (!dest) dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ if (dest) dest.emit('unpipe', this, unpipeInfo);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+
+ for (var i = 0; i < len; i++) {
+ dests[i].emit('unpipe', this, unpipeInfo);
+ }return this;
+ }
+
+ // try to find the right one.
+ var index = indexOf(state.pipes, dest);
+ if (index === -1) return this;
+
+ state.pipes.splice(index, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this, unpipeInfo);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ if (ev === 'data') {
+ // Start flowing on next tick if stream isn't explicitly paused
+ if (this._readableState.flowing !== false) this.resume();
+ } else if (ev === 'readable') {
+ var state = this._readableState;
+ if (!state.endEmitted && !state.readableListening) {
+ state.readableListening = state.needReadable = true;
+ state.emittedReadable = false;
+ if (!state.reading) {
+ pna.nextTick(nReadingNextTick, this);
+ } else if (state.length) {
+ emitReadable(this);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+function nReadingNextTick(self) {
+ debug('readable nexttick read 0');
+ self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+ var state = this._readableState;
+ if (!state.flowing) {
+ debug('resume');
+ state.flowing = true;
+ resume(this, state);
+ }
+ return this;
+};
+
+function resume(stream, state) {
+ if (!state.resumeScheduled) {
+ state.resumeScheduled = true;
+ pna.nextTick(resume_, stream, state);
+ }
+}
+
+function resume_(stream, state) {
+ if (!state.reading) {
+ debug('resume read 0');
+ stream.read(0);
+ }
+
+ state.resumeScheduled = false;
+ state.awaitDrain = 0;
+ stream.emit('resume');
+ flow(stream);
+ if (state.flowing && !state.reading) stream.read(0);
+}
+
+Readable.prototype.pause = function () {
+ debug('call pause flowing=%j', this._readableState.flowing);
+ if (false !== this._readableState.flowing) {
+ debug('pause');
+ this._readableState.flowing = false;
+ this.emit('pause');
+ }
+ return this;
+};
+
+function flow(stream) {
+ var state = stream._readableState;
+ debug('flow', state.flowing);
+ while (state.flowing && stream.read() !== null) {}
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+ var _this = this;
+
+ var state = this._readableState;
+ var paused = false;
+
+ stream.on('end', function () {
+ debug('wrapped end');
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) _this.push(chunk);
+ }
+
+ _this.push(null);
+ });
+
+ stream.on('data', function (chunk) {
+ debug('wrapped data');
+ if (state.decoder) chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+
+ var ret = _this.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (this[i] === undefined && typeof stream[i] === 'function') {
+ this[i] = function (method) {
+ return function () {
+ return stream[method].apply(stream, arguments);
+ };
+ }(i);
+ }
+ }
+
+ // proxy certain important events.
+ for (var n = 0; n < kProxyEvents.length; n++) {
+ stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
+ }
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ this._read = function (n) {
+ debug('wrapped _read', n);
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+
+ return this;
+};
+
+Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._readableState.highWaterMark;
+ }
+});
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromList(n, state) {
+ // nothing buffered
+ if (state.length === 0) return null;
+
+ var ret;
+ if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
+ // read it all, truncate the list
+ if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
+ state.buffer.clear();
+ } else {
+ // read part of list
+ ret = fromListPartial(n, state.buffer, state.decoder);
+ }
+
+ return ret;
+}
+
+// Extracts only enough buffered data to satisfy the amount requested.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromListPartial(n, list, hasStrings) {
+ var ret;
+ if (n < list.head.data.length) {
+ // slice is the same for buffers and strings
+ ret = list.head.data.slice(0, n);
+ list.head.data = list.head.data.slice(n);
+ } else if (n === list.head.data.length) {
+ // first chunk is a perfect match
+ ret = list.shift();
+ } else {
+ // result spans more than one buffer
+ ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
+ }
+ return ret;
+}
+
+// Copies a specified amount of characters from the list of buffered data
+// chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBufferString(n, list) {
+ var p = list.head;
+ var c = 1;
+ var ret = p.data;
+ n -= ret.length;
+ while (p = p.next) {
+ var str = p.data;
+ var nb = n > str.length ? str.length : n;
+ if (nb === str.length) ret += str;else ret += str.slice(0, n);
+ n -= nb;
+ if (n === 0) {
+ if (nb === str.length) {
+ ++c;
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
+ } else {
+ list.head = p;
+ p.data = str.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ list.length -= c;
+ return ret;
+}
+
+// Copies a specified amount of bytes from the list of buffered data chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBuffer(n, list) {
+ var ret = Buffer.allocUnsafe(n);
+ var p = list.head;
+ var c = 1;
+ p.data.copy(ret);
+ n -= p.data.length;
+ while (p = p.next) {
+ var buf = p.data;
+ var nb = n > buf.length ? buf.length : n;
+ buf.copy(ret, ret.length - n, 0, nb);
+ n -= nb;
+ if (n === 0) {
+ if (nb === buf.length) {
+ ++c;
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
+ } else {
+ list.head = p;
+ p.data = buf.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ list.length -= c;
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
+
+ if (!state.endEmitted) {
+ state.ended = true;
+ pna.nextTick(endReadableNT, state, stream);
+ }
+}
+
+function endReadableNT(state, stream) {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+}
+
+function indexOf(xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000..fcfc105
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,214 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+util.inherits(Transform, Duplex);
+
+function afterTransform(er, data) {
+ var ts = this._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb) {
+ return this.emit('error', new Error('write callback called multiple times'));
+ }
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (data != null) // single equals check for both `null` and `undefined`
+ this.push(data);
+
+ cb(er);
+
+ var rs = this._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ this._read(rs.highWaterMark);
+ }
+}
+
+function Transform(options) {
+ if (!(this instanceof Transform)) return new Transform(options);
+
+ Duplex.call(this, options);
+
+ this._transformState = {
+ afterTransform: afterTransform.bind(this),
+ needTransform: false,
+ transforming: false,
+ writecb: null,
+ writechunk: null,
+ writeencoding: null
+ };
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ if (options) {
+ if (typeof options.transform === 'function') this._transform = options.transform;
+
+ if (typeof options.flush === 'function') this._flush = options.flush;
+ }
+
+ // When the writable side finishes, then flush out anything remaining.
+ this.on('prefinish', prefinish);
+}
+
+function prefinish() {
+ var _this = this;
+
+ if (typeof this._flush === 'function') {
+ this._flush(function (er, data) {
+ done(_this, er, data);
+ });
+ } else {
+ done(this, null, null);
+ }
+}
+
+Transform.prototype.push = function (chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function (chunk, encoding, cb) {
+ throw new Error('_transform() is not implemented');
+};
+
+Transform.prototype._write = function (chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function (n) {
+ var ts = this._transformState;
+
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+Transform.prototype._destroy = function (err, cb) {
+ var _this2 = this;
+
+ Duplex.prototype._destroy.call(this, err, function (err2) {
+ cb(err2);
+ _this2.emit('close');
+ });
+};
+
+function done(stream, er, data) {
+ if (er) return stream.emit('error', er);
+
+ if (data != null) // single equals check for both `null` and `undefined`
+ stream.push(data);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
+
+ if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
+
+ return stream.push(null);
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000..b0b0220
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,687 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+module.exports = Writable;
+
+/* */
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+ this.next = null;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+ var _this = this;
+
+ this.next = null;
+ this.entry = null;
+ this.finish = function () {
+ onCorkedFinish(_this, state);
+ };
+}
+/* */
+
+/**/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
+/* */
+
+/**/
+var Duplex;
+/* */
+
+Writable.WritableState = WritableState;
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+/**/
+var internalUtil = {
+ deprecate: require('util-deprecate')
+};
+/* */
+
+/**/
+var Stream = require('./internal/streams/stream');
+/* */
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/* */
+
+var destroyImpl = require('./internal/streams/destroy');
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WritableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ var isDuplex = stream instanceof Duplex;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var writableHwm = options.writableHighWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = Math.floor(this.highWaterMark);
+
+ // if _final has been called
+ this.finalCalled = false;
+
+ // drain event flag.
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function (er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+
+ // count buffered requests
+ this.bufferedRequestCount = 0;
+
+ // allocate the first CorkedRequest, there is always
+ // one allocated and free to use, and we maintain at most two
+ this.corkedRequestsFree = new CorkedRequest(this);
+}
+
+WritableState.prototype.getBuffer = function getBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+
+(function () {
+ try {
+ Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: internalUtil.deprecate(function () {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
+ });
+ } catch (_) {}
+})();
+
+// Test _writableState for inheritance to account for Duplex streams,
+// whose prototype chain only points to Readable.
+var realHasInstance;
+if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
+ realHasInstance = Function.prototype[Symbol.hasInstance];
+ Object.defineProperty(Writable, Symbol.hasInstance, {
+ value: function (object) {
+ if (realHasInstance.call(this, object)) return true;
+ if (this !== Writable) return false;
+
+ return object && object._writableState instanceof WritableState;
+ }
+ });
+} else {
+ realHasInstance = function (object) {
+ return object instanceof this;
+ };
+}
+
+function Writable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, too.
+ // `realHasInstance` is necessary because using plain `instanceof`
+ // would return false, as no `_writableState` property is attached.
+
+ // Trying to use the custom `instanceof` for Writable here will also break the
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
+ // `_writableState` that would lead to infinite recursion.
+ if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
+ return new Writable(options);
+ }
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ if (options) {
+ if (typeof options.write === 'function') this._write = options.write;
+
+ if (typeof options.writev === 'function') this._writev = options.writev;
+
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+
+ if (typeof options.final === 'function') this._final = options.final;
+ }
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+ this.emit('error', new Error('Cannot pipe, not readable'));
+};
+
+function writeAfterEnd(stream, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+}
+
+// Checks that a user-supplied chunk is valid, especially for the particular
+// mode the stream is in. Currently this means that `null` is never accepted
+// and undefined/non-string values are only allowed in object mode.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+ var er = false;
+
+ if (chunk === null) {
+ er = new TypeError('May not write null values to stream');
+ } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ if (er) {
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function (chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+ var isBuf = !state.objectMode && _isUint8Array(chunk);
+
+ if (isBuf && !Buffer.isBuffer(chunk)) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+
+ if (typeof cb !== 'function') cb = nop;
+
+ if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+ }
+
+ return ret;
+};
+
+Writable.prototype.cork = function () {
+ var state = this._writableState;
+
+ state.corked++;
+};
+
+Writable.prototype.uncork = function () {
+ var state = this._writableState;
+
+ if (state.corked) {
+ state.corked--;
+
+ if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
+ this._writableState.defaultEncoding = encoding;
+ return this;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+ chunk = Buffer.from(chunk, encoding);
+ }
+ return chunk;
+}
+
+Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
+ if (!isBuf) {
+ var newChunk = decodeChunk(state, chunk, encoding);
+ if (chunk !== newChunk) {
+ isBuf = true;
+ encoding = 'buffer';
+ chunk = newChunk;
+ }
+ }
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret) state.needDrain = true;
+
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = {
+ chunk: chunk,
+ encoding: encoding,
+ isBuf: isBuf,
+ callback: cb,
+ next: null
+ };
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ state.bufferedRequestCount += 1;
+ } else {
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
+
+ return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
+
+ if (sync) {
+ // defer the callback if we are being called synchronously
+ // to avoid piling up things on the stack
+ pna.nextTick(cb, er);
+ // this can emit finish, and it will always happen
+ // after error
+ pna.nextTick(finishMaybe, stream, state);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ } else {
+ // the caller expect this to happen before if
+ // it is async
+ cb(er);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ // this can emit finish, but finish must
+ // always follow error
+ finishMaybe(stream, state);
+ }
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er) onwriteError(stream, state, sync, er, cb);else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(state);
+
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+ clearBuffer(stream, state);
+ }
+
+ if (sync) {
+ /**/
+ asyncWrite(afterWrite, stream, state, finished, cb);
+ /* */
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished) onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
+
+ if (stream._writev && entry && entry.next) {
+ // Fast case, write everything using _writev()
+ var l = state.bufferedRequestCount;
+ var buffer = new Array(l);
+ var holder = state.corkedRequestsFree;
+ holder.entry = entry;
+
+ var count = 0;
+ var allBuffers = true;
+ while (entry) {
+ buffer[count] = entry;
+ if (!entry.isBuf) allBuffers = false;
+ entry = entry.next;
+ count += 1;
+ }
+ buffer.allBuffers = allBuffers;
+
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+ // doWrite is almost always async, defer these to save a bit of time
+ // as the hot path ends with doWrite
+ state.pendingcb++;
+ state.lastBufferedRequest = null;
+ if (holder.next) {
+ state.corkedRequestsFree = holder.next;
+ holder.next = null;
+ } else {
+ state.corkedRequestsFree = new CorkedRequest(state);
+ }
+ state.bufferedRequestCount = 0;
+ } else {
+ // Slow case, write chunks one-by-one
+ while (entry) {
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ entry = entry.next;
+ state.bufferedRequestCount--;
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ break;
+ }
+ }
+
+ if (entry === null) state.lastBufferedRequest = null;
+ }
+
+ state.bufferedRequest = entry;
+ state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function (chunk, encoding, cb) {
+ cb(new Error('_write() is not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function (chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+
+function needFinish(state) {
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+function callFinal(stream, state) {
+ stream._final(function (err) {
+ state.pendingcb--;
+ if (err) {
+ stream.emit('error', err);
+ }
+ state.prefinished = true;
+ stream.emit('prefinish');
+ finishMaybe(stream, state);
+ });
+}
+function prefinish(stream, state) {
+ if (!state.prefinished && !state.finalCalled) {
+ if (typeof stream._final === 'function') {
+ state.pendingcb++;
+ state.finalCalled = true;
+ pna.nextTick(callFinal, stream, state);
+ } else {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+ }
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(state);
+ if (need) {
+ prefinish(stream, state);
+ if (state.pendingcb === 0) {
+ state.finished = true;
+ stream.emit('finish');
+ }
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
+ }
+ state.ended = true;
+ stream.writable = false;
+}
+
+function onCorkedFinish(corkReq, state, err) {
+ var entry = corkReq.entry;
+ corkReq.entry = null;
+ while (entry) {
+ var cb = entry.callback;
+ state.pendingcb--;
+ cb(err);
+ entry = entry.next;
+ }
+ if (state.corkedRequestsFree) {
+ state.corkedRequestsFree.next = corkReq;
+ } else {
+ state.corkedRequestsFree = corkReq;
+ }
+}
+
+Object.defineProperty(Writable.prototype, 'destroyed', {
+ get: function () {
+ if (this._writableState === undefined) {
+ return false;
+ }
+ return this._writableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._writableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._writableState.destroyed = value;
+ }
+});
+
+Writable.prototype.destroy = destroyImpl.destroy;
+Writable.prototype._undestroy = destroyImpl.undestroy;
+Writable.prototype._destroy = function (err, cb) {
+ this.end();
+ cb(err);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/BufferList.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/BufferList.js
new file mode 100644
index 0000000..aefc68b
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/BufferList.js
@@ -0,0 +1,79 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Buffer = require('safe-buffer').Buffer;
+var util = require('util');
+
+function copyBuffer(src, target, offset) {
+ src.copy(target, offset);
+}
+
+module.exports = function () {
+ function BufferList() {
+ _classCallCheck(this, BufferList);
+
+ this.head = null;
+ this.tail = null;
+ this.length = 0;
+ }
+
+ BufferList.prototype.push = function push(v) {
+ var entry = { data: v, next: null };
+ if (this.length > 0) this.tail.next = entry;else this.head = entry;
+ this.tail = entry;
+ ++this.length;
+ };
+
+ BufferList.prototype.unshift = function unshift(v) {
+ var entry = { data: v, next: this.head };
+ if (this.length === 0) this.tail = entry;
+ this.head = entry;
+ ++this.length;
+ };
+
+ BufferList.prototype.shift = function shift() {
+ if (this.length === 0) return;
+ var ret = this.head.data;
+ if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
+ --this.length;
+ return ret;
+ };
+
+ BufferList.prototype.clear = function clear() {
+ this.head = this.tail = null;
+ this.length = 0;
+ };
+
+ BufferList.prototype.join = function join(s) {
+ if (this.length === 0) return '';
+ var p = this.head;
+ var ret = '' + p.data;
+ while (p = p.next) {
+ ret += s + p.data;
+ }return ret;
+ };
+
+ BufferList.prototype.concat = function concat(n) {
+ if (this.length === 0) return Buffer.alloc(0);
+ if (this.length === 1) return this.head.data;
+ var ret = Buffer.allocUnsafe(n >>> 0);
+ var p = this.head;
+ var i = 0;
+ while (p) {
+ copyBuffer(p.data, ret, i);
+ i += p.data.length;
+ p = p.next;
+ }
+ return ret;
+ };
+
+ return BufferList;
+}();
+
+if (util && util.inspect && util.inspect.custom) {
+ module.exports.prototype[util.inspect.custom] = function () {
+ var obj = util.inspect({ length: this.length });
+ return this.constructor.name + ' ' + obj;
+ };
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js
new file mode 100644
index 0000000..5a0a0d8
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/destroy.js
@@ -0,0 +1,74 @@
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+// undocumented cb() API, needed for core, not for public API
+function destroy(err, cb) {
+ var _this = this;
+
+ var readableDestroyed = this._readableState && this._readableState.destroyed;
+ var writableDestroyed = this._writableState && this._writableState.destroyed;
+
+ if (readableDestroyed || writableDestroyed) {
+ if (cb) {
+ cb(err);
+ } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
+ pna.nextTick(emitErrorNT, this, err);
+ }
+ return this;
+ }
+
+ // we set destroyed to true before firing error callbacks in order
+ // to make it re-entrance safe in case destroy() is called within callbacks
+
+ if (this._readableState) {
+ this._readableState.destroyed = true;
+ }
+
+ // if this is a duplex stream mark the writable part as destroyed as well
+ if (this._writableState) {
+ this._writableState.destroyed = true;
+ }
+
+ this._destroy(err || null, function (err) {
+ if (!cb && err) {
+ pna.nextTick(emitErrorNT, _this, err);
+ if (_this._writableState) {
+ _this._writableState.errorEmitted = true;
+ }
+ } else if (cb) {
+ cb(err);
+ }
+ });
+
+ return this;
+}
+
+function undestroy() {
+ if (this._readableState) {
+ this._readableState.destroyed = false;
+ this._readableState.reading = false;
+ this._readableState.ended = false;
+ this._readableState.endEmitted = false;
+ }
+
+ if (this._writableState) {
+ this._writableState.destroyed = false;
+ this._writableState.ended = false;
+ this._writableState.ending = false;
+ this._writableState.finished = false;
+ this._writableState.errorEmitted = false;
+ }
+}
+
+function emitErrorNT(self, err) {
+ self.emit('error', err);
+}
+
+module.exports = {
+ destroy: destroy,
+ undestroy: undestroy
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js
new file mode 100644
index 0000000..9332a3f
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream-browser.js
@@ -0,0 +1 @@
+module.exports = require('events').EventEmitter;
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js
new file mode 100644
index 0000000..ce2ad5b
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/lib/internal/streams/stream.js
@@ -0,0 +1 @@
+module.exports = require('stream');
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/LICENSE b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/LICENSE
new file mode 100644
index 0000000..0c068ce
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/README.md b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/README.md
new file mode 100644
index 0000000..e9a81af
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/README.md
@@ -0,0 +1,584 @@
+# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/safe-buffer
+[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
+[npm-url]: https://npmjs.org/package/safe-buffer
+[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
+[downloads-url]: https://npmjs.org/package/safe-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### Safer Node.js Buffer API
+
+**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
+`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
+
+**Uses the built-in implementation when available.**
+
+## install
+
+```
+npm install safe-buffer
+```
+
+## usage
+
+The goal of this package is to provide a safe replacement for the node.js `Buffer`.
+
+It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
+the top of your node.js modules:
+
+```js
+var Buffer = require('safe-buffer').Buffer
+
+// Existing buffer code will continue to work without issues:
+
+new Buffer('hey', 'utf8')
+new Buffer([1, 2, 3], 'utf8')
+new Buffer(obj)
+new Buffer(16) // create an uninitialized buffer (potentially unsafe)
+
+// But you can use these new explicit APIs to make clear what you want:
+
+Buffer.from('hey', 'utf8') // convert from many types to a Buffer
+Buffer.alloc(16) // create a zero-filled buffer (safe)
+Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
+```
+
+## api
+
+### Class Method: Buffer.from(array)
+
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+ // creates a new Buffer containing ASCII bytes
+ // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+ a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+ // Prints:
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+ // Prints:
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+ // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+ // 'auffer'
+console.log(buf2.toString());
+ // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+ // prints: this is a tést
+console.log(buf1.toString('ascii'));
+ // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+ // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+ //
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+ //
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+ //
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+ //
+ // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+ //
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+ const data = socket.read();
+ // allocate for retained data
+ const sb = Buffer.allocUnsafeSlow(10);
+ // copy the data into the new allocation
+ data.copy(sb, 0, 0, 10);
+ store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+ return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+ var data = ''
+ req.setEncoding('utf8')
+ req.on('data', function (chunk) {
+ data += chunk
+ })
+ req.on('end', function () {
+ var body = JSON.parse(data)
+ res.end(new Buffer(body.str).toString('hex'))
+ })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+ "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+ socket.on('message', function (message) {
+ message = JSON.parse(message)
+ if (message.type === 'echo') {
+ socket.send(message.data) // send back the user's message
+ }
+ })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts
new file mode 100644
index 0000000..e9fed80
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/index.d.ts
@@ -0,0 +1,187 @@
+declare module "safe-buffer" {
+ export class Buffer {
+ length: number
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ constructor (str: string, encoding?: string);
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ constructor (size: number);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: Uint8Array);
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ constructor (arrayBuffer: ArrayBuffer);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: any[]);
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ constructor (buffer: Buffer);
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ static from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ static from(buffer: Buffer): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ static from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ static isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ static isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ static byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ static concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ static compare(buf1: Buffer, buf2: Buffer): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initalizing
+ */
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafeSlow(size: number): Buffer;
+ }
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/index.js b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/index.js
new file mode 100644
index 0000000..22438da
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/index.js
@@ -0,0 +1,62 @@
+/* eslint-disable node/no-deprecated-api */
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+// alternative to using Object.keys for old browsers
+function copyProps (src, dst) {
+ for (var key in src) {
+ dst[key] = src[key]
+ }
+}
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+ module.exports = buffer
+} else {
+ // Copy properties from require('buffer')
+ copyProps(buffer, exports)
+ exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+// Copy static methods from Buffer
+copyProps(Buffer, SafeBuffer)
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+ if (typeof arg === 'number') {
+ throw new TypeError('Argument must not be a number')
+ }
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ var buf = Buffer(size)
+ if (fill !== undefined) {
+ if (typeof encoding === 'string') {
+ buf.fill(fill, encoding)
+ } else {
+ buf.fill(fill)
+ }
+ } else {
+ buf.fill(0)
+ }
+ return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return buffer.SlowBuffer(size)
+}
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/package.json b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/package.json
new file mode 100644
index 0000000..54c1dca
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/node_modules/safe-buffer/package.json
@@ -0,0 +1,62 @@
+{
+ "_from": "safe-buffer@~5.1.1",
+ "_id": "safe-buffer@5.1.2",
+ "_inBundle": false,
+ "_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "_location": "/bl/readable-stream/safe-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "safe-buffer@~5.1.1",
+ "name": "safe-buffer",
+ "escapedName": "safe-buffer",
+ "rawSpec": "~5.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~5.1.1"
+ },
+ "_requiredBy": [
+ "/bl/readable-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "_shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d",
+ "_spec": "safe-buffer@~5.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/bl/node_modules/readable-stream",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "http://feross.org"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/safe-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Safer Node.js Buffer API",
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^4.0.0"
+ },
+ "homepage": "https://github.com/feross/safe-buffer",
+ "keywords": [
+ "buffer",
+ "buffer allocate",
+ "node security",
+ "safe",
+ "safe-buffer",
+ "security",
+ "uninitialized"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "safe-buffer",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/safe-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && tape test/*.js"
+ },
+ "types": "index.d.ts",
+ "version": "5.1.2"
+}
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/package.json b/Nodejs/node_modules/bl/node_modules/readable-stream/package.json
new file mode 100644
index 0000000..2f18074
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/package.json
@@ -0,0 +1,81 @@
+{
+ "_from": "readable-stream@^2.3.5",
+ "_id": "readable-stream@2.3.7",
+ "_inBundle": false,
+ "_integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "_location": "/bl/readable-stream",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "readable-stream@^2.3.5",
+ "name": "readable-stream",
+ "escapedName": "readable-stream",
+ "rawSpec": "^2.3.5",
+ "saveSpec": null,
+ "fetchSpec": "^2.3.5"
+ },
+ "_requiredBy": [
+ "/bl"
+ ],
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "_shasum": "1eca1cf711aef814c04f62252a36a62f6cb23b57",
+ "_spec": "readable-stream@^2.3.5",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/bl",
+ "browser": {
+ "util": false,
+ "./readable.js": "./readable-browser.js",
+ "./writable.js": "./writable-browser.js",
+ "./duplex.js": "./duplex-browser.js",
+ "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
+ },
+ "bugs": {
+ "url": "https://github.com/nodejs/readable-stream/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ },
+ "deprecated": false,
+ "description": "Streams3, a user-land copy of the stream library from Node.js",
+ "devDependencies": {
+ "assert": "^1.4.0",
+ "babel-polyfill": "^6.9.1",
+ "buffer": "^4.9.0",
+ "lolex": "^2.3.2",
+ "nyc": "^6.4.0",
+ "tap": "^0.7.0",
+ "tape": "^4.8.0"
+ },
+ "homepage": "https://github.com/nodejs/readable-stream#readme",
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "license": "MIT",
+ "main": "readable.js",
+ "name": "readable-stream",
+ "nyc": {
+ "include": [
+ "lib/**.js"
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/readable-stream.git"
+ },
+ "scripts": {
+ "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+ "cover": "nyc npm test",
+ "report": "nyc report --reporter=lcov",
+ "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js"
+ },
+ "version": "2.3.7"
+}
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/passthrough.js b/Nodejs/node_modules/bl/node_modules/readable-stream/passthrough.js
new file mode 100644
index 0000000..ffd791d
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/passthrough.js
@@ -0,0 +1 @@
+module.exports = require('./readable').PassThrough
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/readable-browser.js b/Nodejs/node_modules/bl/node_modules/readable-stream/readable-browser.js
new file mode 100644
index 0000000..e503725
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/readable-browser.js
@@ -0,0 +1,7 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/readable.js b/Nodejs/node_modules/bl/node_modules/readable-stream/readable.js
new file mode 100644
index 0000000..ec89ec5
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/readable.js
@@ -0,0 +1,19 @@
+var Stream = require('stream');
+if (process.env.READABLE_STREAM === 'disable' && Stream) {
+ module.exports = Stream;
+ exports = module.exports = Stream.Readable;
+ exports.Readable = Stream.Readable;
+ exports.Writable = Stream.Writable;
+ exports.Duplex = Stream.Duplex;
+ exports.Transform = Stream.Transform;
+ exports.PassThrough = Stream.PassThrough;
+ exports.Stream = Stream;
+} else {
+ exports = module.exports = require('./lib/_stream_readable.js');
+ exports.Stream = Stream || exports;
+ exports.Readable = exports;
+ exports.Writable = require('./lib/_stream_writable.js');
+ exports.Duplex = require('./lib/_stream_duplex.js');
+ exports.Transform = require('./lib/_stream_transform.js');
+ exports.PassThrough = require('./lib/_stream_passthrough.js');
+}
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/transform.js b/Nodejs/node_modules/bl/node_modules/readable-stream/transform.js
new file mode 100644
index 0000000..b1baba2
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/transform.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Transform
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/writable-browser.js b/Nodejs/node_modules/bl/node_modules/readable-stream/writable-browser.js
new file mode 100644
index 0000000..ebdde6a
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/writable-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_writable.js');
diff --git a/Nodejs/node_modules/bl/node_modules/readable-stream/writable.js b/Nodejs/node_modules/bl/node_modules/readable-stream/writable.js
new file mode 100644
index 0000000..3211a6f
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/readable-stream/writable.js
@@ -0,0 +1,8 @@
+var Stream = require("stream")
+var Writable = require("./lib/_stream_writable.js")
+
+if (process.env.READABLE_STREAM === 'disable') {
+ module.exports = Stream && Stream.Writable || Writable
+} else {
+ module.exports = Writable
+}
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/.travis.yml b/Nodejs/node_modules/bl/node_modules/string_decoder/.travis.yml
new file mode 100644
index 0000000..3347a72
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/.travis.yml
@@ -0,0 +1,50 @@
+sudo: false
+language: node_js
+before_install:
+ - npm install -g npm@2
+ - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ include:
+ - node_js: '0.8'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.10'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.11'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.12'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 1
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 2
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 3
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 4
+ env: TASK=test
+ - node_js: 5
+ env: TASK=test
+ - node_js: 6
+ env: TASK=test
+ - node_js: 7
+ env: TASK=test
+ - node_js: 8
+ env: TASK=test
+ - node_js: 9
+ env: TASK=test
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/LICENSE b/Nodejs/node_modules/bl/node_modules/string_decoder/LICENSE
new file mode 100644
index 0000000..778edb2
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/LICENSE
@@ -0,0 +1,48 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/README.md b/Nodejs/node_modules/bl/node_modules/string_decoder/README.md
new file mode 100644
index 0000000..5fd5831
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/README.md
@@ -0,0 +1,47 @@
+# string_decoder
+
+***Node-core v8.9.4 string_decoder for userland***
+
+
+[](https://nodei.co/npm/string_decoder/)
+[](https://nodei.co/npm/string_decoder/)
+
+
+```bash
+npm install --save string_decoder
+```
+
+***Node-core string_decoder for userland***
+
+This package is a mirror of the string_decoder implementation in Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
+
+As of version 1.0.0 **string_decoder** uses semantic versioning.
+
+## Previous versions
+
+Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
+
+## Update
+
+The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
+
+## Streams Working Group
+
+`string_decoder` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+See [readable-stream](https://github.com/nodejs/readable-stream) for
+more details.
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/lib/string_decoder.js b/Nodejs/node_modules/bl/node_modules/string_decoder/lib/string_decoder.js
new file mode 100644
index 0000000..2e89e63
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/lib/string_decoder.js
@@ -0,0 +1,296 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+/* */
+
+var isEncoding = Buffer.isEncoding || function (encoding) {
+ encoding = '' + encoding;
+ switch (encoding && encoding.toLowerCase()) {
+ case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
+ return true;
+ default:
+ return false;
+ }
+};
+
+function _normalizeEncoding(enc) {
+ if (!enc) return 'utf8';
+ var retried;
+ while (true) {
+ switch (enc) {
+ case 'utf8':
+ case 'utf-8':
+ return 'utf8';
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return 'utf16le';
+ case 'latin1':
+ case 'binary':
+ return 'latin1';
+ case 'base64':
+ case 'ascii':
+ case 'hex':
+ return enc;
+ default:
+ if (retried) return; // undefined
+ enc = ('' + enc).toLowerCase();
+ retried = true;
+ }
+ }
+};
+
+// Do not cache `Buffer.isEncoding` when checking encoding names as some
+// modules monkey-patch it to support additional encodings
+function normalizeEncoding(enc) {
+ var nenc = _normalizeEncoding(enc);
+ if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
+ return nenc || enc;
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters.
+exports.StringDecoder = StringDecoder;
+function StringDecoder(encoding) {
+ this.encoding = normalizeEncoding(encoding);
+ var nb;
+ switch (this.encoding) {
+ case 'utf16le':
+ this.text = utf16Text;
+ this.end = utf16End;
+ nb = 4;
+ break;
+ case 'utf8':
+ this.fillLast = utf8FillLast;
+ nb = 4;
+ break;
+ case 'base64':
+ this.text = base64Text;
+ this.end = base64End;
+ nb = 3;
+ break;
+ default:
+ this.write = simpleWrite;
+ this.end = simpleEnd;
+ return;
+ }
+ this.lastNeed = 0;
+ this.lastTotal = 0;
+ this.lastChar = Buffer.allocUnsafe(nb);
+}
+
+StringDecoder.prototype.write = function (buf) {
+ if (buf.length === 0) return '';
+ var r;
+ var i;
+ if (this.lastNeed) {
+ r = this.fillLast(buf);
+ if (r === undefined) return '';
+ i = this.lastNeed;
+ this.lastNeed = 0;
+ } else {
+ i = 0;
+ }
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
+ return r || '';
+};
+
+StringDecoder.prototype.end = utf8End;
+
+// Returns only complete characters in a Buffer
+StringDecoder.prototype.text = utf8Text;
+
+// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
+StringDecoder.prototype.fillLast = function (buf) {
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
+ this.lastNeed -= buf.length;
+};
+
+// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
+// continuation byte. If an invalid byte is detected, -2 is returned.
+function utf8CheckByte(byte) {
+ if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
+ return byte >> 6 === 0x02 ? -1 : -2;
+}
+
+// Checks at most 3 bytes at the end of a Buffer in order to detect an
+// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
+// needed to complete the UTF-8 character (if applicable) are returned.
+function utf8CheckIncomplete(self, buf, i) {
+ var j = buf.length - 1;
+ if (j < i) return 0;
+ var nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 1;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 2;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) {
+ if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
+ }
+ return nb;
+ }
+ return 0;
+}
+
+// Validates as many continuation bytes for a multi-byte UTF-8 character as
+// needed or are available. If we see a non-continuation byte where we expect
+// one, we "replace" the validated continuation bytes we've seen so far with
+// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
+// behavior. The continuation byte check is included three times in the case
+// where all of the continuation bytes for a character exist in the same buffer.
+// It is also done this way as a slight performance increase instead of using a
+// loop.
+function utf8CheckExtraBytes(self, buf, p) {
+ if ((buf[0] & 0xC0) !== 0x80) {
+ self.lastNeed = 0;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 1 && buf.length > 1) {
+ if ((buf[1] & 0xC0) !== 0x80) {
+ self.lastNeed = 1;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 2 && buf.length > 2) {
+ if ((buf[2] & 0xC0) !== 0x80) {
+ self.lastNeed = 2;
+ return '\ufffd';
+ }
+ }
+ }
+}
+
+// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
+function utf8FillLast(buf) {
+ var p = this.lastTotal - this.lastNeed;
+ var r = utf8CheckExtraBytes(this, buf, p);
+ if (r !== undefined) return r;
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, p, 0, buf.length);
+ this.lastNeed -= buf.length;
+}
+
+// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
+// partial character, the character's bytes are buffered until the required
+// number of bytes are available.
+function utf8Text(buf, i) {
+ var total = utf8CheckIncomplete(this, buf, i);
+ if (!this.lastNeed) return buf.toString('utf8', i);
+ this.lastTotal = total;
+ var end = buf.length - (total - this.lastNeed);
+ buf.copy(this.lastChar, 0, end);
+ return buf.toString('utf8', i, end);
+}
+
+// For UTF-8, a replacement character is added when ending on a partial
+// character.
+function utf8End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + '\ufffd';
+ return r;
+}
+
+// UTF-16LE typically needs two bytes per character, but even if we have an even
+// number of bytes available, we need to check if we end on a leading/high
+// surrogate. In that case, we need to wait for the next two bytes in order to
+// decode the last character properly.
+function utf16Text(buf, i) {
+ if ((buf.length - i) % 2 === 0) {
+ var r = buf.toString('utf16le', i);
+ if (r) {
+ var c = r.charCodeAt(r.length - 1);
+ if (c >= 0xD800 && c <= 0xDBFF) {
+ this.lastNeed = 2;
+ this.lastTotal = 4;
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ return r.slice(0, -1);
+ }
+ }
+ return r;
+ }
+ this.lastNeed = 1;
+ this.lastTotal = 2;
+ this.lastChar[0] = buf[buf.length - 1];
+ return buf.toString('utf16le', i, buf.length - 1);
+}
+
+// For UTF-16LE we do not explicitly append special replacement characters if we
+// end on a partial character, we simply let v8 handle that.
+function utf16End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) {
+ var end = this.lastTotal - this.lastNeed;
+ return r + this.lastChar.toString('utf16le', 0, end);
+ }
+ return r;
+}
+
+function base64Text(buf, i) {
+ var n = (buf.length - i) % 3;
+ if (n === 0) return buf.toString('base64', i);
+ this.lastNeed = 3 - n;
+ this.lastTotal = 3;
+ if (n === 1) {
+ this.lastChar[0] = buf[buf.length - 1];
+ } else {
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ }
+ return buf.toString('base64', i, buf.length - n);
+}
+
+function base64End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
+ return r;
+}
+
+// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
+function simpleWrite(buf) {
+ return buf.toString(this.encoding);
+}
+
+function simpleEnd(buf) {
+ return buf && buf.length ? this.write(buf) : '';
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/LICENSE b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/LICENSE
new file mode 100644
index 0000000..0c068ce
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/README.md b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/README.md
new file mode 100644
index 0000000..e9a81af
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/README.md
@@ -0,0 +1,584 @@
+# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/safe-buffer
+[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
+[npm-url]: https://npmjs.org/package/safe-buffer
+[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
+[downloads-url]: https://npmjs.org/package/safe-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### Safer Node.js Buffer API
+
+**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
+`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
+
+**Uses the built-in implementation when available.**
+
+## install
+
+```
+npm install safe-buffer
+```
+
+## usage
+
+The goal of this package is to provide a safe replacement for the node.js `Buffer`.
+
+It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
+the top of your node.js modules:
+
+```js
+var Buffer = require('safe-buffer').Buffer
+
+// Existing buffer code will continue to work without issues:
+
+new Buffer('hey', 'utf8')
+new Buffer([1, 2, 3], 'utf8')
+new Buffer(obj)
+new Buffer(16) // create an uninitialized buffer (potentially unsafe)
+
+// But you can use these new explicit APIs to make clear what you want:
+
+Buffer.from('hey', 'utf8') // convert from many types to a Buffer
+Buffer.alloc(16) // create a zero-filled buffer (safe)
+Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
+```
+
+## api
+
+### Class Method: Buffer.from(array)
+
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+ // creates a new Buffer containing ASCII bytes
+ // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+ a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+ // Prints:
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+ // Prints:
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+ // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+ // 'auffer'
+console.log(buf2.toString());
+ // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+ // prints: this is a tést
+console.log(buf1.toString('ascii'));
+ // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+ // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+ //
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+ //
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+ //
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+ //
+ // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+ //
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+ const data = socket.read();
+ // allocate for retained data
+ const sb = Buffer.allocUnsafeSlow(10);
+ // copy the data into the new allocation
+ data.copy(sb, 0, 0, 10);
+ store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+ return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+ var data = ''
+ req.setEncoding('utf8')
+ req.on('data', function (chunk) {
+ data += chunk
+ })
+ req.on('end', function () {
+ var body = JSON.parse(data)
+ res.end(new Buffer(body.str).toString('hex'))
+ })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+ "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+ socket.on('message', function (message) {
+ message = JSON.parse(message)
+ if (message.type === 'echo') {
+ socket.send(message.data) // send back the user's message
+ }
+ })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts
new file mode 100644
index 0000000..e9fed80
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts
@@ -0,0 +1,187 @@
+declare module "safe-buffer" {
+ export class Buffer {
+ length: number
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ constructor (str: string, encoding?: string);
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ constructor (size: number);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: Uint8Array);
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ constructor (arrayBuffer: ArrayBuffer);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: any[]);
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ constructor (buffer: Buffer);
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ static from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ static from(buffer: Buffer): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ static from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ static isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ static isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ static byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ static concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ static compare(buf1: Buffer, buf2: Buffer): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initalizing
+ */
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafeSlow(size: number): Buffer;
+ }
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/index.js b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/index.js
new file mode 100644
index 0000000..22438da
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/index.js
@@ -0,0 +1,62 @@
+/* eslint-disable node/no-deprecated-api */
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+// alternative to using Object.keys for old browsers
+function copyProps (src, dst) {
+ for (var key in src) {
+ dst[key] = src[key]
+ }
+}
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+ module.exports = buffer
+} else {
+ // Copy properties from require('buffer')
+ copyProps(buffer, exports)
+ exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+// Copy static methods from Buffer
+copyProps(Buffer, SafeBuffer)
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+ if (typeof arg === 'number') {
+ throw new TypeError('Argument must not be a number')
+ }
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ var buf = Buffer(size)
+ if (fill !== undefined) {
+ if (typeof encoding === 'string') {
+ buf.fill(fill, encoding)
+ } else {
+ buf.fill(fill)
+ }
+ } else {
+ buf.fill(0)
+ }
+ return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return buffer.SlowBuffer(size)
+}
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/package.json b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/package.json
new file mode 100644
index 0000000..ef8c2a5
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/node_modules/safe-buffer/package.json
@@ -0,0 +1,62 @@
+{
+ "_from": "safe-buffer@~5.1.0",
+ "_id": "safe-buffer@5.1.2",
+ "_inBundle": false,
+ "_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "_location": "/bl/string_decoder/safe-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "safe-buffer@~5.1.0",
+ "name": "safe-buffer",
+ "escapedName": "safe-buffer",
+ "rawSpec": "~5.1.0",
+ "saveSpec": null,
+ "fetchSpec": "~5.1.0"
+ },
+ "_requiredBy": [
+ "/bl/string_decoder"
+ ],
+ "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "_shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d",
+ "_spec": "safe-buffer@~5.1.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/bl/node_modules/string_decoder",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "http://feross.org"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/safe-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Safer Node.js Buffer API",
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^4.0.0"
+ },
+ "homepage": "https://github.com/feross/safe-buffer",
+ "keywords": [
+ "buffer",
+ "buffer allocate",
+ "node security",
+ "safe",
+ "safe-buffer",
+ "security",
+ "uninitialized"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "safe-buffer",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/safe-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && tape test/*.js"
+ },
+ "types": "index.d.ts",
+ "version": "5.1.2"
+}
diff --git a/Nodejs/node_modules/bl/node_modules/string_decoder/package.json b/Nodejs/node_modules/bl/node_modules/string_decoder/package.json
new file mode 100644
index 0000000..af78d8c
--- /dev/null
+++ b/Nodejs/node_modules/bl/node_modules/string_decoder/package.json
@@ -0,0 +1,59 @@
+{
+ "_from": "string_decoder@~1.1.1",
+ "_id": "string_decoder@1.1.1",
+ "_inBundle": false,
+ "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "_location": "/bl/string_decoder",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "string_decoder@~1.1.1",
+ "name": "string_decoder",
+ "escapedName": "string_decoder",
+ "rawSpec": "~1.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~1.1.1"
+ },
+ "_requiredBy": [
+ "/bl/readable-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
+ "_spec": "string_decoder@~1.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/bl/node_modules/readable-stream",
+ "bugs": {
+ "url": "https://github.com/nodejs/string_decoder/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ },
+ "deprecated": false,
+ "description": "The string_decoder module from Node core",
+ "devDependencies": {
+ "babel-polyfill": "^6.23.0",
+ "core-util-is": "^1.0.2",
+ "inherits": "^2.0.3",
+ "tap": "~0.4.8"
+ },
+ "homepage": "https://github.com/nodejs/string_decoder",
+ "keywords": [
+ "string",
+ "decoder",
+ "browser",
+ "browserify"
+ ],
+ "license": "MIT",
+ "main": "lib/string_decoder.js",
+ "name": "string_decoder",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/string_decoder.git"
+ },
+ "scripts": {
+ "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+ "test": "tap test/parallel/*.js && node test/verify-dependencies"
+ },
+ "version": "1.1.1"
+}
diff --git a/Nodejs/node_modules/bl/package.json b/Nodejs/node_modules/bl/package.json
new file mode 100644
index 0000000..1219a09
--- /dev/null
+++ b/Nodejs/node_modules/bl/package.json
@@ -0,0 +1,69 @@
+{
+ "_from": "bl@^1.2.2",
+ "_id": "bl@1.2.2",
+ "_inBundle": false,
+ "_integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
+ "_location": "/bl",
+ "_phantomChildren": {
+ "core-util-is": "1.0.2",
+ "inherits": "2.0.4",
+ "isarray": "1.0.0",
+ "process-nextick-args": "2.0.1",
+ "util-deprecate": "1.0.2"
+ },
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "bl@^1.2.2",
+ "name": "bl",
+ "escapedName": "bl",
+ "rawSpec": "^1.2.2",
+ "saveSpec": null,
+ "fetchSpec": "^1.2.2"
+ },
+ "_requiredBy": [
+ "/mqtt-packet"
+ ],
+ "_resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
+ "_shasum": "a160911717103c07410cef63ef51b397c025af9c",
+ "_spec": "bl@^1.2.2",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/mqtt-packet",
+ "authors": [
+ "Rod Vagg (https://github.com/rvagg)",
+ "Matteo Collina (https://github.com/mcollina)",
+ "Jarett Cruger (https://github.com/jcrugzz)"
+ ],
+ "bugs": {
+ "url": "https://github.com/rvagg/bl/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "readable-stream": "^2.3.5",
+ "safe-buffer": "^5.1.1"
+ },
+ "deprecated": false,
+ "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
+ "devDependencies": {
+ "faucet": "0.0.1",
+ "hash_file": "~0.1.1",
+ "tape": "~4.9.0"
+ },
+ "homepage": "https://github.com/rvagg/bl",
+ "keywords": [
+ "buffer",
+ "buffers",
+ "stream",
+ "awesomesauce"
+ ],
+ "license": "MIT",
+ "main": "bl.js",
+ "name": "bl",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/rvagg/bl.git"
+ },
+ "scripts": {
+ "test": "node test/test.js | faucet"
+ },
+ "version": "1.2.2"
+}
diff --git a/Nodejs/node_modules/bl/test/test.js b/Nodejs/node_modules/bl/test/test.js
new file mode 100644
index 0000000..e121487
--- /dev/null
+++ b/Nodejs/node_modules/bl/test/test.js
@@ -0,0 +1,702 @@
+var tape = require('tape')
+ , crypto = require('crypto')
+ , fs = require('fs')
+ , hash = require('hash_file')
+ , BufferList = require('../')
+ , Buffer = require('safe-buffer').Buffer
+
+ , encodings =
+ ('hex utf8 utf-8 ascii binary base64'
+ + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
+
+tape('single bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(Buffer.from('abcd'))
+
+ t.equal(bl.length, 4)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+
+ t.end()
+})
+
+tape('single bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(Buffer.from('abcd'))
+ bl.append(Buffer.from('efg'))
+ bl.append(Buffer.from('hi'))
+ bl.append(Buffer.from('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.get(0), 97)
+ t.equal(bl.get(1), 98)
+ t.equal(bl.get(2), 99)
+ t.equal(bl.get(3), 100)
+ t.equal(bl.get(4), 101)
+ t.equal(bl.get(5), 102)
+ t.equal(bl.get(6), 103)
+ t.equal(bl.get(7), 104)
+ t.equal(bl.get(8), 105)
+ t.equal(bl.get(9), 106)
+ t.end()
+})
+
+tape('multi bytes from single buffer', function (t) {
+ var bl = new BufferList()
+ bl.append(Buffer.from('abcd'))
+
+ t.equal(bl.length, 4)
+
+ t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
+ t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
+ t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
+ t.equal(bl.slice(-4, -1).toString('ascii'), 'abc')
+
+ t.end()
+})
+
+tape('multi bytes from single buffer (negative indexes)', function (t) {
+ var bl = new BufferList()
+ bl.append(Buffer.from('buffer'))
+
+ t.equal(bl.length, 6)
+
+ t.equal(bl.slice(-6, -1).toString('ascii'), 'buffe')
+ t.equal(bl.slice(-6, -2).toString('ascii'), 'buff')
+ t.equal(bl.slice(-5, -2).toString('ascii'), 'uff')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(Buffer.from('abcd'))
+ bl.append(Buffer.from('efg'))
+ bl.append(Buffer.from('hi'))
+ bl.append(Buffer.from('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+ t.equal(bl.slice(-7, -4).toString('ascii'), 'def')
+
+ t.end()
+})
+
+tape('multiple bytes from multiple buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([ Buffer.from('abcd'), Buffer.from('efg') ]))
+ bl.append(new BufferList([ Buffer.from('hi'), Buffer.from('j') ]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+// same data as previous test, just using nested constructors
+tape('multiple bytes from crazy nested buffer lists', function (t) {
+ var bl = new BufferList()
+
+ bl.append(new BufferList([
+ new BufferList([
+ new BufferList(Buffer.from('abc'))
+ , Buffer.from('d')
+ , new BufferList(Buffer.from('efg'))
+ ])
+ , new BufferList([ Buffer.from('hi') ])
+ , new BufferList(Buffer.from('j'))
+ ]))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+ t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+ t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+ t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+ t.end()
+})
+
+tape('append accepts arrays of Buffers', function (t) {
+ var bl = new BufferList()
+ bl.append(Buffer.from('abc'))
+ bl.append([ Buffer.from('def') ])
+ bl.append([ Buffer.from('ghi'), Buffer.from('jkl') ])
+ bl.append([ Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz') ])
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('append accepts arrays of BufferLists', function (t) {
+ var bl = new BufferList()
+ bl.append(Buffer.from('abc'))
+ bl.append([ new BufferList('def') ])
+ bl.append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ]))
+ bl.append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ])
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('append chainable', function (t) {
+ var bl = new BufferList()
+ t.ok(bl.append(Buffer.from('abcd')) === bl)
+ t.ok(bl.append([ Buffer.from('abcd') ]) === bl)
+ t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl)
+ t.ok(bl.append([ new BufferList(Buffer.from('abcd')) ]) === bl)
+ t.end()
+})
+
+tape('append chainable (test results)', function (t) {
+ var bl = new BufferList('abc')
+ .append([ new BufferList('def') ])
+ .append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ]))
+ .append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ])
+
+ t.equal(bl.length, 26)
+ t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+ t.end()
+})
+
+tape('consuming from multiple buffers', function (t) {
+ var bl = new BufferList()
+
+ bl.append(Buffer.from('abcd'))
+ bl.append(Buffer.from('efg'))
+ bl.append(Buffer.from('hi'))
+ bl.append(Buffer.from('j'))
+
+ t.equal(bl.length, 10)
+
+ t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+ bl.consume(3)
+ t.equal(bl.length, 7)
+ t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
+
+ bl.consume(2)
+ t.equal(bl.length, 5)
+ t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 4)
+ t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
+
+ bl.consume(1)
+ t.equal(bl.length, 3)
+ t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
+
+ bl.consume(2)
+ t.equal(bl.length, 1)
+ t.equal(bl.slice(0, 1).toString('ascii'), 'j')
+
+ t.end()
+})
+
+tape('complete consumption', function (t) {
+ var bl = new BufferList()
+
+ bl.append(Buffer.from('a'))
+ bl.append(Buffer.from('b'))
+
+ bl.consume(2)
+
+ t.equal(bl.length, 0)
+ t.equal(bl._bufs.length, 0)
+
+ t.end()
+})
+
+tape('test readUInt8 / readInt8', function (t) {
+ var buf1 = Buffer.alloc(1)
+ , buf2 = Buffer.alloc(3)
+ , buf3 = Buffer.alloc(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt8(2), 0x3)
+ t.equal(bl.readInt8(2), 0x3)
+ t.equal(bl.readUInt8(3), 0x4)
+ t.equal(bl.readInt8(3), 0x4)
+ t.equal(bl.readUInt8(4), 0x23)
+ t.equal(bl.readInt8(4), 0x23)
+ t.equal(bl.readUInt8(5), 0x42)
+ t.equal(bl.readInt8(5), 0x42)
+ t.end()
+})
+
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
+ var buf1 = Buffer.alloc(1)
+ , buf2 = Buffer.alloc(3)
+ , buf3 = Buffer.alloc(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt16BE(2), 0x0304)
+ t.equal(bl.readUInt16LE(2), 0x0403)
+ t.equal(bl.readInt16BE(2), 0x0304)
+ t.equal(bl.readInt16LE(2), 0x0403)
+ t.equal(bl.readUInt16BE(3), 0x0423)
+ t.equal(bl.readUInt16LE(3), 0x2304)
+ t.equal(bl.readInt16BE(3), 0x0423)
+ t.equal(bl.readInt16LE(3), 0x2304)
+ t.equal(bl.readUInt16BE(4), 0x2342)
+ t.equal(bl.readUInt16LE(4), 0x4223)
+ t.equal(bl.readInt16BE(4), 0x2342)
+ t.equal(bl.readInt16LE(4), 0x4223)
+ t.end()
+})
+
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
+ var buf1 = Buffer.alloc(1)
+ , buf2 = Buffer.alloc(3)
+ , buf3 = Buffer.alloc(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x3
+ buf2[2] = 0x4
+ buf3[0] = 0x23
+ buf3[1] = 0x42
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readUInt32BE(2), 0x03042342)
+ t.equal(bl.readUInt32LE(2), 0x42230403)
+ t.equal(bl.readInt32BE(2), 0x03042342)
+ t.equal(bl.readInt32LE(2), 0x42230403)
+ t.end()
+})
+
+tape('test readFloatLE / readFloatBE', function (t) {
+ var buf1 = Buffer.alloc(1)
+ , buf2 = Buffer.alloc(3)
+ , buf3 = Buffer.alloc(3)
+ , bl = new BufferList()
+
+ buf2[1] = 0x00
+ buf2[2] = 0x00
+ buf3[0] = 0x80
+ buf3[1] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readFloatLE(2), 0x01)
+ t.end()
+})
+
+tape('test readDoubleLE / readDoubleBE', function (t) {
+ var buf1 = Buffer.alloc(1)
+ , buf2 = Buffer.alloc(3)
+ , buf3 = Buffer.alloc(10)
+ , bl = new BufferList()
+
+ buf2[1] = 0x55
+ buf2[2] = 0x55
+ buf3[0] = 0x55
+ buf3[1] = 0x55
+ buf3[2] = 0x55
+ buf3[3] = 0x55
+ buf3[4] = 0xd5
+ buf3[5] = 0x3f
+
+ bl.append(buf1)
+ bl.append(buf2)
+ bl.append(buf3)
+
+ t.equal(bl.readDoubleLE(2), 0.3333333333333333)
+ t.end()
+})
+
+tape('test toString', function (t) {
+ var bl = new BufferList()
+
+ bl.append(Buffer.from('abcd'))
+ bl.append(Buffer.from('efg'))
+ bl.append(Buffer.from('hi'))
+ bl.append(Buffer.from('j'))
+
+ t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
+ t.equal(bl.toString('ascii', 3, 10), 'defghij')
+ t.equal(bl.toString('ascii', 3, 6), 'def')
+ t.equal(bl.toString('ascii', 3, 8), 'defgh')
+ t.equal(bl.toString('ascii', 5, 10), 'fghij')
+
+ t.end()
+})
+
+tape('test toString encoding', function (t) {
+ var bl = new BufferList()
+ , b = Buffer.from('abcdefghij\xff\x00')
+
+ bl.append(Buffer.from('abcd'))
+ bl.append(Buffer.from('efg'))
+ bl.append(Buffer.from('hi'))
+ bl.append(Buffer.from('j'))
+ bl.append(Buffer.from('\xff\x00'))
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc), enc)
+ })
+
+ t.end()
+})
+
+!process.browser && tape('test stream', function (t) {
+ var random = crypto.randomBytes(65534)
+ , rndhash = hash(random, 'md5')
+ , md5sum = crypto.createHash('md5')
+ , bl = new BufferList(function (err, buf) {
+ t.ok(Buffer.isBuffer(buf))
+ t.ok(err === null)
+ t.equal(rndhash, hash(bl.slice(), 'md5'))
+ t.equal(rndhash, hash(buf, 'md5'))
+
+ bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
+ .on('close', function () {
+ var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
+ s.on('data', md5sum.update.bind(md5sum))
+ s.on('end', function() {
+ t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
+ t.end()
+ })
+ })
+
+ })
+
+ fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
+ fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
+})
+
+tape('instantiation with Buffer', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = crypto.randomBytes(1024)
+ , b = BufferList(buf)
+
+ t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
+ b = BufferList([ buf, buf2 ])
+ t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('test String appendage', function (t) {
+ var bl = new BufferList()
+ , b = Buffer.from('abcdefghij\xff\x00')
+
+ bl.append('abcd')
+ bl.append('efg')
+ bl.append('hi')
+ bl.append('j')
+ bl.append('\xff\x00')
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('test Number appendage', function (t) {
+ var bl = new BufferList()
+ , b = Buffer.from('1234567890')
+
+ bl.append(1234)
+ bl.append(567)
+ bl.append(89)
+ bl.append(0)
+
+ encodings.forEach(function (enc) {
+ t.equal(bl.toString(enc), b.toString(enc))
+ })
+
+ t.end()
+})
+
+tape('write nothing, should get empty buffer', function (t) {
+ t.plan(3)
+ BufferList(function (err, data) {
+ t.notOk(err, 'no error')
+ t.ok(Buffer.isBuffer(data), 'got a buffer')
+ t.equal(0, data.length, 'got a zero-length buffer')
+ t.end()
+ }).end()
+})
+
+tape('unicode string', function (t) {
+ t.plan(2)
+ var inp1 = '\u2600'
+ , inp2 = '\u2603'
+ , exp = inp1 + ' and ' + inp2
+ , bl = BufferList()
+ bl.write(inp1)
+ bl.write(' and ')
+ bl.write(inp2)
+ t.equal(exp, bl.toString())
+ t.equal(Buffer.from(exp).toString('hex'), bl.toString('hex'))
+})
+
+tape('should emit finish', function (t) {
+ var source = BufferList()
+ , dest = BufferList()
+
+ source.write('hello')
+ source.pipe(dest)
+
+ dest.on('finish', function () {
+ t.equal(dest.toString('utf8'), 'hello')
+ t.end()
+ })
+})
+
+tape('basic copy', function (t) {
+ var buf = crypto.randomBytes(1024)
+ , buf2 = Buffer.alloc(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy after many appends', function (t) {
+ var buf = crypto.randomBytes(512)
+ , buf2 = Buffer.alloc(1024)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2)
+ t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy at a precise position', function (t) {
+ var buf = crypto.randomBytes(1004)
+ , buf2 = Buffer.alloc(1024)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 20)
+ t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy starting from a precise location', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = Buffer.alloc(5)
+ , b = BufferList(buf)
+
+ b.copy(buf2, 0, 5)
+ t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy in an interval', function (t) {
+ var rnd = crypto.randomBytes(10)
+ , b = BufferList(rnd) // put the random bytes there
+ , actual = Buffer.alloc(3)
+ , expected = Buffer.alloc(3)
+
+ rnd.copy(expected, 0, 5, 8)
+ b.copy(actual, 0, 5, 8)
+
+ t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('copy an interval between two buffers', function (t) {
+ var buf = crypto.randomBytes(10)
+ , buf2 = Buffer.alloc(10)
+ , b = BufferList(buf)
+
+ b.append(buf)
+ b.copy(buf2, 0, 5, 15)
+
+ t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
+ t.end()
+})
+
+tape('shallow slice across buffer boundaries', function (t) {
+ var bl = new BufferList(['First', 'Second', 'Third'])
+
+ t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh')
+ t.end()
+})
+
+tape('shallow slice within single buffer', function (t) {
+ t.plan(2)
+ var bl = new BufferList(['First', 'Second', 'Third'])
+
+ t.equal(bl.shallowSlice(5, 10).toString(), 'Secon')
+ t.equal(bl.shallowSlice(7, 10).toString(), 'con')
+ t.end()
+})
+
+tape('shallow slice single buffer', function (t) {
+ t.plan(3)
+ var bl = new BufferList(['First', 'Second', 'Third'])
+
+ t.equal(bl.shallowSlice(0, 5).toString(), 'First')
+ t.equal(bl.shallowSlice(5, 11).toString(), 'Second')
+ t.equal(bl.shallowSlice(11, 16).toString(), 'Third')
+})
+
+tape('shallow slice with negative or omitted indices', function (t) {
+ t.plan(4)
+ var bl = new BufferList(['First', 'Second', 'Third'])
+
+ t.equal(bl.shallowSlice().toString(), 'FirstSecondThird')
+ t.equal(bl.shallowSlice(5).toString(), 'SecondThird')
+ t.equal(bl.shallowSlice(5, -3).toString(), 'SecondTh')
+ t.equal(bl.shallowSlice(-8).toString(), 'ondThird')
+})
+
+tape('shallow slice does not make a copy', function (t) {
+ t.plan(1)
+ var buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
+ var bl = (new BufferList(buffers)).shallowSlice(5, -3)
+
+ buffers[1].fill('h')
+ buffers[2].fill('h')
+
+ t.equal(bl.toString(), 'hhhhhhhh')
+})
+
+tape('duplicate', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('abcdefghij\xff\x00')
+ , dup = bl.duplicate()
+
+ t.equal(bl.prototype, dup.prototype)
+ t.equal(bl.toString('hex'), dup.toString('hex'))
+})
+
+tape('destroy no pipe', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+})
+
+!process.browser && tape('destroy with pipe before read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+
+})
+
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .pipe(bl)
+
+ setTimeout(function () {
+ bl.destroy()
+ setTimeout(function () {
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }, 500)
+ }, 500)
+})
+
+!process.browser && tape('destroy with pipe after read end', function (t) {
+ t.plan(2)
+
+ var bl = new BufferList()
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.destroy()
+
+ t.equal(bl._bufs.length, 0)
+ t.equal(bl.length, 0)
+ }
+})
+
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
+ t.plan(4)
+
+ var bl = new BufferList()
+ , ds = new BufferList()
+
+ fs.createReadStream(__dirname + '/test.js')
+ .on('end', onEnd)
+ .pipe(bl)
+
+ function onEnd () {
+ bl.pipe(ds)
+
+ setTimeout(function () {
+ bl.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ ds.destroy()
+
+ t.equals(bl._bufs.length, 0)
+ t.equals(bl.length, 0)
+
+ }, 100)
+ }
+})
+
+!process.browser && tape('handle error', function (t) {
+ t.plan(2)
+ fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
+ t.ok(err instanceof Error, 'has error')
+ t.notOk(data, 'no data')
+ }))
+})
diff --git a/Nodejs/node_modules/bluebird/LICENSE b/Nodejs/node_modules/bluebird/LICENSE
new file mode 100644
index 0000000..4182a1e
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013-2015 Petka Antonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/bluebird/README.md b/Nodejs/node_modules/bluebird/README.md
new file mode 100644
index 0000000..fcb1daa
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/README.md
@@ -0,0 +1,677 @@
+
+
+
+[](https://travis-ci.org/petkaantonov/bluebird)
+[](http://petkaantonov.github.io/bluebird/coverage/debug/index.html)
+
+**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises)
+
+# Introduction
+
+Bluebird is a fully featured [promise](#what-are-promises-and-why-should-i-use-them) library with focus on innovative features and performance
+
+
+
+# Topics
+
+- [Features](#features)
+- [Quick start](#quick-start)
+- [API Reference and examples](API.md)
+- [Support](#support)
+- [What are promises and why should I use them?](#what-are-promises-and-why-should-i-use-them)
+- [Questions and issues](#questions-and-issues)
+- [Error handling](#error-handling)
+- [Development](#development)
+ - [Testing](#testing)
+ - [Benchmarking](#benchmarks)
+ - [Custom builds](#custom-builds)
+ - [For library authors](#for-library-authors)
+- [What is the sync build?](#what-is-the-sync-build)
+- [License](#license)
+- [Snippets for common problems](https://github.com/petkaantonov/bluebird/wiki/Snippets)
+- [Promise anti-patterns](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns)
+- [Changelog](changelog.md)
+- [Optimization guide](#optimization-guide)
+
+# Features
+
+
+- [Promises A+](http://promisesaplus.com)
+- [Synchronous inspection](API.md#synchronous-inspection)
+- [Concurrency coordination](API.md#collections)
+- [Promisification on steroids](API.md#promisification)
+- [Resource management through a parallel of python `with`/C# `using`](API.md#resource-management)
+- [Cancellation and timeouts](API.md#cancellation)
+- [Parallel for C# `async` and `await`](API.md#generators)
+- Mind blowing utilities such as
+ - [`.bind()`](API.md#binddynamic-thisarg---promise)
+ - [`.call()`](API.md#callstring-propertyname--dynamic-arg---promise)
+ - [`Promise.join()`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise)
+ - [And](API.md#core) [much](API.md#timers) [more](API.md#utility)!
+- [Practical debugging solutions and sane defaults](#error-handling)
+- [Sick performance](benchmark/)
+
+
+
+# Quick start
+
+## Node.js
+
+ npm install bluebird
+
+Then:
+
+```js
+var Promise = require("bluebird");
+```
+
+## Browsers
+
+There are many ways to use bluebird in browsers:
+
+- Direct downloads
+ - Full build [bluebird.js](https://cdn.jsdelivr.net/bluebird/2.10.2/bluebird.js)
+ - Full build minified [bluebird.min.js](https://cdn.jsdelivr.net/bluebird/2.10.2/bluebird.min.js)
+- You may use browserify on the main export
+- You may use the [bower](http://bower.io) package.
+
+When using script tags the global variables `Promise` and `P` (alias for `Promise`) become available.
+
+A [minimal bluebird browser build](#custom-builds) is ≈38.92KB minified*, 11.65KB gzipped and has no external dependencies.
+
+*Google Closure Compiler using Simple.
+
+#### Browser support
+
+Browsers that [implement ECMA-262, edition 3](http://en.wikipedia.org/wiki/Ecmascript#Implementations) and later are supported.
+
+[](https://saucelabs.com/u/petka_antonov)
+
+**Note** that in ECMA-262, edition 3 (IE7, IE8 etc.) it is not possible to use methods that have keyword names like `.catch` and `.finally`. The [API documentation](API.md) always lists a compatible alternative name that you can use if you need to support these browsers. For example `.catch` is replaced with `.caught` and `.finally` with `.lastly`.
+
+Also, [long stack trace](API.md#promiselongstacktraces---void) support is only available in Chrome, Firefox and Internet Explorer 10+.
+
+After quick start, see [API Reference and examples](API.md)
+
+
+
+# Support
+
+- Mailing list: [bluebird-js@googlegroups.com](https://groups.google.com/forum/#!forum/bluebird-js)
+- IRC: #promises @freenode
+- StackOverflow: [bluebird tag](http://stackoverflow.com/questions/tagged/bluebird)
+- Bugs and feature requests: [github issue tracker](https://github.com/petkaantonov/bluebird/issues?state=open)
+
+
+
+# What are promises and why should I use them?
+
+You should use promises to turn this:
+
+```js
+fs.readFile("file.json", function(err, val) {
+ if( err ) {
+ console.error("unable to read file");
+ }
+ else {
+ try {
+ val = JSON.parse(val);
+ console.log(val.success);
+ }
+ catch( e ) {
+ console.error("invalid json in file");
+ }
+ }
+});
+```
+
+Into this:
+
+```js
+fs.readFileAsync("file.json").then(JSON.parse).then(function(val) {
+ console.log(val.success);
+})
+.catch(SyntaxError, function(e) {
+ console.error("invalid json in file");
+})
+.catch(function(e) {
+ console.error("unable to read file");
+});
+```
+
+*If you are wondering "there is no `readFileAsync` method on `fs` that returns a promise", see [promisification](API.md#promisification)*
+
+Actually you might notice the latter has a lot in common with code that would do the same using synchronous I/O:
+
+```js
+try {
+ var val = JSON.parse(fs.readFileSync("file.json"));
+ console.log(val.success);
+}
+//Syntax actually not supported in JS but drives the point
+catch(SyntaxError e) {
+ console.error("invalid json in file");
+}
+catch(Error e) {
+ console.error("unable to read file");
+}
+```
+
+And that is the point - being able to have something that is a lot like `return` and `throw` in synchronous code.
+
+You can also use promises to improve code that was written with callback helpers:
+
+
+```js
+//Copyright Plato http://stackoverflow.com/a/19385911/995876
+//CC BY-SA 2.5
+mapSeries(URLs, function (URL, done) {
+ var options = {};
+ needle.get(URL, options, function (error, response, body) {
+ if (error) {
+ return done(error);
+ }
+ try {
+ var ret = JSON.parse(body);
+ return done(null, ret);
+ }
+ catch (e) {
+ done(e);
+ }
+ });
+}, function (err, results) {
+ if (err) {
+ console.log(err);
+ } else {
+ console.log('All Needle requests successful');
+ // results is a 1 to 1 mapping in order of URLs > needle.body
+ processAndSaveAllInDB(results, function (err) {
+ if (err) {
+ return done(err);
+ }
+ console.log('All Needle requests saved');
+ done(null);
+ });
+ }
+});
+```
+
+Is more pleasing to the eye when done with promises:
+
+```js
+Promise.promisifyAll(needle);
+var options = {};
+
+var current = Promise.resolve();
+Promise.map(URLs, function(URL) {
+ current = current.then(function () {
+ return needle.getAsync(URL, options);
+ });
+ return current;
+}).map(function(responseAndBody){
+ return JSON.parse(responseAndBody[1]);
+}).then(function (results) {
+ return processAndSaveAllInDB(results);
+}).then(function(){
+ console.log('All Needle requests saved');
+}).catch(function (e) {
+ console.log(e);
+});
+```
+
+Also promises don't just give you correspondences for synchronous features but can also be used as limited event emitters or callback aggregators.
+
+More reading:
+
+ - [Promise nuggets](https://promise-nuggets.github.io/)
+ - [Why I am switching to promises](http://spion.github.io/posts/why-i-am-switching-to-promises.html)
+ - [What is the the point of promises](http://domenic.me/2012/10/14/youre-missing-the-point-of-promises/#toc_1)
+ - [Snippets for common problems](https://github.com/petkaantonov/bluebird/wiki/Snippets)
+ - [Promise anti-patterns](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns)
+
+# Questions and issues
+
+The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`.
+
+# Error handling
+
+This is a problem every promise library needs to handle in some way. Unhandled rejections/exceptions don't really have a good agreed-on asynchronous correspondence. The problem is that it is impossible to predict the future and know if a rejected promise will eventually be handled.
+
+There are two common pragmatic attempts at solving the problem that promise libraries do.
+
+The more popular one is to have the user explicitly communicate that they are done and any unhandled rejections should be thrown, like so:
+
+```js
+download().then(...).then(...).done();
+```
+
+For handling this problem, in my opinion, this is completely unacceptable and pointless. The user must remember to explicitly call `.done` and that cannot be justified when the problem is forgetting to create an error handler in the first place.
+
+The second approach, which is what bluebird by default takes, is to call a registered handler if a rejection is unhandled by the start of a second turn. The default handler is to write the stack trace to `stderr` or `console.error` in browsers. This is close to what happens with synchronous code - your code doesn't work as expected and you open console and see a stack trace. Nice.
+
+Of course this is not perfect, if your code for some reason needs to swoop in and attach error handler to some promise after the promise has been hanging around a while then you will see annoying messages. In that case you can use the `.done()` method to signal that any hanging exceptions should be thrown.
+
+If you want to override the default handler for these possibly unhandled rejections, you can pass yours like so:
+
+```js
+Promise.onPossiblyUnhandledRejection(function(error){
+ throw error;
+});
+```
+
+If you want to also enable long stack traces, call:
+
+```js
+Promise.longStackTraces();
+```
+
+right after the library is loaded.
+
+In node.js use the environment flag `BLUEBIRD_DEBUG`:
+
+```
+BLUEBIRD_DEBUG=1 node server.js
+```
+
+to enable long stack traces in all instances of bluebird.
+
+Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. Long stack traces imply a substantial performance penalty, even after using every trick to optimize them.
+
+Long stack traces are enabled by default in the debug build.
+
+#### Expected and unexpected errors
+
+A practical problem with Promises/A+ is that it models Javascript `try-catch` too closely for its own good. Therefore by default promises inherit `try-catch` warts such as the inability to specify the error types that the catch block is eligible for. It is an anti-pattern in every other language to use catch-all handlers because they swallow exceptions that you might not know about.
+
+Now, Javascript does have a perfectly fine and working way of creating error type hierarchies. It is still quite awkward to use them with the built-in `try-catch` however:
+
+```js
+try {
+ //code
+}
+catch(e) {
+ if( e instanceof WhatIWantError) {
+ //handle
+ }
+ else {
+ throw e;
+ }
+}
+```
+
+Without such checking, unexpected errors would be silently swallowed. However, with promises, bluebird brings the future (hopefully) here now and extends the `.catch` to [accept potential error type eligibility](API.md#catchfunction-errorclass-function-handler---promise).
+
+For instance here it is expected that some evil or incompetent entity will try to crash our server from `SyntaxError` by providing syntactically invalid JSON:
+
+```js
+getJSONFromSomewhere().then(function(jsonString) {
+ return JSON.parse(jsonString);
+}).then(function(object) {
+ console.log("it was valid json: ", object);
+}).catch(SyntaxError, function(e){
+ console.log("don't be evil");
+});
+```
+
+Here any kind of unexpected error will be automatically reported on `stderr` along with a stack trace because we only register a handler for the expected `SyntaxError`.
+
+Ok, so, that's pretty neat. But actually not many libraries define error types and it is in fact a complete ghetto out there with ad hoc strings being attached as some arbitrary property name like `.name`, `.type`, `.code`, not having any property at all or even throwing strings as errors and so on. So how can we still listen for expected errors?
+
+Bluebird defines a special error type `OperationalError` (you can get a reference from `Promise.OperationalError`). This type of error is given as rejection reason by promisified methods when
+their underlying library gives an untyped, but expected error. Primitives such as strings, and error objects that are directly created like `new Error("database didn't respond")` are considered untyped.
+
+Example of such library is the node core library `fs`. So if we promisify it, we can catch just the errors we want pretty easily and have programmer errors be redirected to unhandled rejection handler so that we notice them:
+
+```js
+//Read more about promisification in the API Reference:
+//API.md
+var fs = Promise.promisifyAll(require("fs"));
+
+fs.readFileAsync("myfile.json").then(JSON.parse).then(function (json) {
+ console.log("Successful json");
+}).catch(SyntaxError, function (e) {
+ console.error("file contains invalid json");
+}).catch(Promise.OperationalError, function (e) {
+ console.error("unable to read file, because: ", e.message);
+});
+```
+
+The last `catch` handler is only invoked when the `fs` module explicitly used the `err` argument convention of async callbacks to inform of an expected error. The `OperationalError` instance will contain the original error in its `.cause` property but it does have a direct copy of the `.message` and `.stack` too. In this code any unexpected error - be it in our code or the `fs` module - would not be caught by these handlers and therefore not swallowed.
+
+Since a `catch` handler typed to `Promise.OperationalError` is expected to be used very often, it has a neat shorthand:
+
+```js
+.error(function (e) {
+ console.error("unable to read file, because: ", e.message);
+});
+```
+
+See [API documentation for `.error()`](API.md#error-rejectedhandler----promise)
+
+Finally, Bluebird also supports predicate-based filters. If you pass a
+predicate function instead of an error type, the predicate will receive
+the error as an argument. The return result will be used to determine whether
+the error handler should be called.
+
+Predicates should allow for very fine grained control over caught errors:
+pattern matching, error typesets with set operations and many other techniques
+can be implemented on top of them.
+
+Example of using a predicate-based filter:
+
+```js
+var Promise = require("bluebird");
+var request = Promise.promisify(require("request"));
+
+function clientError(e) {
+ return e.code >= 400 && e.code < 500;
+}
+
+request("http://www.google.com").then(function(contents){
+ console.log(contents);
+}).catch(clientError, function(e){
+ //A client error like 400 Bad Request happened
+});
+```
+
+**Danger:** The JavaScript language allows throwing primitive values like strings. Throwing primitives can lead to worse or no stack traces. Primitives [are not exceptions](http://www.devthought.com/2011/12/22/a-string-is-not-an-error/). You should consider always throwing Error objects when handling exceptions.
+
+
+
+#### How do long stack traces differ from e.g. Q?
+
+Bluebird attempts to have more elaborate traces. Consider:
+
+```js
+Error.stackTraceLimit = 25;
+Q.longStackSupport = true;
+Q().then(function outer() {
+ return Q().then(function inner() {
+ return Q().then(function evenMoreInner() {
+ a.b.c.d();
+ }).catch(function catcher(e){
+ console.error(e.stack);
+ });
+ })
+});
+```
+
+You will see
+
+ ReferenceError: a is not defined
+ at evenMoreInner (:7:13)
+ From previous event:
+ at inner (:6:20)
+
+Compare to:
+
+```js
+Error.stackTraceLimit = 25;
+Promise.longStackTraces();
+Promise.resolve().then(function outer() {
+ return Promise.resolve().then(function inner() {
+ return Promise.resolve().then(function evenMoreInner() {
+ a.b.c.d();
+ }).catch(function catcher(e){
+ console.error(e.stack);
+ });
+ });
+});
+```
+
+ ReferenceError: a is not defined
+ at evenMoreInner (:7:13)
+ From previous event:
+ at inner (:6:36)
+ From previous event:
+ at outer (:5:32)
+ From previous event:
+ at :4:21
+ at Object.InjectedScript._evaluateOn (:572:39)
+ at Object.InjectedScript._evaluateAndWrap (:531:52)
+ at Object.InjectedScript.evaluate (:450:21)
+
+
+A better and more practical example of the differences can be seen in gorgikosev's [debuggability competition](https://github.com/spion/async-compare#debuggability).
+
+
+
+# Development
+
+For development tasks such as running benchmarks or testing, you need to clone the repository and install dev-dependencies.
+
+Install [node](http://nodejs.org/) and [npm](https://npmjs.org/)
+
+ git clone git@github.com:petkaantonov/bluebird.git
+ cd bluebird
+ npm install
+
+## Testing
+
+To run all tests, run
+
+ node tools/test
+
+If you need to run generator tests run the `tool/test.js` script with `--harmony` argument and node 0.11+:
+
+ node-dev --harmony tools/test
+
+You may specify an individual test file to run with the `--run` script flag:
+
+ node tools/test --run=cancel.js
+
+
+This enables output from the test and may give a better idea where the test is failing. The parameter to `--run` can be any file name located in `test/mocha` folder.
+
+#### Testing in browsers
+
+To run the test in a browser instead of node, pass the flag `--browser` to the test tool
+
+ node tools/test --run=cancel.js --browser
+
+This will automatically create a server (default port 9999) and open it in your default browser once the tests have been compiled.
+
+Keep the test tab active because some tests are timing-sensitive and will fail if the browser is throttling timeouts. Chrome will do this for example when the tab is not active.
+
+#### Supported options by the test tool
+
+The value of boolean flags is determined by presence, if you want to pass false value for a boolean flag, use the `no-`-prefix e.g. `--no-browser`.
+
+ - `--run=String` - Which tests to run (or compile when testing in browser). Default `"all"`. Can also be a glob string (relative to ./test/mocha folder).
+ - `--cover=String`. Create code coverage using the String as istanbul reporter. Coverage is created in the ./coverage folder. No coverage is created by default, default reporter is `"html"` (use `--cover` to use default reporter).
+ - `--browser` - Whether to compile tests for browsers. Default `false`.
+ - `--port=Number` - Port where local server is hosted when testing in browser. Default `9999`
+ - `--execute-browser-tests` - Whether to execute the compiled tests for browser when using `--browser`. Default `true`.
+ - `--open-browser` - Whether to open the default browser when executing browser tests. Default `true`.
+ - `--fake-timers` - Whether to use fake timers (`setTimeout` etc) when running tests in node. Default `true`.
+ - `--js-hint` - Whether to run JSHint on source files. Default `true`.
+ - `--saucelabs` - Whether to create a tunnel to sauce labs and run tests in their VMs instead of your browser when compiling tests for browser. Default `false`.
+
+## Benchmarks
+
+To run a benchmark, run the given command for a benchmark while on the project root. Requires bash (on windows the mingw32 that comes with git works fine too).
+
+Node 0.11.2+ is required to run the generator examples.
+
+### 1\. DoxBee sequential
+
+Currently the most relevant benchmark is @gorkikosev's benchmark in the article [Analysis of generators and other async patterns in node](http://spion.github.io/posts/analysis-generators-and-other-async-patterns-node.html). The benchmark emulates a situation where n amount of users are making a request in parallel to execute some mixed async/sync action. The benchmark has been modified to include a warm-up phase to minimize any JITing during timed sections.
+
+Command: `bench doxbee`
+
+### 2\. Made-up parallel
+
+This made-up scenario runs 15 shimmed queries in parallel.
+
+Command: `bench parallel`
+
+## Custom builds
+
+Custom builds for browsers are supported through a command-line utility.
+
+
+
+
+
+Make sure you have cloned the repo somewhere and did `npm install` successfully.
+
+After that you can run:
+
+ node tools/build --features="core"
+
+
+The above builds the most minimal build you can get. You can add more features separated by spaces from the above list:
+
+ node tools/build --features="core filter map reduce"
+
+The custom build file will be found from `/js/browser/bluebird.js`. It will have a comment that lists the disabled and enabled features.
+
+Note that the build leaves the `/js/main` etc folders with same features so if you use the folder for node.js at the same time, don't forget to build
+a full version afterwards (after having taken a copy of the bluebird.js somewhere):
+
+ node tools/build --debug --main --zalgo --browser --minify
+
+#### Supported options by the build tool
+
+The value of boolean flags is determined by presence, if you want to pass false value for a boolean flag, use the `no-`-prefix e.g. `--no-debug`.
+
+ - `--main` - Whether to build the main build. The main build is placed at `js/main` directory. Default `false`.
+ - `--debug` - Whether to build the debug build. The debug build is placed at `js/debug` directory. Default `false`.
+ - `--zalgo` - Whether to build the zalgo build. The zalgo build is placed at `js/zalgo` directory. Default `false`.
+ - `--browser` - Whether to compile the browser build. The browser build file is placed at `js/browser/bluebird.js` Default `false`.
+ - `--minify` - Whether to minify the compiled browser build. The minified browser build file is placed at `js/browser/bluebird.min.js` Default `true`.
+ - `--features=String` - See [custom builds](#custom-builds)
+
+
+
+## For library authors
+
+Building a library that depends on bluebird? You should know about a few features.
+
+If your library needs to do something obtrusive like adding or modifying methods on the `Promise` prototype, uses long stack traces or uses a custom unhandled rejection handler then... that's totally ok as long as you don't use `require("bluebird")`. Instead you should create a file
+that creates an isolated copy. For example, creating a file called `bluebird-extended.js` that contains:
+
+```js
+ //NOTE the function call right after
+module.exports = require("bluebird/js/main/promise")();
+```
+
+Your library can then use `var Promise = require("bluebird-extended");` and do whatever it wants with it. Then if the application or other library uses their own bluebird promises they will all play well together because of Promises/A+ thenable assimilation magic.
+
+You should also know about [`.nodeify()`](API.md#nodeifyfunction-callback---promise) which makes it easy to provide a dual callback/promise API.
+
+
+
+## What is the sync build?
+
+You may now use sync build by:
+
+ var Promise = require("bluebird/zalgo");
+
+The sync build is provided to see how forced asynchronity affects benchmarks. It should not be used in real code due to the implied hazards.
+
+The normal async build gives Promises/A+ guarantees about asynchronous resolution of promises. Some people think this affects performance or just plain love their code having a possibility
+of stack overflow errors and non-deterministic behavior.
+
+The sync build skips the async call trampoline completely, e.g code like:
+
+ async.invoke( this.fn, this, val );
+
+Appears as this in the sync build:
+
+ this.fn(val);
+
+This should pressure the CPU slightly less and thus the sync build should perform better. Indeed it does, but only marginally. The biggest performance boosts are from writing efficient Javascript, not from compromising determinism.
+
+Note that while some benchmarks are waiting for the next event tick, the CPU is actually not in use during that time. So the resulting benchmark result is not completely accurate because on node.js you only care about how much the CPU is taxed. Any time spent on CPU is time the whole process (or server) is paralyzed. And it is not graceful like it would be with threads.
+
+
+```js
+var cache = new Map(); //ES6 Map or DataStructures/Map or whatever...
+function getResult(url) {
+ var resolver = Promise.pending();
+ if (cache.has(url)) {
+ resolver.resolve(cache.get(url));
+ }
+ else {
+ http.get(url, function(err, content) {
+ if (err) resolver.reject(err);
+ else {
+ cache.set(url, content);
+ resolver.resolve(content);
+ }
+ });
+ }
+ return resolver.promise;
+}
+
+
+
+//The result of console.log is truly random without async guarantees
+function guessWhatItPrints( url ) {
+ var i = 3;
+ getResult(url).then(function(){
+ i = 4;
+ });
+ console.log(i);
+}
+```
+
+# Optimization guide
+
+Articles about optimization will be periodically posted in [the wiki section](https://github.com/petkaantonov/bluebird/wiki), polishing edits are welcome.
+
+A single cohesive guide compiled from the articles will probably be done eventually.
+
+# License
+
+The MIT License (MIT)
+
+Copyright (c) 2015 Petka Antonov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/bluebird/changelog.md b/Nodejs/node_modules/bluebird/changelog.md
new file mode 100644
index 0000000..406d215
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/changelog.md
@@ -0,0 +1,1730 @@
+## 2.11.0 (2016-08-30)
+
+Features:
+
+ - Add Promise.version
+ - Add Promise.getNewLibraryCopy
+
+## 2.10.2 (2015-10-01)
+
+Features:
+
+ - `.timeout()` now takes a custom error object as second argument
+
+## 2.10.1 (2015-09-21)
+
+ - Fix error "Cannot promisify an API that has normal methods with 'Async'-suffix" when promisifying certain objects with a custom promisifier
+
+## 2.10.0 (2015-09-08)
+
+Features:
+
+ - `Promise.using` can now take the promises-for-resources as an array ([#733](.)).
+ - Browser builds for minimal core are now hosted on CDN ([#724](.)).
+
+Bugfixes:
+
+ - Disabling debug mode with `BLUEBIRD_DEBUG=0` environment variable now works ([#719](.)).
+ - Fix unhandled rejection reporting when passing rejected promise to `.return()` ([#721](.)).
+ - Fix unbound promise's then handlers being called with wrong `this` value ([#738](.)).
+
+## 2.9.34 (2015-07-15)
+
+Bugfixes:
+
+- Correct domain for .map, .each, .filter, .reduce callbacks ([#701](.)).
+ - Preserve bound-with-promise promises across the entire chain ([#702](.)).
+
+## 2.9.33 (2015-07-09)
+
+Bugfixes:
+
+ - Methods on `Function.prototype` are no longer promisified ([#680](.)).
+
+## 2.9.32 (2015-07-03)
+
+Bugfixes:
+
+ - Fix `.return(primitiveValue)` returning a wrapped version of the primitive value when a Node.js domain is active ([#689](.)).
+
+## 2.9.31 (2015-07-03)
+
+Bugfixes:
+
+ - Fix Promises/A+ compliance issue regarding circular thenables: the correct behavior is to go into an infinite loop instead of warning with an error (Fixes [#682](.)).
+ - Fix "(node) warning: possible EventEmitter memory leak detected" ([#661](.)).
+ - Fix callbacks sometimes being called with a wrong node.js domain ([#664](.)).
+ - Fix callbacks sometimes not being called at all in iOS 8.1 WebApp mode ([#666](.), [#687](.)).
+
+## 2.9.30 (2015-06-14)
+
+Bugfixes:
+
+ - Fix regression with `promisifyAll` not promisifying certain methods
+
+## 2.9.29 (2015-06-14)
+
+Bugfixes:
+
+ - Improve `promisifyAll` detection of functions that are class constructors. Fixes mongodb 2.x promisification.
+
+## 2.9.28 (2015-06-14)
+
+Bugfixes:
+
+ - Fix handled rejection being reported as unhandled in certain scenarios when using [.all](.) or [Promise.join](.) ([#645](.))
+ - Fix custom scheduler not being called in Google Chrome when long stack traces are enabled ([#650](.))
+
+## 2.9.27 (2015-05-30)
+
+Bugfixes:
+
+ - Fix `sinon.useFakeTimers()` breaking scheduler ([#631](.))
+
+Misc:
+
+ - Add nw testing facilities (`node tools/test --nw`)
+
+## 2.9.26 (2015-05-25)
+
+Bugfixes:
+
+ - Fix crash in NW [#624](.)
+ - Fix [`.return()`](.) not supporting `undefined` as return value [#627](.)
+
+## 2.9.25 (2015-04-28)
+
+Bugfixes:
+
+ - Fix crash in node 0.8
+
+## 2.9.24 (2015-04-02)
+
+Bugfixes:
+
+ - Fix not being able to load multiple bluebird copies introduced in 2.9.22 ([#559](.), [#561](.), [#560](.)).
+
+## 2.9.23 (2015-04-02)
+
+Bugfixes:
+
+ - Fix node.js domain propagation ([#521](.)).
+
+## 2.9.22 (2015-04-02)
+
+ - Fix `.promisify` crashing in phantom JS ([#556](.))
+
+## 2.9.21 (2015-03-30)
+
+ - Fix error object's `'stack'`' overwriting causing an error when its defined to be a setter that throws an error ([#552](.)).
+
+## 2.9.20 (2015-03-29)
+
+Bugfixes:
+
+ - Fix regression where there is a long delay between calling `.cancel()` and promise actually getting cancelled in Chrome when long stack traces are enabled
+
+## 2.9.19 (2015-03-29)
+
+Bugfixes:
+
+ - Fix crashing in Chrome when long stack traces are disabled
+
+## 2.9.18 (2015-03-29)
+
+Bugfixes:
+
+ - Fix settlePromises using trampoline
+
+## 2.9.17 (2015-03-29)
+
+
+Bugfixes:
+
+ - Fix Chrome DevTools async stack traceability ([#542](.)).
+
+## 2.9.16 (2015-03-28)
+
+Features:
+
+ - Use setImmediate if available
+
+## 2.9.15 (2015-03-26)
+
+Features:
+
+ - Added `.asCallback` alias for `.nodeify`.
+
+Bugfixes:
+
+ - Don't always use nextTick, but try to pick up setImmediate or setTimeout in NW. Fixes [#534](.), [#525](.)
+ - Make progress a core feature. Fixes [#535](.) Note that progress has been removed in 3.x - this is only a fix necessary for 2.x custom builds.
+
+## 2.9.14 (2015-03-12)
+
+Bugfixes:
+
+ - Always use process.nextTick. Fixes [#525](.)
+
+## 2.9.13 (2015-02-27)
+
+Bugfixes:
+
+ - Fix .each, .filter, .reduce and .map callbacks being called synchornously if the input is immediate. ([#513](https://github.com/petkaantonov/bluebird/issues/513))
+
+## 2.9.12 (2015-02-19)
+
+Bugfixes:
+
+ - Fix memory leak introduced in 2.9.0 ([#502](https://github.com/petkaantonov/bluebird/issues/502))
+
+## 2.9.11 (2015-02-19)
+
+Bugfixes:
+
+ - Fix [#503](https://github.com/petkaantonov/bluebird/issues/503)
+
+## 2.9.10 (2015-02-18)
+
+Bugfixes:
+
+ - Fix [#501](https://github.com/petkaantonov/bluebird/issues/501)
+
+## 2.9.9 (2015-02-12)
+
+Bugfixes:
+
+ - Fix `TypeError: Cannot assign to read only property 'length'` when jsdom has declared a read-only length for all objects to inherit.
+
+## 2.9.8 (2015-02-10)
+
+Bugfixes:
+
+ - Fix regression introduced in 2.9.7 where promisify didn't properly dynamically look up methods on `this`
+
+## 2.9.7 (2015-02-08)
+
+Bugfixes:
+
+ - Fix `promisify` not retaining custom properties of the function. This enables promisifying the `"request"` module's export function and its methods at the same time.
+ - Fix `promisifyAll` methods being dependent on `this` when they are not originally dependent on `this`. This enables e.g. passing promisified `fs` functions directly as callbacks without having to bind them to `fs`.
+ - Fix `process.nextTick` being used over `setImmediate` in node.
+
+## 2.9.6 (2015-02-02)
+
+Bugfixes:
+
+ - Node environment detection can no longer be fooled
+
+## 2.9.5 (2015-02-02)
+
+Misc:
+
+ - Warn when [`.then()`](.) is passed non-functions
+
+## 2.9.4 (2015-01-30)
+
+Bugfixes:
+
+ - Fix [.timeout()](.) not calling `clearTimeout` with the proper handle in node causing the process to wait for unneeded timeout. This was a regression introduced in 2.9.1.
+
+## 2.9.3 (2015-01-27)
+
+Bugfixes:
+
+ - Fix node-webkit compatibility issue ([#467](https://github.com/petkaantonov/bluebird/pull/467))
+ - Fix long stack trace support in recent firefox versions
+
+## 2.9.2 (2015-01-26)
+
+Bugfixes:
+
+ - Fix critical bug regarding to using promisifyAll in browser that was introduced in 2.9.0 ([#466](https://github.com/petkaantonov/bluebird/issues/466)).
+
+Misc:
+
+ - Add `"browser"` entry point to package.json
+
+## 2.9.1 (2015-01-24)
+
+Features:
+
+ - If a bound promise is returned by the callback to [`Promise.method`](#promisemethodfunction-fn---function) and [`Promise.try`](#promisetryfunction-fn--arraydynamicdynamic-arguments--dynamic-ctx----promise), the returned promise will be bound to the same value
+
+## 2.9.0 (2015-01-24)
+
+Features:
+
+ - Add [`Promise.fromNode`](API.md#promisefromnodefunction-resolver---promise)
+ - Add new paramter `value` for [`Promise.bind`](API.md#promisebinddynamic-thisarg--dynamic-value---promise)
+
+Bugfixes:
+
+ - Fix several issues with [`cancellation`](API.md#cancellation) and [`.bind()`](API.md#binddynamic-thisarg---promise) interoperation when `thisArg` is a promise or thenable
+ - Fix promises created in [`disposers`](API#disposerfunction-disposer---disposer) not having proper long stack trace context
+ - Fix [`Promise.join`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) sometimes passing the passed in callback function as the last argument to itself.
+
+Misc:
+
+ - Reduce minified full browser build file size by not including unused code generation functionality.
+ - Major internal refactoring related to testing code and source code file layout
+
+## 2.8.2 (2015-01-20)
+
+Features:
+
+ - [Global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) are now fired both as DOM3 events and as legacy events in browsers
+
+## 2.8.1 (2015-01-20)
+
+Bugfixes:
+
+ - Fix long stack trace stiching consistency when rejected from thenables
+
+## 2.8.0 (2015-01-19)
+
+Features:
+
+ - Major debuggability improvements:
+ - Long stack traces have been re-designed. They are now much more readable,
+ succint, relevant and consistent across bluebird features.
+ - Long stack traces are supported now in IE10+
+
+## 2.7.1 (2015-01-15)
+
+Bugfixes:
+
+ - Fix [#447](https://github.com/petkaantonov/bluebird/issues/447)
+
+## 2.7.0 (2015-01-15)
+
+Features:
+
+ - Added more context to stack traces originating from coroutines ([#421](https://github.com/petkaantonov/bluebird/issues/421))
+ - Implemented [global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) ([#428](https://github.com/petkaantonov/bluebird/issues/428), [#357](https://github.com/petkaantonov/bluebird/issues/357))
+ - [Custom promisifiers](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-promisifier) are now passed the default promisifier which can be used to add enhancements on top of normal node promisification
+ - [Promisification filters](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-filter) are now passed `passesDefaultFilter` boolean
+
+Bugfixes:
+
+ - Fix `.noConflict()` call signature ([#446](https://github.com/petkaantonov/bluebird/issues/446))
+ - Fix `Promise.method`ified functions being called with `undefined` when they were called with no arguments
+
+## 2.6.4 (2015-01-12)
+
+Bugfixes:
+
+ - `OperationalErrors` thrown by promisified functions retain custom properties, such as `.code` and `.path`.
+
+## 2.6.3 (2015-01-12)
+
+Bugfixes:
+
+ - Fix [#429](https://github.com/petkaantonov/bluebird/issues/429)
+ - Fix [#432](https://github.com/petkaantonov/bluebird/issues/432)
+ - Fix [#433](https://github.com/petkaantonov/bluebird/issues/433)
+
+## 2.6.2 (2015-01-07)
+
+Bugfixes:
+
+ - Fix [#426](https://github.com/petkaantonov/bluebird/issues/426)
+
+## 2.6.1 (2015-01-07)
+
+Bugfixes:
+
+ - Fixed built browser files not being included in the git tag release for bower
+
+## 2.6.0 (2015-01-06)
+
+Features:
+
+ - Significantly improve parallel promise performance and memory usage (+50% faster, -50% less memory)
+
+
+## 2.5.3 (2014-12-30)
+
+## 2.5.2 (2014-12-29)
+
+Bugfixes:
+
+ - Fix bug where already resolved promise gets attached more handlers while calling its handlers resulting in some handlers not being called
+ - Fix bug where then handlers are not called in the same order as they would run if Promises/A+ 2.3.2 was implemented as adoption
+ - Fix bug where using `Object.create(null)` as a rejection reason would crash bluebird
+
+## 2.5.1 (2014-12-29)
+
+Bugfixes:
+
+ - Fix `.finally` throwing null error when it is derived from a promise that is resolved with a promise that is resolved with a promise
+
+## 2.5.0 (2014-12-28)
+
+Features:
+
+ - [`.get`](#API.md#https://github.com/petkaantonov/bluebird/blob/master/API.md#getstring-propertyname---promise) now supports negative indexing.
+
+Bugfixes:
+
+ - Fix bug with `Promise.method` wrapped function returning a promise that never resolves if the function returns a promise that is resolved with another promise
+ - Fix bug with `Promise.delay` never resolving if the value is a promise that is resolved with another promise
+
+## 2.4.3 (2014-12-28)
+
+Bugfixes:
+
+ - Fix memory leak as described in [this Promises/A+ spec issue](https://github.com/promises-aplus/promises-spec/issues/179).
+
+## 2.4.2 (2014-12-21)
+
+Bugfixes:
+
+ - Fix bug where spread rejected handler is ignored in case of rejection
+ - Fix synchronous scheduler passed to `setScheduler` causing infinite loop
+
+## 2.4.1 (2014-12-20)
+
+Features:
+
+ - Error messages now have links to wiki pages for additional information
+ - Promises now clean up all references (to handlers, child promises etc) as soon as possible.
+
+## 2.4.0 (2014-12-18)
+
+Features:
+
+ - Better filtering of bluebird internal calls in long stack traces, especially when using minified file in browsers
+ - Small performance improvements for all collection methods
+ - Promises now delete references to handlers attached to them as soon as possible
+ - Additional stack traces are now output on stderr/`console.warn` for errors that are thrown in the process/window from rejected `.done()` promises. See [#411](https://github.com/petkaantonov/bluebird/issues/411)
+
+## 2.3.11 (2014-10-31)
+
+Bugfixes:
+
+ - Fix [#371](https://github.com/petkaantonov/bluebird/issues/371), [#373](https://github.com/petkaantonov/bluebird/issues/373)
+
+
+## 2.3.10 (2014-10-28)
+
+Features:
+
+ - `Promise.method` no longer wraps primitive errors
+ - `Promise.try` no longer wraps primitive errors
+
+## 2.3.7 (2014-10-25)
+
+Bugfixes:
+
+ - Fix [#359](https://github.com/petkaantonov/bluebird/issues/359), [#362](https://github.com/petkaantonov/bluebird/issues/362) and [#364](https://github.com/petkaantonov/bluebird/issues/364)
+
+## 2.3.6 (2014-10-15)
+
+Features:
+
+ - Implement [`.reflect()`](API.md#reflect---promisepromiseinspection)
+
+## 2.3.5 (2014-10-06)
+
+Bugfixes:
+
+ - Fix issue when promisifying methods whose names contain the string 'args'
+
+## 2.3.4 (2014-09-27)
+
+ - `P` alias was not declared inside WebWorkers
+
+## 2.3.3 (2014-09-27)
+
+Bugfixes:
+
+ - Fix [#318](https://github.com/petkaantonov/bluebird/issues/318), [#314](https://github.com/petkaantonov/bluebird/issues/314)
+
+## 2.3.2 (2014-08-25)
+
+Bugfixes:
+
+ - `P` alias for `Promise` now exists in global scope when using browser builds without a module loader, fixing an issue with firefox extensions
+
+## 2.3.1 (2014-08-23)
+
+Features:
+
+ - `.using` can now be used with disposers created from different bluebird copy
+
+## 2.3.0 (2014-08-13)
+
+Features:
+
+ - [`.bind()`](API.md#binddynamic-thisarg---promise) and [`Promise.bind()`](API.md#promisebinddynamic-thisarg---promise) now await for the resolution of the `thisArg` if it's a promise or a thenable
+
+Bugfixes:
+
+ - Fix [#276](https://github.com/petkaantonov/bluebird/issues/276)
+
+## 2.2.2 (2014-07-14)
+
+ - Fix [#259](https://github.com/petkaantonov/bluebird/issues/259)
+
+## 2.2.1 (2014-07-07)
+
+ - Fix multiline error messages only showing the first line
+
+## 2.2.0 (2014-07-07)
+
+Bugfixes:
+
+ - `.any` and `.some` now consistently reject with RangeError when input array contains too few promises
+ - Fix iteration bug with `.reduce` when input array contains already fulfilled promises
+
+## 2.1.3 (2014-06-18)
+
+Bugfixes:
+
+ - Fix [#235](https://github.com/petkaantonov/bluebird/issues/235)
+
+## 2.1.2 (2014-06-15)
+
+Bugfixes:
+
+ - Fix [#232](https://github.com/petkaantonov/bluebird/issues/232)
+
+## 2.1.1 (2014-06-11)
+
+## 2.1.0 (2014-06-11)
+
+Features:
+
+ - Add [`promisifier`](API.md#option-promisifier) option to `Promise.promisifyAll()`
+ - Improve performance of `.props()` and collection methods when used with immediate values
+
+
+Bugfixes:
+
+ - Fix a bug where .reduce calls the callback for an already visited item
+ - Fix a bug where stack trace limit is calculated to be too small, which resulted in too short stack traces
+
+Add undocumented experimental `yieldHandler` option to `Promise.coroutine`
+
+## 2.0.7 (2014-06-08)
+## 2.0.6 (2014-06-07)
+## 2.0.5 (2014-06-05)
+## 2.0.4 (2014-06-05)
+## 2.0.3 (2014-06-05)
+## 2.0.2 (2014-06-04)
+## 2.0.1 (2014-06-04)
+
+## 2.0.0 (2014-06-04)
+
+#What's new in 2.0
+
+- [Resource management](API.md#resource-management) - never leak resources again
+- [Promisification](API.md#promisification) on steroids - entire modules can now be promisified with one line of code
+- [`.map()`](API.md#mapfunction-mapper--object-options---promise), [`.each()`](API.md#eachfunction-iterator---promise), [`.filter()`](API.md#filterfunction-filterer--object-options---promise), [`.reduce()`](API.md#reducefunction-reducer--dynamic-initialvalue---promise) reimagined from simple sugar to powerful concurrency coordination tools
+- [API Documentation](API.md) has been reorganized and more elaborate examples added
+- Deprecated [progression](#progression-migration) and [deferreds](#deferred-migration)
+- Improved performance and readability
+
+Features:
+
+- Added [`using()`](API.md#promiseusingpromisedisposer-promise-promisedisposer-promise--function-handler---promise) and [`disposer()`](API.md#disposerfunction-disposer---disposer)
+- [`.map()`](API.md#mapfunction-mapper--object-options---promise) now calls the handler as soon as items in the input array become fulfilled
+- Added a concurrency option to [`.map()`](API.md#mapfunction-mapper--object-options---promise)
+- [`.filter()`](API.md#filterfunction-filterer--object-options---promise) now calls the handler as soon as items in the input array become fulfilled
+- Added a concurrency option to [`.filter()`](API.md#filterfunction-filterer--object-options---promise)
+- [`.reduce()`](API.md#reducefunction-reducer--dynamic-initialvalue---promise) now calls the handler as soon as items in the input array become fulfilled, but in-order
+- Added [`.each()`](API.md#eachfunction-iterator---promise)
+- [`Promise.resolve()`](API.md#promiseresolvedynamic-value---promise) behaves like `Promise.cast`. `Promise.cast` deprecated.
+- [Synchronous inspection](API.md#synchronous-inspection): Removed `.inspect()`, added [`.value()`](API.md#value---dynamic) and [`.reason()`](API.md#reason---dynamic)
+- [`Promise.join()`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) now takes a function as the last argument
+- Added [`Promise.setScheduler()`](API.md#promisesetschedulerfunction-scheduler---void)
+- [`.cancel()`](API.md#cancelerror-reason---promise) supports a custom cancellation reason
+- [`.timeout()`](API.md#timeoutint-ms--string-message---promise) now cancels the promise instead of rejecting it
+- [`.nodeify()`](API.md#nodeifyfunction-callback--object-options---promise) now supports passing multiple success results when mapping promises to nodebacks
+- Added `suffix` and `filter` options to [`Promise.promisifyAll()`](API.md#promisepromisifyallobject-target--object-options---object)
+
+Breaking changes:
+
+- Sparse array holes are not skipped by collection methods but treated as existing elements with `undefined` value
+- `.map()` and `.filter()` do not call the given mapper or filterer function in any specific order
+- Removed the `.inspect()` method
+- Yielding an array from a coroutine is not supported by default. You can use [`coroutine.addYieldHandler()`](API.md#promisecoroutineaddyieldhandlerfunction-handler---void) to configure the old behavior (or any behavior you want).
+- [`.any()`](API.md#any---promise) and [`.some()`](API.md#someint-count---promise) no longer use an array as the rejection reason. [`AggregateError`](API.md#aggregateerror) is used instead.
+
+
+## 1.2.4 (2014-04-27)
+
+Bugfixes:
+
+ - Fix promisifyAll causing a syntax error when a method name is not a valid identifier
+ - Fix syntax error when es5.js is used in strict mode
+
+## 1.2.3 (2014-04-17)
+
+Bugfixes:
+
+ - Fix [#179](https://github.com/petkaantonov/bluebird/issues/179)
+
+## 1.2.2 (2014-04-09)
+
+Bugfixes:
+
+ - Promisified methods from promisifyAll no longer call the original method when it is overriden
+ - Nodeify doesn't pass second argument to the callback if the promise is fulfilled with `undefined`
+
+## 1.2.1 (2014-03-31)
+
+Bugfixes:
+
+ - Fix [#168](https://github.com/petkaantonov/bluebird/issues/168)
+
+## 1.2.0 (2014-03-29)
+
+Features:
+
+ - New method: [`.value()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#value---dynamic)
+ - New method: [`.reason()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#reason---dynamic)
+ - New method: [`Promise.onUnhandledRejectionHandled()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promiseonunhandledrejectionhandledfunction-handler---undefined)
+ - `Promise.map()`, `.map()`, `Promise.filter()` and `.filter()` start calling their callbacks as soon as possible while retaining a correct order. See [`8085922f`](https://github.com/petkaantonov/bluebird/commit/8085922fb95a9987fda0cf2337598ab4a98dc315).
+
+Bugfixes:
+
+ - Fix [#165](https://github.com/petkaantonov/bluebird/issues/165)
+ - Fix [#166](https://github.com/petkaantonov/bluebird/issues/166)
+
+## 1.1.1 (2014-03-18)
+
+Bugfixes:
+
+ - [#138](https://github.com/petkaantonov/bluebird/issues/138)
+ - [#144](https://github.com/petkaantonov/bluebird/issues/144)
+ - [#148](https://github.com/petkaantonov/bluebird/issues/148)
+ - [#151](https://github.com/petkaantonov/bluebird/issues/151)
+
+## 1.1.0 (2014-03-08)
+
+Features:
+
+ - Implement [`Promise.prototype.tap()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#tapfunction-handler---promise)
+ - Implement [`Promise.coroutine.addYieldHandler()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisecoroutineaddyieldhandlerfunction-handler---void)
+ - Deprecate `Promise.prototype.spawn`
+
+Bugfixes:
+
+ - Fix already rejected promises being reported as unhandled when handled through collection methods
+ - Fix browserisfy crashing from checking `process.version.indexOf`
+
+## 1.0.8 (2014-03-03)
+
+Bugfixes:
+
+ - Fix active domain being lost across asynchronous boundaries in Node.JS 10.xx
+
+## 1.0.7 (2014-02-25)
+
+Bugfixes:
+
+ - Fix handled errors being reported
+
+## 1.0.6 (2014-02-17)
+
+Bugfixes:
+
+ - Fix bug with unhandled rejections not being reported
+ when using `Promise.try` or `Promise.method` without
+ attaching further handlers
+
+## 1.0.5 (2014-02-15)
+
+Features:
+
+ - Node.js performance: promisified functions try to check amount of passed arguments in most optimal order
+ - Node.js promisified functions will have same `.length` as the original function minus one (for the callback parameter)
+
+## 1.0.4 (2014-02-09)
+
+Features:
+
+ - Possibly unhandled rejection handler will always get a stack trace, even if the rejection or thrown error was not an error
+ - Unhandled rejections are tracked per promise, not per error. So if you create multiple branches from a single ancestor and that ancestor gets rejected, each branch with no error handler with the end will cause a possibly unhandled rejection handler invocation
+
+Bugfixes:
+
+ - Fix unhandled non-writable objects or primitives not reported by possibly unhandled rejection handler
+
+## 1.0.3 (2014-02-05)
+
+Bugfixes:
+
+ - [#93](https://github.com/petkaantonov/bluebird/issues/93)
+
+## 1.0.2 (2014-02-04)
+
+Features:
+
+ - Significantly improve performance of foreign bluebird thenables
+
+Bugfixes:
+
+ - [#88](https://github.com/petkaantonov/bluebird/issues/88)
+
+## 1.0.1 (2014-01-28)
+
+Features:
+
+ - Error objects that have property `.isAsync = true` will now be caught by `.error()`
+
+Bugfixes:
+
+ - Fix TypeError and RangeError shims not working without `new` operator
+
+## 1.0.0 (2014-01-12)
+
+Features:
+
+ - `.filter`, `.map`, and `.reduce` no longer skip sparse array holes. This is a backwards incompatible change.
+ - Like `.map` and `.filter`, `.reduce` now allows returning promises and thenables from the iteration function.
+
+Bugfixes:
+
+ - [#58](https://github.com/petkaantonov/bluebird/issues/58)
+ - [#61](https://github.com/petkaantonov/bluebird/issues/61)
+ - [#64](https://github.com/petkaantonov/bluebird/issues/64)
+ - [#60](https://github.com/petkaantonov/bluebird/issues/60)
+
+## 0.11.6-1 (2013-12-29)
+
+## 0.11.6-0 (2013-12-29)
+
+Features:
+
+ - You may now return promises and thenables from the filterer function used in `Promise.filter` and `Promise.prototype.filter`.
+
+ - `.error()` now catches additional sources of rejections:
+
+ - Rejections originating from `Promise.reject`
+
+ - Rejections originating from thenables using
+ the `reject` callback
+
+ - Rejections originating from promisified callbacks
+ which use the `errback` argument
+
+ - Rejections originating from `new Promise` constructor
+ where the `reject` callback is called explicitly
+
+ - Rejections originating from `PromiseResolver` where
+ `.reject()` method is called explicitly
+
+Bugfixes:
+
+ - Fix `captureStackTrace` being called when it was `null`
+ - Fix `Promise.map` not unwrapping thenables
+
+## 0.11.5-1 (2013-12-15)
+
+## 0.11.5-0 (2013-12-03)
+
+Features:
+
+ - Improve performance of collection methods
+ - Improve performance of promise chains
+
+## 0.11.4-1 (2013-12-02)
+
+## 0.11.4-0 (2013-12-02)
+
+Bugfixes:
+
+ - Fix `Promise.some` behavior with arguments like negative integers, 0...
+ - Fix stack traces of synchronously throwing promisified functions'
+
+## 0.11.3-0 (2013-12-02)
+
+Features:
+
+ - Improve performance of generators
+
+Bugfixes:
+
+ - Fix critical bug with collection methods.
+
+## 0.11.2-0 (2013-12-02)
+
+Features:
+
+ - Improve performance of all collection methods
+
+## 0.11.1-0 (2013-12-02)
+
+Features:
+
+- Improve overall performance.
+- Improve performance of promisified functions.
+- Improve performance of catch filters.
+- Improve performance of .finally.
+
+Bugfixes:
+
+- Fix `.finally()` rejecting if passed non-function. It will now ignore non-functions like `.then`.
+- Fix `.finally()` not converting thenables returned from the handler to promises.
+- `.spread()` now rejects if the ultimate value given to it is not spreadable.
+
+## 0.11.0-0 (2013-12-02)
+
+Features:
+
+ - Improve overall performance when not using `.bind()` or cancellation.
+ - Promises are now not cancellable by default. This is backwards incompatible change - see [`.cancellable()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#cancellable---promise)
+ - [`Promise.delay`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisedelaydynamic-value-int-ms---promise)
+ - [`.delay()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#delayint-ms---promise)
+ - [`.timeout()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#timeoutint-ms--string-message---promise)
+
+## 0.10.14-0 (2013-12-01)
+
+Bugfixes:
+
+ - Fix race condition when mixing 3rd party asynchrony.
+
+## 0.10.13-1 (2013-11-30)
+
+## 0.10.13-0 (2013-11-30)
+
+Bugfixes:
+
+ - Fix another bug with progression.
+
+## 0.10.12-0 (2013-11-30)
+
+Bugfixes:
+
+ - Fix bug with progression.
+
+## 0.10.11-4 (2013-11-29)
+
+## 0.10.11-2 (2013-11-29)
+
+Bugfixes:
+
+ - Fix `.race()` not propagating bound values.
+
+## 0.10.11-1 (2013-11-29)
+
+Features:
+
+ - Improve performance of `Promise.race`
+
+## 0.10.11-0 (2013-11-29)
+
+Bugfixes:
+
+ - Fixed `Promise.promisifyAll` invoking property accessors. Only data properties with function values are considered.
+
+## 0.10.10-0 (2013-11-28)
+
+Features:
+
+ - Disable long stack traces in browsers by default. Call `Promise.longStackTraces()` to enable them.
+
+## 0.10.9-1 (2013-11-27)
+
+Bugfixes:
+
+ - Fail early when `new Promise` is constructed incorrectly
+
+## 0.10.9-0 (2013-11-27)
+
+Bugfixes:
+
+ - Promise.props now takes a [thenable-for-collection](https://github.com/petkaantonov/bluebird/blob/f41edac61b7c421608ff439bb5a09b7cffeadcf9/test/mocha/props.js#L197-L217)
+ - All promise collection methods now reject when a promise-or-thenable-for-collection turns out not to give a collection
+
+## 0.10.8-0 (2013-11-25)
+
+Features:
+
+ - All static collection methods take thenable-for-collection
+
+## 0.10.7-0 (2013-11-25)
+
+Features:
+
+ - throw TypeError when thenable resolves with itself
+ - Make .race() and Promise.race() forever pending on empty collections
+
+## 0.10.6-0 (2013-11-25)
+
+Bugfixes:
+
+ - Promise.resolve and PromiseResolver.resolve follow thenables too.
+
+## 0.10.5-0 (2013-11-24)
+
+Bugfixes:
+
+ - Fix infinite loop when thenable resolves with itself
+
+## 0.10.4-1 (2013-11-24)
+
+Bugfixes:
+
+ - Fix a file missing from build. (Critical fix)
+
+## 0.10.4-0 (2013-11-24)
+
+Features:
+
+ - Remove dependency of es5-shim and es5-sham when using ES3.
+
+## 0.10.3-0 (2013-11-24)
+
+Features:
+
+ - Improve performance of `Promise.method`
+
+## 0.10.2-1 (2013-11-24)
+
+Features:
+
+ - Rename PromiseResolver#asCallback to PromiseResolver#callback
+
+## 0.10.2-0 (2013-11-24)
+
+Features:
+
+ - Remove memoization of thenables
+
+## 0.10.1-0 (2013-11-21)
+
+Features:
+
+ - Add methods `Promise.resolve()`, `Promise.reject()`, `Promise.defer()` and `.resolve()`.
+
+## 0.10.0-1 (2013-11-17)
+
+## 0.10.0-0 (2013-11-17)
+
+Features:
+
+ - Implement `Promise.method()`
+ - Implement `.return()`
+ - Implement `.throw()`
+
+Bugfixes:
+
+ - Fix promises being able to use themselves as resolution or follower value
+
+## 0.9.11-1 (2013-11-14)
+
+Features:
+
+ - Implicit `Promise.all()` when yielding an array from generators
+
+## 0.9.11-0 (2013-11-13)
+
+Bugfixes:
+
+ - Fix `.spread` not unwrapping thenables
+
+## 0.9.10-2 (2013-11-13)
+
+Features:
+
+ - Improve performance of promisified functions on V8
+
+Bugfixes:
+
+ - Report unhandled rejections even when long stack traces are disabled
+ - Fix `.error()` showing up in stack traces
+
+## 0.9.10-1 (2013-11-05)
+
+Bugfixes:
+
+ - Catch filter method calls showing in stack traces
+
+## 0.9.10-0 (2013-11-05)
+
+Bugfixes:
+
+ - Support primitives in catch filters
+
+## 0.9.9-0 (2013-11-05)
+
+Features:
+
+ - Add `Promise.race()` and `.race()`
+
+## 0.9.8-0 (2013-11-01)
+
+Bugfixes:
+
+ - Fix bug with `Promise.try` not unwrapping returned promises and thenables
+
+## 0.9.7-0 (2013-10-29)
+
+Bugfixes:
+
+ - Fix bug with build files containing duplicated code for promise.js
+
+## 0.9.6-0 (2013-10-28)
+
+Features:
+
+ - Improve output of reporting unhandled non-errors
+ - Implement RejectionError wrapping and `.error()` method
+
+## 0.9.5-0 (2013-10-27)
+
+Features:
+
+ - Allow fresh copies of the library to be made
+
+## 0.9.4-1 (2013-10-27)
+
+## 0.9.4-0 (2013-10-27)
+
+Bugfixes:
+
+ - Rollback non-working multiple fresh copies feature
+
+## 0.9.3-0 (2013-10-27)
+
+Features:
+
+ - Allow fresh copies of the library to be made
+ - Add more components to customized builds
+
+## 0.9.2-1 (2013-10-25)
+
+## 0.9.2-0 (2013-10-25)
+
+Features:
+
+ - Allow custom builds
+
+## 0.9.1-1 (2013-10-22)
+
+Bugfixes:
+
+ - Fix unhandled rethrown exceptions not reported
+
+## 0.9.1-0 (2013-10-22)
+
+Features:
+
+ - Improve performance of `Promise.try`
+ - Extend `Promise.try` to accept arguments and ctx to make it more usable in promisification of synchronous functions.
+
+## 0.9.0-0 (2013-10-18)
+
+Features:
+
+ - Implement `.bind` and `Promise.bind`
+
+Bugfixes:
+
+ - Fix `.some()` when argument is a pending promise that later resolves to an array
+
+## 0.8.5-1 (2013-10-17)
+
+Features:
+
+ - Enable process wide long stack traces through BLUEBIRD_DEBUG environment variable
+
+## 0.8.5-0 (2013-10-16)
+
+Features:
+
+ - Improve performance of all collection methods
+
+Bugfixes:
+
+ - Fix .finally passing the value to handlers
+ - Remove kew from benchmarks due to bugs in the library breaking the benchmark
+ - Fix some bluebird library calls potentially appearing in stack traces
+
+## 0.8.4-1 (2013-10-15)
+
+Bugfixes:
+
+ - Fix .pending() call showing in long stack traces
+
+## 0.8.4-0 (2013-10-15)
+
+Bugfixes:
+
+ - Fix PromiseArray and its sub-classes swallowing possibly unhandled rejections
+
+## 0.8.3-3 (2013-10-14)
+
+Bugfixes:
+
+ - Fix AMD-declaration using named module.
+
+## 0.8.3-2 (2013-10-14)
+
+Features:
+
+ - The mortals that can handle it may now release Zalgo by `require("bluebird/zalgo");`
+
+## 0.8.3-1 (2013-10-14)
+
+Bugfixes:
+
+ - Fix memory leak when using the same promise to attach handlers over and over again
+
+## 0.8.3-0 (2013-10-13)
+
+Features:
+
+ - Add `Promise.props()` and `Promise.prototype.props()`. They work like `.all()` for object properties.
+
+Bugfixes:
+
+ - Fix bug with .some returning garbage when sparse arrays have rejections
+
+## 0.8.2-2 (2013-10-13)
+
+Features:
+
+ - Improve performance of `.reduce()` when `initialValue` can be synchronously cast to a value
+
+## 0.8.2-1 (2013-10-12)
+
+Bugfixes:
+
+ - Fix .npmignore having irrelevant files
+
+## 0.8.2-0 (2013-10-12)
+
+Features:
+
+ - Improve performance of `.some()`
+
+## 0.8.1-0 (2013-10-11)
+
+Bugfixes:
+
+ - Remove uses of dynamic evaluation (`new Function`, `eval` etc) when strictly not necessary. Use feature detection to use static evaluation to avoid errors when dynamic evaluation is prohibited.
+
+## 0.8.0-3 (2013-10-10)
+
+Features:
+
+ - Add `.asCallback` property to `PromiseResolver`s
+
+## 0.8.0-2 (2013-10-10)
+
+## 0.8.0-1 (2013-10-09)
+
+Features:
+
+ - Improve overall performance. Be able to sustain infinite recursion when using promises.
+
+## 0.8.0-0 (2013-10-09)
+
+Bugfixes:
+
+ - Fix stackoverflow error when function calls itself "synchronously" from a promise handler
+
+## 0.7.12-2 (2013-10-09)
+
+Bugfixes:
+
+ - Fix safari 6 not using `MutationObserver` as a scheduler
+ - Fix process exceptions interfering with internal queue flushing
+
+## 0.7.12-1 (2013-10-09)
+
+Bugfixes:
+
+ - Don't try to detect if generators are available to allow shims to be used
+
+## 0.7.12-0 (2013-10-08)
+
+Features:
+
+ - Promisification now consider all functions on the object and its prototype chain
+ - Individual promisifcation uses current `this` if no explicit receiver is given
+ - Give better stack traces when promisified callbacks throw or errback primitives such as strings by wrapping them in an `Error` object.
+
+Bugfixes:
+
+ - Fix runtime APIs throwing synchronous errors
+
+## 0.7.11-0 (2013-10-08)
+
+Features:
+
+ - Deprecate `Promise.promisify(Object target)` in favor of `Promise.promisifyAll(Object target)` to avoid confusion with function objects
+ - Coroutines now throw error when a non-promise is `yielded`
+
+## 0.7.10-1 (2013-10-05)
+
+Features:
+
+ - Make tests pass Internet Explorer 8
+
+## 0.7.10-0 (2013-10-05)
+
+Features:
+
+ - Create browser tests
+
+## 0.7.9-1 (2013-10-03)
+
+Bugfixes:
+
+ - Fix promise cast bug when thenable fulfills using itself as the fulfillment value
+
+## 0.7.9-0 (2013-10-03)
+
+Features:
+
+ - More performance improvements when long stack traces are enabled
+
+## 0.7.8-1 (2013-10-02)
+
+Features:
+
+ - Performance improvements when long stack traces are enabled
+
+## 0.7.8-0 (2013-10-02)
+
+Bugfixes:
+
+ - Fix promisified methods not turning synchronous exceptions into rejections
+
+## 0.7.7-1 (2013-10-02)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.7-0 (2013-10-01)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.6-0 (2013-09-29)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.5-0 (2013-09-28)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.4-1 (2013-09-28)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.4-0 (2013-09-28)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.3-1 (2013-09-28)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.3-0 (2013-09-27)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.2-0 (2013-09-27)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.1-5 (2013-09-26)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.1-4 (2013-09-25)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.1-3 (2013-09-25)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.1-2 (2013-09-24)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.1-1 (2013-09-24)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.1-0 (2013-09-24)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.0-1 (2013-09-23)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.7.0-0 (2013-09-23)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.5-2 (2013-09-20)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.5-1 (2013-09-18)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.5-0 (2013-09-18)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.4-1 (2013-09-18)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.4-0 (2013-09-18)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.3-4 (2013-09-18)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.3-3 (2013-09-18)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.3-2 (2013-09-16)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.3-1 (2013-09-16)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.3-0 (2013-09-15)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.2-1 (2013-09-14)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.2-0 (2013-09-14)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.1-0 (2013-09-14)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.6.0-0 (2013-09-13)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.9-6 (2013-09-12)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.9-5 (2013-09-12)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.9-4 (2013-09-12)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.9-3 (2013-09-11)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.9-2 (2013-09-11)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.9-1 (2013-09-11)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.9-0 (2013-09-11)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.8-1 (2013-09-11)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.8-0 (2013-09-11)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.7-0 (2013-09-11)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.6-1 (2013-09-10)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.6-0 (2013-09-10)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.5-1 (2013-09-10)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.5-0 (2013-09-09)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.4-1 (2013-09-08)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.4-0 (2013-09-08)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.3-0 (2013-09-07)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.2-0 (2013-09-07)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.1-0 (2013-09-07)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.5.0-0 (2013-09-07)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.4.0-0 (2013-09-06)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.3.0-1 (2013-09-06)
+
+Features:
+
+ - feature
+
+Bugfixes:
+
+ - bugfix
+
+## 0.3.0 (2013-09-06)
diff --git a/Nodejs/node_modules/bluebird/js/browser/bluebird.js b/Nodejs/node_modules/bluebird/js/browser/bluebird.js
new file mode 100644
index 0000000..2f7c13f
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/browser/bluebird.js
@@ -0,0 +1,4892 @@
+/* @preserve
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2013-2015 Petka Antonov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
+/**
+ * bluebird build version 2.11.0
+ * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers
+*/
+!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0;
+};
+
+Async.prototype.throwLater = function(fn, arg) {
+ if (arguments.length === 1) {
+ arg = fn;
+ fn = function () { throw arg; };
+ }
+ if (typeof setTimeout !== "undefined") {
+ setTimeout(function() {
+ fn(arg);
+ }, 0);
+ } else try {
+ this._schedule(function() {
+ fn(arg);
+ });
+ } catch (e) {
+ throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a");
+ }
+};
+
+function AsyncInvokeLater(fn, receiver, arg) {
+ this._lateQueue.push(fn, receiver, arg);
+ this._queueTick();
+}
+
+function AsyncInvoke(fn, receiver, arg) {
+ this._normalQueue.push(fn, receiver, arg);
+ this._queueTick();
+}
+
+function AsyncSettlePromises(promise) {
+ this._normalQueue._pushOne(promise);
+ this._queueTick();
+}
+
+if (!util.hasDevTools) {
+ Async.prototype.invokeLater = AsyncInvokeLater;
+ Async.prototype.invoke = AsyncInvoke;
+ Async.prototype.settlePromises = AsyncSettlePromises;
+} else {
+ if (schedule.isStatic) {
+ schedule = function(fn) { setTimeout(fn, 0); };
+ }
+ Async.prototype.invokeLater = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvokeLater.call(this, fn, receiver, arg);
+ } else {
+ this._schedule(function() {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 100);
+ });
+ }
+ };
+
+ Async.prototype.invoke = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvoke.call(this, fn, receiver, arg);
+ } else {
+ this._schedule(function() {
+ fn.call(receiver, arg);
+ });
+ }
+ };
+
+ Async.prototype.settlePromises = function(promise) {
+ if (this._trampolineEnabled) {
+ AsyncSettlePromises.call(this, promise);
+ } else {
+ this._schedule(function() {
+ promise._settlePromises();
+ });
+ }
+ };
+}
+
+Async.prototype.invokeFirst = function (fn, receiver, arg) {
+ this._normalQueue.unshift(fn, receiver, arg);
+ this._queueTick();
+};
+
+Async.prototype._drainQueue = function(queue) {
+ while (queue.length() > 0) {
+ var fn = queue.shift();
+ if (typeof fn !== "function") {
+ fn._settlePromises();
+ continue;
+ }
+ var receiver = queue.shift();
+ var arg = queue.shift();
+ fn.call(receiver, arg);
+ }
+};
+
+Async.prototype._drainQueues = function () {
+ this._drainQueue(this._normalQueue);
+ this._reset();
+ this._drainQueue(this._lateQueue);
+};
+
+Async.prototype._queueTick = function () {
+ if (!this._isTickUsed) {
+ this._isTickUsed = true;
+ this._schedule(this.drainQueues);
+ }
+};
+
+Async.prototype._reset = function () {
+ this._isTickUsed = false;
+};
+
+module.exports = new Async();
+module.exports.firstLineError = firstLineError;
+
+},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, INTERNAL, tryConvertToPromise) {
+var rejectThis = function(_, e) {
+ this._reject(e);
+};
+
+var targetRejected = function(e, context) {
+ context.promiseRejectionQueued = true;
+ context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
+};
+
+var bindingResolved = function(thisArg, context) {
+ if (this._isPending()) {
+ this._resolveCallback(context.target);
+ }
+};
+
+var bindingRejected = function(e, context) {
+ if (!context.promiseRejectionQueued) this._reject(e);
+};
+
+Promise.prototype.bind = function (thisArg) {
+ var maybePromise = tryConvertToPromise(thisArg);
+ var ret = new Promise(INTERNAL);
+ ret._propagateFrom(this, 1);
+ var target = this._target();
+
+ ret._setBoundTo(maybePromise);
+ if (maybePromise instanceof Promise) {
+ var context = {
+ promiseRejectionQueued: false,
+ promise: ret,
+ target: target,
+ bindingPromise: maybePromise
+ };
+ target._then(INTERNAL, targetRejected, ret._progress, ret, context);
+ maybePromise._then(
+ bindingResolved, bindingRejected, ret._progress, ret, context);
+ } else {
+ ret._resolveCallback(target);
+ }
+ return ret;
+};
+
+Promise.prototype._setBoundTo = function (obj) {
+ if (obj !== undefined) {
+ this._bitField = this._bitField | 131072;
+ this._boundTo = obj;
+ } else {
+ this._bitField = this._bitField & (~131072);
+ }
+};
+
+Promise.prototype._isBound = function () {
+ return (this._bitField & 131072) === 131072;
+};
+
+Promise.bind = function (thisArg, value) {
+ var maybePromise = tryConvertToPromise(thisArg);
+ var ret = new Promise(INTERNAL);
+
+ ret._setBoundTo(maybePromise);
+ if (maybePromise instanceof Promise) {
+ maybePromise._then(function() {
+ ret._resolveCallback(value);
+ }, ret._reject, ret._progress, ret, null);
+ } else {
+ ret._resolveCallback(value);
+ }
+ return ret;
+};
+};
+
+},{}],4:[function(_dereq_,module,exports){
+"use strict";
+var old;
+if (typeof Promise !== "undefined") old = Promise;
+function noConflict() {
+ try { if (Promise === bluebird) Promise = old; }
+ catch (e) {}
+ return bluebird;
+}
+var bluebird = _dereq_("./promise.js")();
+bluebird.noConflict = noConflict;
+module.exports = bluebird;
+
+},{"./promise.js":23}],5:[function(_dereq_,module,exports){
+"use strict";
+var cr = Object.create;
+if (cr) {
+ var callerCache = cr(null);
+ var getterCache = cr(null);
+ callerCache[" size"] = getterCache[" size"] = 0;
+}
+
+module.exports = function(Promise) {
+var util = _dereq_("./util.js");
+var canEvaluate = util.canEvaluate;
+var isIdentifier = util.isIdentifier;
+
+var getMethodCaller;
+var getGetter;
+if (!true) {
+var makeMethodCaller = function (methodName) {
+ return new Function("ensureMethod", " \n\
+ return function(obj) { \n\
+ 'use strict' \n\
+ var len = this.length; \n\
+ ensureMethod(obj, 'methodName'); \n\
+ switch(len) { \n\
+ case 1: return obj.methodName(this[0]); \n\
+ case 2: return obj.methodName(this[0], this[1]); \n\
+ case 3: return obj.methodName(this[0], this[1], this[2]); \n\
+ case 0: return obj.methodName(); \n\
+ default: \n\
+ return obj.methodName.apply(obj, this); \n\
+ } \n\
+ }; \n\
+ ".replace(/methodName/g, methodName))(ensureMethod);
+};
+
+var makeGetter = function (propertyName) {
+ return new Function("obj", " \n\
+ 'use strict'; \n\
+ return obj.propertyName; \n\
+ ".replace("propertyName", propertyName));
+};
+
+var getCompiled = function(name, compiler, cache) {
+ var ret = cache[name];
+ if (typeof ret !== "function") {
+ if (!isIdentifier(name)) {
+ return null;
+ }
+ ret = compiler(name);
+ cache[name] = ret;
+ cache[" size"]++;
+ if (cache[" size"] > 512) {
+ var keys = Object.keys(cache);
+ for (var i = 0; i < 256; ++i) delete cache[keys[i]];
+ cache[" size"] = keys.length - 256;
+ }
+ }
+ return ret;
+};
+
+getMethodCaller = function(name) {
+ return getCompiled(name, makeMethodCaller, callerCache);
+};
+
+getGetter = function(name) {
+ return getCompiled(name, makeGetter, getterCache);
+};
+}
+
+function ensureMethod(obj, methodName) {
+ var fn;
+ if (obj != null) fn = obj[methodName];
+ if (typeof fn !== "function") {
+ var message = "Object " + util.classString(obj) + " has no method '" +
+ util.toString(methodName) + "'";
+ throw new Promise.TypeError(message);
+ }
+ return fn;
+}
+
+function caller(obj) {
+ var methodName = this.pop();
+ var fn = ensureMethod(obj, methodName);
+ return fn.apply(obj, this);
+}
+Promise.prototype.call = function (methodName) {
+ var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}
+ if (!true) {
+ if (canEvaluate) {
+ var maybeCaller = getMethodCaller(methodName);
+ if (maybeCaller !== null) {
+ return this._then(
+ maybeCaller, undefined, undefined, args, undefined);
+ }
+ }
+ }
+ args.push(methodName);
+ return this._then(caller, undefined, undefined, args, undefined);
+};
+
+function namedGetter(obj) {
+ return obj[this];
+}
+function indexedGetter(obj) {
+ var index = +this;
+ if (index < 0) index = Math.max(0, index + obj.length);
+ return obj[index];
+}
+Promise.prototype.get = function (propertyName) {
+ var isIndex = (typeof propertyName === "number");
+ var getter;
+ if (!isIndex) {
+ if (canEvaluate) {
+ var maybeGetter = getGetter(propertyName);
+ getter = maybeGetter !== null ? maybeGetter : namedGetter;
+ } else {
+ getter = namedGetter;
+ }
+ } else {
+ getter = indexedGetter;
+ }
+ return this._then(getter, undefined, undefined, propertyName, undefined);
+};
+};
+
+},{"./util.js":38}],6:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise) {
+var errors = _dereq_("./errors.js");
+var async = _dereq_("./async.js");
+var CancellationError = errors.CancellationError;
+
+Promise.prototype._cancel = function (reason) {
+ if (!this.isCancellable()) return this;
+ var parent;
+ var promiseToReject = this;
+ while ((parent = promiseToReject._cancellationParent) !== undefined &&
+ parent.isCancellable()) {
+ promiseToReject = parent;
+ }
+ this._unsetCancellable();
+ promiseToReject._target()._rejectCallback(reason, false, true);
+};
+
+Promise.prototype.cancel = function (reason) {
+ if (!this.isCancellable()) return this;
+ if (reason === undefined) reason = new CancellationError();
+ async.invokeLater(this._cancel, this, reason);
+ return this;
+};
+
+Promise.prototype.cancellable = function () {
+ if (this._cancellable()) return this;
+ async.enableTrampoline();
+ this._setCancellable();
+ this._cancellationParent = undefined;
+ return this;
+};
+
+Promise.prototype.uncancellable = function () {
+ var ret = this.then();
+ ret._unsetCancellable();
+ return ret;
+};
+
+Promise.prototype.fork = function (didFulfill, didReject, didProgress) {
+ var ret = this._then(didFulfill, didReject, didProgress,
+ undefined, undefined);
+
+ ret._setCancellable();
+ ret._cancellationParent = undefined;
+ return ret;
+};
+};
+
+},{"./async.js":2,"./errors.js":13}],7:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function() {
+var async = _dereq_("./async.js");
+var util = _dereq_("./util.js");
+var bluebirdFramePattern =
+ /[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/;
+var stackFramePattern = null;
+var formatStack = null;
+var indentStackFrames = false;
+var warn;
+
+function CapturedTrace(parent) {
+ this._parent = parent;
+ var length = this._length = 1 + (parent === undefined ? 0 : parent._length);
+ captureStackTrace(this, CapturedTrace);
+ if (length > 32) this.uncycle();
+}
+util.inherits(CapturedTrace, Error);
+
+CapturedTrace.prototype.uncycle = function() {
+ var length = this._length;
+ if (length < 2) return;
+ var nodes = [];
+ var stackToIndex = {};
+
+ for (var i = 0, node = this; node !== undefined; ++i) {
+ nodes.push(node);
+ node = node._parent;
+ }
+ length = this._length = i;
+ for (var i = length - 1; i >= 0; --i) {
+ var stack = nodes[i].stack;
+ if (stackToIndex[stack] === undefined) {
+ stackToIndex[stack] = i;
+ }
+ }
+ for (var i = 0; i < length; ++i) {
+ var currentStack = nodes[i].stack;
+ var index = stackToIndex[currentStack];
+ if (index !== undefined && index !== i) {
+ if (index > 0) {
+ nodes[index - 1]._parent = undefined;
+ nodes[index - 1]._length = 1;
+ }
+ nodes[i]._parent = undefined;
+ nodes[i]._length = 1;
+ var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;
+
+ if (index < length - 1) {
+ cycleEdgeNode._parent = nodes[index + 1];
+ cycleEdgeNode._parent.uncycle();
+ cycleEdgeNode._length =
+ cycleEdgeNode._parent._length + 1;
+ } else {
+ cycleEdgeNode._parent = undefined;
+ cycleEdgeNode._length = 1;
+ }
+ var currentChildLength = cycleEdgeNode._length + 1;
+ for (var j = i - 2; j >= 0; --j) {
+ nodes[j]._length = currentChildLength;
+ currentChildLength++;
+ }
+ return;
+ }
+ }
+};
+
+CapturedTrace.prototype.parent = function() {
+ return this._parent;
+};
+
+CapturedTrace.prototype.hasParent = function() {
+ return this._parent !== undefined;
+};
+
+CapturedTrace.prototype.attachExtraTrace = function(error) {
+ if (error.__stackCleaned__) return;
+ this.uncycle();
+ var parsed = CapturedTrace.parseStackAndMessage(error);
+ var message = parsed.message;
+ var stacks = [parsed.stack];
+
+ var trace = this;
+ while (trace !== undefined) {
+ stacks.push(cleanStack(trace.stack.split("\n")));
+ trace = trace._parent;
+ }
+ removeCommonRoots(stacks);
+ removeDuplicateOrEmptyJumps(stacks);
+ util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
+ util.notEnumerableProp(error, "__stackCleaned__", true);
+};
+
+function reconstructStack(message, stacks) {
+ for (var i = 0; i < stacks.length - 1; ++i) {
+ stacks[i].push("From previous event:");
+ stacks[i] = stacks[i].join("\n");
+ }
+ if (i < stacks.length) {
+ stacks[i] = stacks[i].join("\n");
+ }
+ return message + "\n" + stacks.join("\n");
+}
+
+function removeDuplicateOrEmptyJumps(stacks) {
+ for (var i = 0; i < stacks.length; ++i) {
+ if (stacks[i].length === 0 ||
+ ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {
+ stacks.splice(i, 1);
+ i--;
+ }
+ }
+}
+
+function removeCommonRoots(stacks) {
+ var current = stacks[0];
+ for (var i = 1; i < stacks.length; ++i) {
+ var prev = stacks[i];
+ var currentLastIndex = current.length - 1;
+ var currentLastLine = current[currentLastIndex];
+ var commonRootMeetPoint = -1;
+
+ for (var j = prev.length - 1; j >= 0; --j) {
+ if (prev[j] === currentLastLine) {
+ commonRootMeetPoint = j;
+ break;
+ }
+ }
+
+ for (var j = commonRootMeetPoint; j >= 0; --j) {
+ var line = prev[j];
+ if (current[currentLastIndex] === line) {
+ current.pop();
+ currentLastIndex--;
+ } else {
+ break;
+ }
+ }
+ current = prev;
+ }
+}
+
+function cleanStack(stack) {
+ var ret = [];
+ for (var i = 0; i < stack.length; ++i) {
+ var line = stack[i];
+ var isTraceLine = stackFramePattern.test(line) ||
+ " (No stack trace)" === line;
+ var isInternalFrame = isTraceLine && shouldIgnore(line);
+ if (isTraceLine && !isInternalFrame) {
+ if (indentStackFrames && line.charAt(0) !== " ") {
+ line = " " + line;
+ }
+ ret.push(line);
+ }
+ }
+ return ret;
+}
+
+function stackFramesAsArray(error) {
+ var stack = error.stack.replace(/\s+$/g, "").split("\n");
+ for (var i = 0; i < stack.length; ++i) {
+ var line = stack[i];
+ if (" (No stack trace)" === line || stackFramePattern.test(line)) {
+ break;
+ }
+ }
+ if (i > 0) {
+ stack = stack.slice(i);
+ }
+ return stack;
+}
+
+CapturedTrace.parseStackAndMessage = function(error) {
+ var stack = error.stack;
+ var message = error.toString();
+ stack = typeof stack === "string" && stack.length > 0
+ ? stackFramesAsArray(error) : [" (No stack trace)"];
+ return {
+ message: message,
+ stack: cleanStack(stack)
+ };
+};
+
+CapturedTrace.formatAndLogError = function(error, title) {
+ if (typeof console !== "undefined") {
+ var message;
+ if (typeof error === "object" || typeof error === "function") {
+ var stack = error.stack;
+ message = title + formatStack(stack, error);
+ } else {
+ message = title + String(error);
+ }
+ if (typeof warn === "function") {
+ warn(message);
+ } else if (typeof console.log === "function" ||
+ typeof console.log === "object") {
+ console.log(message);
+ }
+ }
+};
+
+CapturedTrace.unhandledRejection = function (reason) {
+ CapturedTrace.formatAndLogError(reason, "^--- With additional stack trace: ");
+};
+
+CapturedTrace.isSupported = function () {
+ return typeof captureStackTrace === "function";
+};
+
+CapturedTrace.fireRejectionEvent =
+function(name, localHandler, reason, promise) {
+ var localEventFired = false;
+ try {
+ if (typeof localHandler === "function") {
+ localEventFired = true;
+ if (name === "rejectionHandled") {
+ localHandler(promise);
+ } else {
+ localHandler(reason, promise);
+ }
+ }
+ } catch (e) {
+ async.throwLater(e);
+ }
+
+ var globalEventFired = false;
+ try {
+ globalEventFired = fireGlobalEvent(name, reason, promise);
+ } catch (e) {
+ globalEventFired = true;
+ async.throwLater(e);
+ }
+
+ var domEventFired = false;
+ if (fireDomEvent) {
+ try {
+ domEventFired = fireDomEvent(name.toLowerCase(), {
+ reason: reason,
+ promise: promise
+ });
+ } catch (e) {
+ domEventFired = true;
+ async.throwLater(e);
+ }
+ }
+
+ if (!globalEventFired && !localEventFired && !domEventFired &&
+ name === "unhandledRejection") {
+ CapturedTrace.formatAndLogError(reason, "Unhandled rejection ");
+ }
+};
+
+function formatNonError(obj) {
+ var str;
+ if (typeof obj === "function") {
+ str = "[function " +
+ (obj.name || "anonymous") +
+ "]";
+ } else {
+ str = obj.toString();
+ var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/;
+ if (ruselessToString.test(str)) {
+ try {
+ var newStr = JSON.stringify(obj);
+ str = newStr;
+ }
+ catch(e) {
+
+ }
+ }
+ if (str.length === 0) {
+ str = "(empty array)";
+ }
+ }
+ return ("(<" + snip(str) + ">, no stack trace)");
+}
+
+function snip(str) {
+ var maxChars = 41;
+ if (str.length < maxChars) {
+ return str;
+ }
+ return str.substr(0, maxChars - 3) + "...";
+}
+
+var shouldIgnore = function() { return false; };
+var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
+function parseLineInfo(line) {
+ var matches = line.match(parseLineInfoRegex);
+ if (matches) {
+ return {
+ fileName: matches[1],
+ line: parseInt(matches[2], 10)
+ };
+ }
+}
+CapturedTrace.setBounds = function(firstLineError, lastLineError) {
+ if (!CapturedTrace.isSupported()) return;
+ var firstStackLines = firstLineError.stack.split("\n");
+ var lastStackLines = lastLineError.stack.split("\n");
+ var firstIndex = -1;
+ var lastIndex = -1;
+ var firstFileName;
+ var lastFileName;
+ for (var i = 0; i < firstStackLines.length; ++i) {
+ var result = parseLineInfo(firstStackLines[i]);
+ if (result) {
+ firstFileName = result.fileName;
+ firstIndex = result.line;
+ break;
+ }
+ }
+ for (var i = 0; i < lastStackLines.length; ++i) {
+ var result = parseLineInfo(lastStackLines[i]);
+ if (result) {
+ lastFileName = result.fileName;
+ lastIndex = result.line;
+ break;
+ }
+ }
+ if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||
+ firstFileName !== lastFileName || firstIndex >= lastIndex) {
+ return;
+ }
+
+ shouldIgnore = function(line) {
+ if (bluebirdFramePattern.test(line)) return true;
+ var info = parseLineInfo(line);
+ if (info) {
+ if (info.fileName === firstFileName &&
+ (firstIndex <= info.line && info.line <= lastIndex)) {
+ return true;
+ }
+ }
+ return false;
+ };
+};
+
+var captureStackTrace = (function stackDetection() {
+ var v8stackFramePattern = /^\s*at\s*/;
+ var v8stackFormatter = function(stack, error) {
+ if (typeof stack === "string") return stack;
+
+ if (error.name !== undefined &&
+ error.message !== undefined) {
+ return error.toString();
+ }
+ return formatNonError(error);
+ };
+
+ if (typeof Error.stackTraceLimit === "number" &&
+ typeof Error.captureStackTrace === "function") {
+ Error.stackTraceLimit = Error.stackTraceLimit + 6;
+ stackFramePattern = v8stackFramePattern;
+ formatStack = v8stackFormatter;
+ var captureStackTrace = Error.captureStackTrace;
+
+ shouldIgnore = function(line) {
+ return bluebirdFramePattern.test(line);
+ };
+ return function(receiver, ignoreUntil) {
+ Error.stackTraceLimit = Error.stackTraceLimit + 6;
+ captureStackTrace(receiver, ignoreUntil);
+ Error.stackTraceLimit = Error.stackTraceLimit - 6;
+ };
+ }
+ var err = new Error();
+
+ if (typeof err.stack === "string" &&
+ err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) {
+ stackFramePattern = /@/;
+ formatStack = v8stackFormatter;
+ indentStackFrames = true;
+ return function captureStackTrace(o) {
+ o.stack = new Error().stack;
+ };
+ }
+
+ var hasStackAfterThrow;
+ try { throw new Error(); }
+ catch(e) {
+ hasStackAfterThrow = ("stack" in e);
+ }
+ if (!("stack" in err) && hasStackAfterThrow &&
+ typeof Error.stackTraceLimit === "number") {
+ stackFramePattern = v8stackFramePattern;
+ formatStack = v8stackFormatter;
+ return function captureStackTrace(o) {
+ Error.stackTraceLimit = Error.stackTraceLimit + 6;
+ try { throw new Error(); }
+ catch(e) { o.stack = e.stack; }
+ Error.stackTraceLimit = Error.stackTraceLimit - 6;
+ };
+ }
+
+ formatStack = function(stack, error) {
+ if (typeof stack === "string") return stack;
+
+ if ((typeof error === "object" ||
+ typeof error === "function") &&
+ error.name !== undefined &&
+ error.message !== undefined) {
+ return error.toString();
+ }
+ return formatNonError(error);
+ };
+
+ return null;
+
+})([]);
+
+var fireDomEvent;
+var fireGlobalEvent = (function() {
+ if (util.isNode) {
+ return function(name, reason, promise) {
+ if (name === "rejectionHandled") {
+ return process.emit(name, promise);
+ } else {
+ return process.emit(name, reason, promise);
+ }
+ };
+ } else {
+ var customEventWorks = false;
+ var anyEventWorks = true;
+ try {
+ var ev = new self.CustomEvent("test");
+ customEventWorks = ev instanceof CustomEvent;
+ } catch (e) {}
+ if (!customEventWorks) {
+ try {
+ var event = document.createEvent("CustomEvent");
+ event.initCustomEvent("testingtheevent", false, true, {});
+ self.dispatchEvent(event);
+ } catch (e) {
+ anyEventWorks = false;
+ }
+ }
+ if (anyEventWorks) {
+ fireDomEvent = function(type, detail) {
+ var event;
+ if (customEventWorks) {
+ event = new self.CustomEvent(type, {
+ detail: detail,
+ bubbles: false,
+ cancelable: true
+ });
+ } else if (self.dispatchEvent) {
+ event = document.createEvent("CustomEvent");
+ event.initCustomEvent(type, false, true, detail);
+ }
+
+ return event ? !self.dispatchEvent(event) : false;
+ };
+ }
+
+ var toWindowMethodNameMap = {};
+ toWindowMethodNameMap["unhandledRejection"] = ("on" +
+ "unhandledRejection").toLowerCase();
+ toWindowMethodNameMap["rejectionHandled"] = ("on" +
+ "rejectionHandled").toLowerCase();
+
+ return function(name, reason, promise) {
+ var methodName = toWindowMethodNameMap[name];
+ var method = self[methodName];
+ if (!method) return false;
+ if (name === "rejectionHandled") {
+ method.call(self, promise);
+ } else {
+ method.call(self, reason, promise);
+ }
+ return true;
+ };
+ }
+})();
+
+if (typeof console !== "undefined" && typeof console.warn !== "undefined") {
+ warn = function (message) {
+ console.warn(message);
+ };
+ if (util.isNode && process.stderr.isTTY) {
+ warn = function(message) {
+ process.stderr.write("\u001b[31m" + message + "\u001b[39m\n");
+ };
+ } else if (!util.isNode && typeof (new Error().stack) === "string") {
+ warn = function(message) {
+ console.warn("%c" + message, "color: red");
+ };
+ }
+}
+
+return CapturedTrace;
+};
+
+},{"./async.js":2,"./util.js":38}],8:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(NEXT_FILTER) {
+var util = _dereq_("./util.js");
+var errors = _dereq_("./errors.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+var keys = _dereq_("./es5.js").keys;
+var TypeError = errors.TypeError;
+
+function CatchFilter(instances, callback, promise) {
+ this._instances = instances;
+ this._callback = callback;
+ this._promise = promise;
+}
+
+function safePredicate(predicate, e) {
+ var safeObject = {};
+ var retfilter = tryCatch(predicate).call(safeObject, e);
+
+ if (retfilter === errorObj) return retfilter;
+
+ var safeKeys = keys(safeObject);
+ if (safeKeys.length) {
+ errorObj.e = new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a");
+ return errorObj;
+ }
+ return retfilter;
+}
+
+CatchFilter.prototype.doFilter = function (e) {
+ var cb = this._callback;
+ var promise = this._promise;
+ var boundTo = promise._boundValue();
+ for (var i = 0, len = this._instances.length; i < len; ++i) {
+ var item = this._instances[i];
+ var itemIsErrorType = item === Error ||
+ (item != null && item.prototype instanceof Error);
+
+ if (itemIsErrorType && e instanceof item) {
+ var ret = tryCatch(cb).call(boundTo, e);
+ if (ret === errorObj) {
+ NEXT_FILTER.e = ret.e;
+ return NEXT_FILTER;
+ }
+ return ret;
+ } else if (typeof item === "function" && !itemIsErrorType) {
+ var shouldHandle = safePredicate(item, e);
+ if (shouldHandle === errorObj) {
+ e = errorObj.e;
+ break;
+ } else if (shouldHandle) {
+ var ret = tryCatch(cb).call(boundTo, e);
+ if (ret === errorObj) {
+ NEXT_FILTER.e = ret.e;
+ return NEXT_FILTER;
+ }
+ return ret;
+ }
+ }
+ }
+ NEXT_FILTER.e = e;
+ return NEXT_FILTER;
+};
+
+return CatchFilter;
+};
+
+},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, CapturedTrace, isDebugging) {
+var contextStack = [];
+function Context() {
+ this._trace = new CapturedTrace(peekContext());
+}
+Context.prototype._pushContext = function () {
+ if (!isDebugging()) return;
+ if (this._trace !== undefined) {
+ contextStack.push(this._trace);
+ }
+};
+
+Context.prototype._popContext = function () {
+ if (!isDebugging()) return;
+ if (this._trace !== undefined) {
+ contextStack.pop();
+ }
+};
+
+function createContext() {
+ if (isDebugging()) return new Context();
+}
+
+function peekContext() {
+ var lastIndex = contextStack.length - 1;
+ if (lastIndex >= 0) {
+ return contextStack[lastIndex];
+ }
+ return undefined;
+}
+
+Promise.prototype._peekContext = peekContext;
+Promise.prototype._pushContext = Context.prototype._pushContext;
+Promise.prototype._popContext = Context.prototype._popContext;
+
+return createContext;
+};
+
+},{}],10:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, CapturedTrace) {
+var getDomain = Promise._getDomain;
+var async = _dereq_("./async.js");
+var Warning = _dereq_("./errors.js").Warning;
+var util = _dereq_("./util.js");
+var canAttachTrace = util.canAttachTrace;
+var unhandledRejectionHandled;
+var possiblyUnhandledRejection;
+var debugging = false || (util.isNode &&
+ (!!process.env["BLUEBIRD_DEBUG"] ||
+ process.env["NODE_ENV"] === "development"));
+
+if (util.isNode && process.env["BLUEBIRD_DEBUG"] == 0) debugging = false;
+
+if (debugging) {
+ async.disableTrampolineIfNecessary();
+}
+
+Promise.prototype._ignoreRejections = function() {
+ this._unsetRejectionIsUnhandled();
+ this._bitField = this._bitField | 16777216;
+};
+
+Promise.prototype._ensurePossibleRejectionHandled = function () {
+ if ((this._bitField & 16777216) !== 0) return;
+ this._setRejectionIsUnhandled();
+ async.invokeLater(this._notifyUnhandledRejection, this, undefined);
+};
+
+Promise.prototype._notifyUnhandledRejectionIsHandled = function () {
+ CapturedTrace.fireRejectionEvent("rejectionHandled",
+ unhandledRejectionHandled, undefined, this);
+};
+
+Promise.prototype._notifyUnhandledRejection = function () {
+ if (this._isRejectionUnhandled()) {
+ var reason = this._getCarriedStackTrace() || this._settledValue;
+ this._setUnhandledRejectionIsNotified();
+ CapturedTrace.fireRejectionEvent("unhandledRejection",
+ possiblyUnhandledRejection, reason, this);
+ }
+};
+
+Promise.prototype._setUnhandledRejectionIsNotified = function () {
+ this._bitField = this._bitField | 524288;
+};
+
+Promise.prototype._unsetUnhandledRejectionIsNotified = function () {
+ this._bitField = this._bitField & (~524288);
+};
+
+Promise.prototype._isUnhandledRejectionNotified = function () {
+ return (this._bitField & 524288) > 0;
+};
+
+Promise.prototype._setRejectionIsUnhandled = function () {
+ this._bitField = this._bitField | 2097152;
+};
+
+Promise.prototype._unsetRejectionIsUnhandled = function () {
+ this._bitField = this._bitField & (~2097152);
+ if (this._isUnhandledRejectionNotified()) {
+ this._unsetUnhandledRejectionIsNotified();
+ this._notifyUnhandledRejectionIsHandled();
+ }
+};
+
+Promise.prototype._isRejectionUnhandled = function () {
+ return (this._bitField & 2097152) > 0;
+};
+
+Promise.prototype._setCarriedStackTrace = function (capturedTrace) {
+ this._bitField = this._bitField | 1048576;
+ this._fulfillmentHandler0 = capturedTrace;
+};
+
+Promise.prototype._isCarryingStackTrace = function () {
+ return (this._bitField & 1048576) > 0;
+};
+
+Promise.prototype._getCarriedStackTrace = function () {
+ return this._isCarryingStackTrace()
+ ? this._fulfillmentHandler0
+ : undefined;
+};
+
+Promise.prototype._captureStackTrace = function () {
+ if (debugging) {
+ this._trace = new CapturedTrace(this._peekContext());
+ }
+ return this;
+};
+
+Promise.prototype._attachExtraTrace = function (error, ignoreSelf) {
+ if (debugging && canAttachTrace(error)) {
+ var trace = this._trace;
+ if (trace !== undefined) {
+ if (ignoreSelf) trace = trace._parent;
+ }
+ if (trace !== undefined) {
+ trace.attachExtraTrace(error);
+ } else if (!error.__stackCleaned__) {
+ var parsed = CapturedTrace.parseStackAndMessage(error);
+ util.notEnumerableProp(error, "stack",
+ parsed.message + "\n" + parsed.stack.join("\n"));
+ util.notEnumerableProp(error, "__stackCleaned__", true);
+ }
+ }
+};
+
+Promise.prototype._warn = function(message) {
+ var warning = new Warning(message);
+ var ctx = this._peekContext();
+ if (ctx) {
+ ctx.attachExtraTrace(warning);
+ } else {
+ var parsed = CapturedTrace.parseStackAndMessage(warning);
+ warning.stack = parsed.message + "\n" + parsed.stack.join("\n");
+ }
+ CapturedTrace.formatAndLogError(warning, "");
+};
+
+Promise.onPossiblyUnhandledRejection = function (fn) {
+ var domain = getDomain();
+ possiblyUnhandledRejection =
+ typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))
+ : undefined;
+};
+
+Promise.onUnhandledRejectionHandled = function (fn) {
+ var domain = getDomain();
+ unhandledRejectionHandled =
+ typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))
+ : undefined;
+};
+
+Promise.longStackTraces = function () {
+ if (async.haveItemsQueued() &&
+ debugging === false
+ ) {
+ throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a");
+ }
+ debugging = CapturedTrace.isSupported();
+ if (debugging) {
+ async.disableTrampolineIfNecessary();
+ }
+};
+
+Promise.hasLongStackTraces = function () {
+ return debugging && CapturedTrace.isSupported();
+};
+
+if (!CapturedTrace.isSupported()) {
+ Promise.longStackTraces = function(){};
+ debugging = false;
+}
+
+return function() {
+ return debugging;
+};
+};
+
+},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(_dereq_,module,exports){
+"use strict";
+var util = _dereq_("./util.js");
+var isPrimitive = util.isPrimitive;
+
+module.exports = function(Promise) {
+var returner = function () {
+ return this;
+};
+var thrower = function () {
+ throw this;
+};
+var returnUndefined = function() {};
+var throwUndefined = function() {
+ throw undefined;
+};
+
+var wrapper = function (value, action) {
+ if (action === 1) {
+ return function () {
+ throw value;
+ };
+ } else if (action === 2) {
+ return function () {
+ return value;
+ };
+ }
+};
+
+
+Promise.prototype["return"] =
+Promise.prototype.thenReturn = function (value) {
+ if (value === undefined) return this.then(returnUndefined);
+
+ if (isPrimitive(value)) {
+ return this._then(
+ wrapper(value, 2),
+ undefined,
+ undefined,
+ undefined,
+ undefined
+ );
+ } else if (value instanceof Promise) {
+ value._ignoreRejections();
+ }
+ return this._then(returner, undefined, undefined, value, undefined);
+};
+
+Promise.prototype["throw"] =
+Promise.prototype.thenThrow = function (reason) {
+ if (reason === undefined) return this.then(throwUndefined);
+
+ if (isPrimitive(reason)) {
+ return this._then(
+ wrapper(reason, 1),
+ undefined,
+ undefined,
+ undefined,
+ undefined
+ );
+ }
+ return this._then(thrower, undefined, undefined, reason, undefined);
+};
+};
+
+},{"./util.js":38}],12:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var PromiseReduce = Promise.reduce;
+
+Promise.prototype.each = function (fn) {
+ return PromiseReduce(this, fn, null, INTERNAL);
+};
+
+Promise.each = function (promises, fn) {
+ return PromiseReduce(promises, fn, null, INTERNAL);
+};
+};
+
+},{}],13:[function(_dereq_,module,exports){
+"use strict";
+var es5 = _dereq_("./es5.js");
+var Objectfreeze = es5.freeze;
+var util = _dereq_("./util.js");
+var inherits = util.inherits;
+var notEnumerableProp = util.notEnumerableProp;
+
+function subError(nameProperty, defaultMessage) {
+ function SubError(message) {
+ if (!(this instanceof SubError)) return new SubError(message);
+ notEnumerableProp(this, "message",
+ typeof message === "string" ? message : defaultMessage);
+ notEnumerableProp(this, "name", nameProperty);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ Error.call(this);
+ }
+ }
+ inherits(SubError, Error);
+ return SubError;
+}
+
+var _TypeError, _RangeError;
+var Warning = subError("Warning", "warning");
+var CancellationError = subError("CancellationError", "cancellation error");
+var TimeoutError = subError("TimeoutError", "timeout error");
+var AggregateError = subError("AggregateError", "aggregate error");
+try {
+ _TypeError = TypeError;
+ _RangeError = RangeError;
+} catch(e) {
+ _TypeError = subError("TypeError", "type error");
+ _RangeError = subError("RangeError", "range error");
+}
+
+var methods = ("join pop push shift unshift slice filter forEach some " +
+ "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");
+
+for (var i = 0; i < methods.length; ++i) {
+ if (typeof Array.prototype[methods[i]] === "function") {
+ AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];
+ }
+}
+
+es5.defineProperty(AggregateError.prototype, "length", {
+ value: 0,
+ configurable: false,
+ writable: true,
+ enumerable: true
+});
+AggregateError.prototype["isOperational"] = true;
+var level = 0;
+AggregateError.prototype.toString = function() {
+ var indent = Array(level * 4 + 1).join(" ");
+ var ret = "\n" + indent + "AggregateError of:" + "\n";
+ level++;
+ indent = Array(level * 4 + 1).join(" ");
+ for (var i = 0; i < this.length; ++i) {
+ var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "";
+ var lines = str.split("\n");
+ for (var j = 0; j < lines.length; ++j) {
+ lines[j] = indent + lines[j];
+ }
+ str = lines.join("\n");
+ ret += str + "\n";
+ }
+ level--;
+ return ret;
+};
+
+function OperationalError(message) {
+ if (!(this instanceof OperationalError))
+ return new OperationalError(message);
+ notEnumerableProp(this, "name", "OperationalError");
+ notEnumerableProp(this, "message", message);
+ this.cause = message;
+ this["isOperational"] = true;
+
+ if (message instanceof Error) {
+ notEnumerableProp(this, "message", message.message);
+ notEnumerableProp(this, "stack", message.stack);
+ } else if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+}
+inherits(OperationalError, Error);
+
+var errorTypes = Error["__BluebirdErrorTypes__"];
+if (!errorTypes) {
+ errorTypes = Objectfreeze({
+ CancellationError: CancellationError,
+ TimeoutError: TimeoutError,
+ OperationalError: OperationalError,
+ RejectionError: OperationalError,
+ AggregateError: AggregateError
+ });
+ notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes);
+}
+
+module.exports = {
+ Error: Error,
+ TypeError: _TypeError,
+ RangeError: _RangeError,
+ CancellationError: errorTypes.CancellationError,
+ OperationalError: errorTypes.OperationalError,
+ TimeoutError: errorTypes.TimeoutError,
+ AggregateError: errorTypes.AggregateError,
+ Warning: Warning
+};
+
+},{"./es5.js":14,"./util.js":38}],14:[function(_dereq_,module,exports){
+var isES5 = (function(){
+ "use strict";
+ return this === undefined;
+})();
+
+if (isES5) {
+ module.exports = {
+ freeze: Object.freeze,
+ defineProperty: Object.defineProperty,
+ getDescriptor: Object.getOwnPropertyDescriptor,
+ keys: Object.keys,
+ names: Object.getOwnPropertyNames,
+ getPrototypeOf: Object.getPrototypeOf,
+ isArray: Array.isArray,
+ isES5: isES5,
+ propertyIsWritable: function(obj, prop) {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
+ return !!(!descriptor || descriptor.writable || descriptor.set);
+ }
+ };
+} else {
+ var has = {}.hasOwnProperty;
+ var str = {}.toString;
+ var proto = {}.constructor.prototype;
+
+ var ObjectKeys = function (o) {
+ var ret = [];
+ for (var key in o) {
+ if (has.call(o, key)) {
+ ret.push(key);
+ }
+ }
+ return ret;
+ };
+
+ var ObjectGetDescriptor = function(o, key) {
+ return {value: o[key]};
+ };
+
+ var ObjectDefineProperty = function (o, key, desc) {
+ o[key] = desc.value;
+ return o;
+ };
+
+ var ObjectFreeze = function (obj) {
+ return obj;
+ };
+
+ var ObjectGetPrototypeOf = function (obj) {
+ try {
+ return Object(obj).constructor.prototype;
+ }
+ catch (e) {
+ return proto;
+ }
+ };
+
+ var ArrayIsArray = function (obj) {
+ try {
+ return str.call(obj) === "[object Array]";
+ }
+ catch(e) {
+ return false;
+ }
+ };
+
+ module.exports = {
+ isArray: ArrayIsArray,
+ keys: ObjectKeys,
+ names: ObjectKeys,
+ defineProperty: ObjectDefineProperty,
+ getDescriptor: ObjectGetDescriptor,
+ freeze: ObjectFreeze,
+ getPrototypeOf: ObjectGetPrototypeOf,
+ isES5: isES5,
+ propertyIsWritable: function() {
+ return true;
+ }
+ };
+}
+
+},{}],15:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var PromiseMap = Promise.map;
+
+Promise.prototype.filter = function (fn, options) {
+ return PromiseMap(this, fn, options, INTERNAL);
+};
+
+Promise.filter = function (promises, fn, options) {
+ return PromiseMap(promises, fn, options, INTERNAL);
+};
+};
+
+},{}],16:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) {
+var util = _dereq_("./util.js");
+var isPrimitive = util.isPrimitive;
+var thrower = util.thrower;
+
+function returnThis() {
+ return this;
+}
+function throwThis() {
+ throw this;
+}
+function return$(r) {
+ return function() {
+ return r;
+ };
+}
+function throw$(r) {
+ return function() {
+ throw r;
+ };
+}
+function promisedFinally(ret, reasonOrValue, isFulfilled) {
+ var then;
+ if (isPrimitive(reasonOrValue)) {
+ then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue);
+ } else {
+ then = isFulfilled ? returnThis : throwThis;
+ }
+ return ret._then(then, thrower, undefined, reasonOrValue, undefined);
+}
+
+function finallyHandler(reasonOrValue) {
+ var promise = this.promise;
+ var handler = this.handler;
+
+ var ret = promise._isBound()
+ ? handler.call(promise._boundValue())
+ : handler();
+
+ if (ret !== undefined) {
+ var maybePromise = tryConvertToPromise(ret, promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ return promisedFinally(maybePromise, reasonOrValue,
+ promise.isFulfilled());
+ }
+ }
+
+ if (promise.isRejected()) {
+ NEXT_FILTER.e = reasonOrValue;
+ return NEXT_FILTER;
+ } else {
+ return reasonOrValue;
+ }
+}
+
+function tapHandler(value) {
+ var promise = this.promise;
+ var handler = this.handler;
+
+ var ret = promise._isBound()
+ ? handler.call(promise._boundValue(), value)
+ : handler(value);
+
+ if (ret !== undefined) {
+ var maybePromise = tryConvertToPromise(ret, promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ return promisedFinally(maybePromise, value, true);
+ }
+ }
+ return value;
+}
+
+Promise.prototype._passThroughHandler = function (handler, isFinally) {
+ if (typeof handler !== "function") return this.then();
+
+ var promiseAndHandler = {
+ promise: this,
+ handler: handler
+ };
+
+ return this._then(
+ isFinally ? finallyHandler : tapHandler,
+ isFinally ? finallyHandler : undefined, undefined,
+ promiseAndHandler, undefined);
+};
+
+Promise.prototype.lastly =
+Promise.prototype["finally"] = function (handler) {
+ return this._passThroughHandler(handler, true);
+};
+
+Promise.prototype.tap = function (handler) {
+ return this._passThroughHandler(handler, false);
+};
+};
+
+},{"./util.js":38}],17:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise,
+ apiRejection,
+ INTERNAL,
+ tryConvertToPromise) {
+var errors = _dereq_("./errors.js");
+var TypeError = errors.TypeError;
+var util = _dereq_("./util.js");
+var errorObj = util.errorObj;
+var tryCatch = util.tryCatch;
+var yieldHandlers = [];
+
+function promiseFromYieldHandler(value, yieldHandlers, traceParent) {
+ for (var i = 0; i < yieldHandlers.length; ++i) {
+ traceParent._pushContext();
+ var result = tryCatch(yieldHandlers[i])(value);
+ traceParent._popContext();
+ if (result === errorObj) {
+ traceParent._pushContext();
+ var ret = Promise.reject(errorObj.e);
+ traceParent._popContext();
+ return ret;
+ }
+ var maybePromise = tryConvertToPromise(result, traceParent);
+ if (maybePromise instanceof Promise) return maybePromise;
+ }
+ return null;
+}
+
+function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {
+ var promise = this._promise = new Promise(INTERNAL);
+ promise._captureStackTrace();
+ this._stack = stack;
+ this._generatorFunction = generatorFunction;
+ this._receiver = receiver;
+ this._generator = undefined;
+ this._yieldHandlers = typeof yieldHandler === "function"
+ ? [yieldHandler].concat(yieldHandlers)
+ : yieldHandlers;
+}
+
+PromiseSpawn.prototype.promise = function () {
+ return this._promise;
+};
+
+PromiseSpawn.prototype._run = function () {
+ this._generator = this._generatorFunction.call(this._receiver);
+ this._receiver =
+ this._generatorFunction = undefined;
+ this._next(undefined);
+};
+
+PromiseSpawn.prototype._continue = function (result) {
+ if (result === errorObj) {
+ return this._promise._rejectCallback(result.e, false, true);
+ }
+
+ var value = result.value;
+ if (result.done === true) {
+ this._promise._resolveCallback(value);
+ } else {
+ var maybePromise = tryConvertToPromise(value, this._promise);
+ if (!(maybePromise instanceof Promise)) {
+ maybePromise =
+ promiseFromYieldHandler(maybePromise,
+ this._yieldHandlers,
+ this._promise);
+ if (maybePromise === null) {
+ this._throw(
+ new TypeError(
+ "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/4Y4pDk\u000a\u000a".replace("%s", value) +
+ "From coroutine:\u000a" +
+ this._stack.split("\n").slice(1, -7).join("\n")
+ )
+ );
+ return;
+ }
+ }
+ maybePromise._then(
+ this._next,
+ this._throw,
+ undefined,
+ this,
+ null
+ );
+ }
+};
+
+PromiseSpawn.prototype._throw = function (reason) {
+ this._promise._attachExtraTrace(reason);
+ this._promise._pushContext();
+ var result = tryCatch(this._generator["throw"])
+ .call(this._generator, reason);
+ this._promise._popContext();
+ this._continue(result);
+};
+
+PromiseSpawn.prototype._next = function (value) {
+ this._promise._pushContext();
+ var result = tryCatch(this._generator.next).call(this._generator, value);
+ this._promise._popContext();
+ this._continue(result);
+};
+
+Promise.coroutine = function (generatorFunction, options) {
+ if (typeof generatorFunction !== "function") {
+ throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a");
+ }
+ var yieldHandler = Object(options).yieldHandler;
+ var PromiseSpawn$ = PromiseSpawn;
+ var stack = new Error().stack;
+ return function () {
+ var generator = generatorFunction.apply(this, arguments);
+ var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,
+ stack);
+ spawn._generator = generator;
+ spawn._next(undefined);
+ return spawn.promise();
+ };
+};
+
+Promise.coroutine.addYieldHandler = function(fn) {
+ if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ yieldHandlers.push(fn);
+};
+
+Promise.spawn = function (generatorFunction) {
+ if (typeof generatorFunction !== "function") {
+ return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a");
+ }
+ var spawn = new PromiseSpawn(generatorFunction, this);
+ var ret = spawn.promise();
+ spawn._run(Promise.spawn);
+ return ret;
+};
+};
+
+},{"./errors.js":13,"./util.js":38}],18:[function(_dereq_,module,exports){
+"use strict";
+module.exports =
+function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) {
+var util = _dereq_("./util.js");
+var canEvaluate = util.canEvaluate;
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+var reject;
+
+if (!true) {
+if (canEvaluate) {
+ var thenCallback = function(i) {
+ return new Function("value", "holder", " \n\
+ 'use strict'; \n\
+ holder.pIndex = value; \n\
+ holder.checkFulfillment(this); \n\
+ ".replace(/Index/g, i));
+ };
+
+ var caller = function(count) {
+ var values = [];
+ for (var i = 1; i <= count; ++i) values.push("holder.p" + i);
+ return new Function("holder", " \n\
+ 'use strict'; \n\
+ var callback = holder.fn; \n\
+ return callback(values); \n\
+ ".replace(/values/g, values.join(", ")));
+ };
+ var thenCallbacks = [];
+ var callers = [undefined];
+ for (var i = 1; i <= 5; ++i) {
+ thenCallbacks.push(thenCallback(i));
+ callers.push(caller(i));
+ }
+
+ var Holder = function(total, fn) {
+ this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null;
+ this.fn = fn;
+ this.total = total;
+ this.now = 0;
+ };
+
+ Holder.prototype.callers = callers;
+ Holder.prototype.checkFulfillment = function(promise) {
+ var now = this.now;
+ now++;
+ var total = this.total;
+ if (now >= total) {
+ var handler = this.callers[total];
+ promise._pushContext();
+ var ret = tryCatch(handler)(this);
+ promise._popContext();
+ if (ret === errorObj) {
+ promise._rejectCallback(ret.e, false, true);
+ } else {
+ promise._resolveCallback(ret);
+ }
+ } else {
+ this.now = now;
+ }
+ };
+
+ var reject = function (reason) {
+ this._reject(reason);
+ };
+}
+}
+
+Promise.join = function () {
+ var last = arguments.length - 1;
+ var fn;
+ if (last > 0 && typeof arguments[last] === "function") {
+ fn = arguments[last];
+ if (!true) {
+ if (last < 6 && canEvaluate) {
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ var holder = new Holder(last, fn);
+ var callbacks = thenCallbacks;
+ for (var i = 0; i < last; ++i) {
+ var maybePromise = tryConvertToPromise(arguments[i], ret);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ if (maybePromise._isPending()) {
+ maybePromise._then(callbacks[i], reject,
+ undefined, ret, holder);
+ } else if (maybePromise._isFulfilled()) {
+ callbacks[i].call(ret,
+ maybePromise._value(), holder);
+ } else {
+ ret._reject(maybePromise._reason());
+ }
+ } else {
+ callbacks[i].call(ret, maybePromise, holder);
+ }
+ }
+ return ret;
+ }
+ }
+ }
+ var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];}
+ if (fn) args.pop();
+ var ret = new PromiseArray(args).promise();
+ return fn !== undefined ? ret.spread(fn) : ret;
+};
+
+};
+
+},{"./util.js":38}],19:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise,
+ PromiseArray,
+ apiRejection,
+ tryConvertToPromise,
+ INTERNAL) {
+var getDomain = Promise._getDomain;
+var async = _dereq_("./async.js");
+var util = _dereq_("./util.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+var PENDING = {};
+var EMPTY_ARRAY = [];
+
+function MappingPromiseArray(promises, fn, limit, _filter) {
+ this.constructor$(promises);
+ this._promise._captureStackTrace();
+ var domain = getDomain();
+ this._callback = domain === null ? fn : domain.bind(fn);
+ this._preservedValues = _filter === INTERNAL
+ ? new Array(this.length())
+ : null;
+ this._limit = limit;
+ this._inFlight = 0;
+ this._queue = limit >= 1 ? [] : EMPTY_ARRAY;
+ async.invoke(init, this, undefined);
+}
+util.inherits(MappingPromiseArray, PromiseArray);
+function init() {this._init$(undefined, -2);}
+
+MappingPromiseArray.prototype._init = function () {};
+
+MappingPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ var values = this._values;
+ var length = this.length();
+ var preservedValues = this._preservedValues;
+ var limit = this._limit;
+ if (values[index] === PENDING) {
+ values[index] = value;
+ if (limit >= 1) {
+ this._inFlight--;
+ this._drainQueue();
+ if (this._isResolved()) return;
+ }
+ } else {
+ if (limit >= 1 && this._inFlight >= limit) {
+ values[index] = value;
+ this._queue.push(index);
+ return;
+ }
+ if (preservedValues !== null) preservedValues[index] = value;
+
+ var callback = this._callback;
+ var receiver = this._promise._boundValue();
+ this._promise._pushContext();
+ var ret = tryCatch(callback).call(receiver, value, index, length);
+ this._promise._popContext();
+ if (ret === errorObj) return this._reject(ret.e);
+
+ var maybePromise = tryConvertToPromise(ret, this._promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ if (maybePromise._isPending()) {
+ if (limit >= 1) this._inFlight++;
+ values[index] = PENDING;
+ return maybePromise._proxyPromiseArray(this, index);
+ } else if (maybePromise._isFulfilled()) {
+ ret = maybePromise._value();
+ } else {
+ return this._reject(maybePromise._reason());
+ }
+ }
+ values[index] = ret;
+ }
+ var totalResolved = ++this._totalResolved;
+ if (totalResolved >= length) {
+ if (preservedValues !== null) {
+ this._filter(values, preservedValues);
+ } else {
+ this._resolve(values);
+ }
+
+ }
+};
+
+MappingPromiseArray.prototype._drainQueue = function () {
+ var queue = this._queue;
+ var limit = this._limit;
+ var values = this._values;
+ while (queue.length > 0 && this._inFlight < limit) {
+ if (this._isResolved()) return;
+ var index = queue.pop();
+ this._promiseFulfilled(values[index], index);
+ }
+};
+
+MappingPromiseArray.prototype._filter = function (booleans, values) {
+ var len = values.length;
+ var ret = new Array(len);
+ var j = 0;
+ for (var i = 0; i < len; ++i) {
+ if (booleans[i]) ret[j++] = values[i];
+ }
+ ret.length = j;
+ this._resolve(ret);
+};
+
+MappingPromiseArray.prototype.preservedValues = function () {
+ return this._preservedValues;
+};
+
+function map(promises, fn, options, _filter) {
+ var limit = typeof options === "object" && options !== null
+ ? options.concurrency
+ : 0;
+ limit = typeof limit === "number" &&
+ isFinite(limit) && limit >= 1 ? limit : 0;
+ return new MappingPromiseArray(promises, fn, limit, _filter);
+}
+
+Promise.prototype.map = function (fn, options) {
+ if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+
+ return map(this, fn, options, null).promise();
+};
+
+Promise.map = function (promises, fn, options, _filter) {
+ if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ return map(promises, fn, options, _filter).promise();
+};
+
+
+};
+
+},{"./async.js":2,"./util.js":38}],20:[function(_dereq_,module,exports){
+"use strict";
+module.exports =
+function(Promise, INTERNAL, tryConvertToPromise, apiRejection) {
+var util = _dereq_("./util.js");
+var tryCatch = util.tryCatch;
+
+Promise.method = function (fn) {
+ if (typeof fn !== "function") {
+ throw new Promise.TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ }
+ return function () {
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ ret._pushContext();
+ var value = tryCatch(fn).apply(this, arguments);
+ ret._popContext();
+ ret._resolveFromSyncValue(value);
+ return ret;
+ };
+};
+
+Promise.attempt = Promise["try"] = function (fn, args, ctx) {
+ if (typeof fn !== "function") {
+ return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ }
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ ret._pushContext();
+ var value = util.isArray(args)
+ ? tryCatch(fn).apply(ctx, args)
+ : tryCatch(fn).call(ctx, args);
+ ret._popContext();
+ ret._resolveFromSyncValue(value);
+ return ret;
+};
+
+Promise.prototype._resolveFromSyncValue = function (value) {
+ if (value === util.errorObj) {
+ this._rejectCallback(value.e, false, true);
+ } else {
+ this._resolveCallback(value, true);
+ }
+};
+};
+
+},{"./util.js":38}],21:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise) {
+var util = _dereq_("./util.js");
+var async = _dereq_("./async.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+
+function spreadAdapter(val, nodeback) {
+ var promise = this;
+ if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);
+ var ret =
+ tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));
+ if (ret === errorObj) {
+ async.throwLater(ret.e);
+ }
+}
+
+function successAdapter(val, nodeback) {
+ var promise = this;
+ var receiver = promise._boundValue();
+ var ret = val === undefined
+ ? tryCatch(nodeback).call(receiver, null)
+ : tryCatch(nodeback).call(receiver, null, val);
+ if (ret === errorObj) {
+ async.throwLater(ret.e);
+ }
+}
+function errorAdapter(reason, nodeback) {
+ var promise = this;
+ if (!reason) {
+ var target = promise._target();
+ var newReason = target._getCarriedStackTrace();
+ newReason.cause = reason;
+ reason = newReason;
+ }
+ var ret = tryCatch(nodeback).call(promise._boundValue(), reason);
+ if (ret === errorObj) {
+ async.throwLater(ret.e);
+ }
+}
+
+Promise.prototype.asCallback =
+Promise.prototype.nodeify = function (nodeback, options) {
+ if (typeof nodeback == "function") {
+ var adapter = successAdapter;
+ if (options !== undefined && Object(options).spread) {
+ adapter = spreadAdapter;
+ }
+ this._then(
+ adapter,
+ errorAdapter,
+ undefined,
+ this,
+ nodeback
+ );
+ }
+ return this;
+};
+};
+
+},{"./async.js":2,"./util.js":38}],22:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, PromiseArray) {
+var util = _dereq_("./util.js");
+var async = _dereq_("./async.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+
+Promise.prototype.progressed = function (handler) {
+ return this._then(undefined, undefined, handler, undefined, undefined);
+};
+
+Promise.prototype._progress = function (progressValue) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ this._target()._progressUnchecked(progressValue);
+
+};
+
+Promise.prototype._progressHandlerAt = function (index) {
+ return index === 0
+ ? this._progressHandler0
+ : this[(index << 2) + index - 5 + 2];
+};
+
+Promise.prototype._doProgressWith = function (progression) {
+ var progressValue = progression.value;
+ var handler = progression.handler;
+ var promise = progression.promise;
+ var receiver = progression.receiver;
+
+ var ret = tryCatch(handler).call(receiver, progressValue);
+ if (ret === errorObj) {
+ if (ret.e != null &&
+ ret.e.name !== "StopProgressPropagation") {
+ var trace = util.canAttachTrace(ret.e)
+ ? ret.e : new Error(util.toString(ret.e));
+ promise._attachExtraTrace(trace);
+ promise._progress(ret.e);
+ }
+ } else if (ret instanceof Promise) {
+ ret._then(promise._progress, null, null, promise, undefined);
+ } else {
+ promise._progress(ret);
+ }
+};
+
+
+Promise.prototype._progressUnchecked = function (progressValue) {
+ var len = this._length();
+ var progress = this._progress;
+ for (var i = 0; i < len; i++) {
+ var handler = this._progressHandlerAt(i);
+ var promise = this._promiseAt(i);
+ if (!(promise instanceof Promise)) {
+ var receiver = this._receiverAt(i);
+ if (typeof handler === "function") {
+ handler.call(receiver, progressValue, promise);
+ } else if (receiver instanceof PromiseArray &&
+ !receiver._isResolved()) {
+ receiver._promiseProgressed(progressValue, promise);
+ }
+ continue;
+ }
+
+ if (typeof handler === "function") {
+ async.invoke(this._doProgressWith, this, {
+ handler: handler,
+ promise: promise,
+ receiver: this._receiverAt(i),
+ value: progressValue
+ });
+ } else {
+ async.invoke(progress, promise, progressValue);
+ }
+ }
+};
+};
+
+},{"./async.js":2,"./util.js":38}],23:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function() {
+var makeSelfResolutionError = function () {
+ return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/LhFpo0\u000a");
+};
+var reflect = function() {
+ return new Promise.PromiseInspection(this._target());
+};
+var apiRejection = function(msg) {
+ return Promise.reject(new TypeError(msg));
+};
+
+var util = _dereq_("./util.js");
+
+var getDomain;
+if (util.isNode) {
+ getDomain = function() {
+ var ret = process.domain;
+ if (ret === undefined) ret = null;
+ return ret;
+ };
+} else {
+ getDomain = function() {
+ return null;
+ };
+}
+util.notEnumerableProp(Promise, "_getDomain", getDomain);
+
+var UNDEFINED_BINDING = {};
+var async = _dereq_("./async.js");
+var errors = _dereq_("./errors.js");
+var TypeError = Promise.TypeError = errors.TypeError;
+Promise.RangeError = errors.RangeError;
+Promise.CancellationError = errors.CancellationError;
+Promise.TimeoutError = errors.TimeoutError;
+Promise.OperationalError = errors.OperationalError;
+Promise.RejectionError = errors.OperationalError;
+Promise.AggregateError = errors.AggregateError;
+var INTERNAL = function(){};
+var APPLY = {};
+var NEXT_FILTER = {e: null};
+var tryConvertToPromise = _dereq_("./thenables.js")(Promise, INTERNAL);
+var PromiseArray =
+ _dereq_("./promise_array.js")(Promise, INTERNAL,
+ tryConvertToPromise, apiRejection);
+var CapturedTrace = _dereq_("./captured_trace.js")();
+var isDebugging = _dereq_("./debuggability.js")(Promise, CapturedTrace);
+ /*jshint unused:false*/
+var createContext =
+ _dereq_("./context.js")(Promise, CapturedTrace, isDebugging);
+var CatchFilter = _dereq_("./catch_filter.js")(NEXT_FILTER);
+var PromiseResolver = _dereq_("./promise_resolver.js");
+var nodebackForPromise = PromiseResolver._nodebackForPromise;
+var errorObj = util.errorObj;
+var tryCatch = util.tryCatch;
+
+function Promise(resolver) {
+ if (typeof resolver !== "function") {
+ throw new TypeError("the promise constructor requires a resolver function\u000a\u000a See http://goo.gl/EC22Yn\u000a");
+ }
+ if (this.constructor !== Promise) {
+ throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/KsIlge\u000a");
+ }
+ this._bitField = 0;
+ this._fulfillmentHandler0 = undefined;
+ this._rejectionHandler0 = undefined;
+ this._progressHandler0 = undefined;
+ this._promise0 = undefined;
+ this._receiver0 = undefined;
+ this._settledValue = undefined;
+ if (resolver !== INTERNAL) this._resolveFromResolver(resolver);
+}
+
+Promise.prototype.toString = function () {
+ return "[object Promise]";
+};
+
+Promise.prototype.caught = Promise.prototype["catch"] = function (fn) {
+ var len = arguments.length;
+ if (len > 1) {
+ var catchInstances = new Array(len - 1),
+ j = 0, i;
+ for (i = 0; i < len - 1; ++i) {
+ var item = arguments[i];
+ if (typeof item === "function") {
+ catchInstances[j++] = item;
+ } else {
+ return Promise.reject(
+ new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a"));
+ }
+ }
+ catchInstances.length = j;
+ fn = arguments[i];
+ var catchFilter = new CatchFilter(catchInstances, fn, this);
+ return this._then(undefined, catchFilter.doFilter, undefined,
+ catchFilter, undefined);
+ }
+ return this._then(undefined, fn, undefined, undefined, undefined);
+};
+
+Promise.prototype.reflect = function () {
+ return this._then(reflect, reflect, undefined, this, undefined);
+};
+
+Promise.prototype.then = function (didFulfill, didReject, didProgress) {
+ if (isDebugging() && arguments.length > 0 &&
+ typeof didFulfill !== "function" &&
+ typeof didReject !== "function") {
+ var msg = ".then() only accepts functions but was passed: " +
+ util.classString(didFulfill);
+ if (arguments.length > 1) {
+ msg += ", " + util.classString(didReject);
+ }
+ this._warn(msg);
+ }
+ return this._then(didFulfill, didReject, didProgress,
+ undefined, undefined);
+};
+
+Promise.prototype.done = function (didFulfill, didReject, didProgress) {
+ var promise = this._then(didFulfill, didReject, didProgress,
+ undefined, undefined);
+ promise._setIsFinal();
+};
+
+Promise.prototype.spread = function (didFulfill, didReject) {
+ return this.all()._then(didFulfill, didReject, undefined, APPLY, undefined);
+};
+
+Promise.prototype.isCancellable = function () {
+ return !this.isResolved() &&
+ this._cancellable();
+};
+
+Promise.prototype.toJSON = function () {
+ var ret = {
+ isFulfilled: false,
+ isRejected: false,
+ fulfillmentValue: undefined,
+ rejectionReason: undefined
+ };
+ if (this.isFulfilled()) {
+ ret.fulfillmentValue = this.value();
+ ret.isFulfilled = true;
+ } else if (this.isRejected()) {
+ ret.rejectionReason = this.reason();
+ ret.isRejected = true;
+ }
+ return ret;
+};
+
+Promise.prototype.all = function () {
+ return new PromiseArray(this).promise();
+};
+
+Promise.prototype.error = function (fn) {
+ return this.caught(util.originatesFromRejection, fn);
+};
+
+Promise.getNewLibraryCopy = module.exports;
+
+Promise.is = function (val) {
+ return val instanceof Promise;
+};
+
+Promise.fromNode = function(fn) {
+ var ret = new Promise(INTERNAL);
+ var result = tryCatch(fn)(nodebackForPromise(ret));
+ if (result === errorObj) {
+ ret._rejectCallback(result.e, true, true);
+ }
+ return ret;
+};
+
+Promise.all = function (promises) {
+ return new PromiseArray(promises).promise();
+};
+
+Promise.defer = Promise.pending = function () {
+ var promise = new Promise(INTERNAL);
+ return new PromiseResolver(promise);
+};
+
+Promise.cast = function (obj) {
+ var ret = tryConvertToPromise(obj);
+ if (!(ret instanceof Promise)) {
+ var val = ret;
+ ret = new Promise(INTERNAL);
+ ret._fulfillUnchecked(val);
+ }
+ return ret;
+};
+
+Promise.resolve = Promise.fulfilled = Promise.cast;
+
+Promise.reject = Promise.rejected = function (reason) {
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ ret._rejectCallback(reason, true);
+ return ret;
+};
+
+Promise.setScheduler = function(fn) {
+ if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ var prev = async._schedule;
+ async._schedule = fn;
+ return prev;
+};
+
+Promise.prototype._then = function (
+ didFulfill,
+ didReject,
+ didProgress,
+ receiver,
+ internalData
+) {
+ var haveInternalData = internalData !== undefined;
+ var ret = haveInternalData ? internalData : new Promise(INTERNAL);
+
+ if (!haveInternalData) {
+ ret._propagateFrom(this, 4 | 1);
+ ret._captureStackTrace();
+ }
+
+ var target = this._target();
+ if (target !== this) {
+ if (receiver === undefined) receiver = this._boundTo;
+ if (!haveInternalData) ret._setIsMigrated();
+ }
+
+ var callbackIndex = target._addCallbacks(didFulfill,
+ didReject,
+ didProgress,
+ ret,
+ receiver,
+ getDomain());
+
+ if (target._isResolved() && !target._isSettlePromisesQueued()) {
+ async.invoke(
+ target._settlePromiseAtPostResolution, target, callbackIndex);
+ }
+
+ return ret;
+};
+
+Promise.prototype._settlePromiseAtPostResolution = function (index) {
+ if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled();
+ this._settlePromiseAt(index);
+};
+
+Promise.prototype._length = function () {
+ return this._bitField & 131071;
+};
+
+Promise.prototype._isFollowingOrFulfilledOrRejected = function () {
+ return (this._bitField & 939524096) > 0;
+};
+
+Promise.prototype._isFollowing = function () {
+ return (this._bitField & 536870912) === 536870912;
+};
+
+Promise.prototype._setLength = function (len) {
+ this._bitField = (this._bitField & -131072) |
+ (len & 131071);
+};
+
+Promise.prototype._setFulfilled = function () {
+ this._bitField = this._bitField | 268435456;
+};
+
+Promise.prototype._setRejected = function () {
+ this._bitField = this._bitField | 134217728;
+};
+
+Promise.prototype._setFollowing = function () {
+ this._bitField = this._bitField | 536870912;
+};
+
+Promise.prototype._setIsFinal = function () {
+ this._bitField = this._bitField | 33554432;
+};
+
+Promise.prototype._isFinal = function () {
+ return (this._bitField & 33554432) > 0;
+};
+
+Promise.prototype._cancellable = function () {
+ return (this._bitField & 67108864) > 0;
+};
+
+Promise.prototype._setCancellable = function () {
+ this._bitField = this._bitField | 67108864;
+};
+
+Promise.prototype._unsetCancellable = function () {
+ this._bitField = this._bitField & (~67108864);
+};
+
+Promise.prototype._setIsMigrated = function () {
+ this._bitField = this._bitField | 4194304;
+};
+
+Promise.prototype._unsetIsMigrated = function () {
+ this._bitField = this._bitField & (~4194304);
+};
+
+Promise.prototype._isMigrated = function () {
+ return (this._bitField & 4194304) > 0;
+};
+
+Promise.prototype._receiverAt = function (index) {
+ var ret = index === 0
+ ? this._receiver0
+ : this[
+ index * 5 - 5 + 4];
+ if (ret === UNDEFINED_BINDING) {
+ return undefined;
+ } else if (ret === undefined && this._isBound()) {
+ return this._boundValue();
+ }
+ return ret;
+};
+
+Promise.prototype._promiseAt = function (index) {
+ return index === 0
+ ? this._promise0
+ : this[index * 5 - 5 + 3];
+};
+
+Promise.prototype._fulfillmentHandlerAt = function (index) {
+ return index === 0
+ ? this._fulfillmentHandler0
+ : this[index * 5 - 5 + 0];
+};
+
+Promise.prototype._rejectionHandlerAt = function (index) {
+ return index === 0
+ ? this._rejectionHandler0
+ : this[index * 5 - 5 + 1];
+};
+
+Promise.prototype._boundValue = function() {
+ var ret = this._boundTo;
+ if (ret !== undefined) {
+ if (ret instanceof Promise) {
+ if (ret.isFulfilled()) {
+ return ret.value();
+ } else {
+ return undefined;
+ }
+ }
+ }
+ return ret;
+};
+
+Promise.prototype._migrateCallbacks = function (follower, index) {
+ var fulfill = follower._fulfillmentHandlerAt(index);
+ var reject = follower._rejectionHandlerAt(index);
+ var progress = follower._progressHandlerAt(index);
+ var promise = follower._promiseAt(index);
+ var receiver = follower._receiverAt(index);
+ if (promise instanceof Promise) promise._setIsMigrated();
+ if (receiver === undefined) receiver = UNDEFINED_BINDING;
+ this._addCallbacks(fulfill, reject, progress, promise, receiver, null);
+};
+
+Promise.prototype._addCallbacks = function (
+ fulfill,
+ reject,
+ progress,
+ promise,
+ receiver,
+ domain
+) {
+ var index = this._length();
+
+ if (index >= 131071 - 5) {
+ index = 0;
+ this._setLength(0);
+ }
+
+ if (index === 0) {
+ this._promise0 = promise;
+ if (receiver !== undefined) this._receiver0 = receiver;
+ if (typeof fulfill === "function" && !this._isCarryingStackTrace()) {
+ this._fulfillmentHandler0 =
+ domain === null ? fulfill : domain.bind(fulfill);
+ }
+ if (typeof reject === "function") {
+ this._rejectionHandler0 =
+ domain === null ? reject : domain.bind(reject);
+ }
+ if (typeof progress === "function") {
+ this._progressHandler0 =
+ domain === null ? progress : domain.bind(progress);
+ }
+ } else {
+ var base = index * 5 - 5;
+ this[base + 3] = promise;
+ this[base + 4] = receiver;
+ if (typeof fulfill === "function") {
+ this[base + 0] =
+ domain === null ? fulfill : domain.bind(fulfill);
+ }
+ if (typeof reject === "function") {
+ this[base + 1] =
+ domain === null ? reject : domain.bind(reject);
+ }
+ if (typeof progress === "function") {
+ this[base + 2] =
+ domain === null ? progress : domain.bind(progress);
+ }
+ }
+ this._setLength(index + 1);
+ return index;
+};
+
+Promise.prototype._setProxyHandlers = function (receiver, promiseSlotValue) {
+ var index = this._length();
+
+ if (index >= 131071 - 5) {
+ index = 0;
+ this._setLength(0);
+ }
+ if (index === 0) {
+ this._promise0 = promiseSlotValue;
+ this._receiver0 = receiver;
+ } else {
+ var base = index * 5 - 5;
+ this[base + 3] = promiseSlotValue;
+ this[base + 4] = receiver;
+ }
+ this._setLength(index + 1);
+};
+
+Promise.prototype._proxyPromiseArray = function (promiseArray, index) {
+ this._setProxyHandlers(promiseArray, index);
+};
+
+Promise.prototype._resolveCallback = function(value, shouldBind) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ if (value === this)
+ return this._rejectCallback(makeSelfResolutionError(), false, true);
+ var maybePromise = tryConvertToPromise(value, this);
+ if (!(maybePromise instanceof Promise)) return this._fulfill(value);
+
+ var propagationFlags = 1 | (shouldBind ? 4 : 0);
+ this._propagateFrom(maybePromise, propagationFlags);
+ var promise = maybePromise._target();
+ if (promise._isPending()) {
+ var len = this._length();
+ for (var i = 0; i < len; ++i) {
+ promise._migrateCallbacks(this, i);
+ }
+ this._setFollowing();
+ this._setLength(0);
+ this._setFollowee(promise);
+ } else if (promise._isFulfilled()) {
+ this._fulfillUnchecked(promise._value());
+ } else {
+ this._rejectUnchecked(promise._reason(),
+ promise._getCarriedStackTrace());
+ }
+};
+
+Promise.prototype._rejectCallback =
+function(reason, synchronous, shouldNotMarkOriginatingFromRejection) {
+ if (!shouldNotMarkOriginatingFromRejection) {
+ util.markAsOriginatingFromRejection(reason);
+ }
+ var trace = util.ensureErrorObject(reason);
+ var hasStack = trace === reason;
+ this._attachExtraTrace(trace, synchronous ? hasStack : false);
+ this._reject(reason, hasStack ? undefined : trace);
+};
+
+Promise.prototype._resolveFromResolver = function (resolver) {
+ var promise = this;
+ this._captureStackTrace();
+ this._pushContext();
+ var synchronous = true;
+ var r = tryCatch(resolver)(function(value) {
+ if (promise === null) return;
+ promise._resolveCallback(value);
+ promise = null;
+ }, function (reason) {
+ if (promise === null) return;
+ promise._rejectCallback(reason, synchronous);
+ promise = null;
+ });
+ synchronous = false;
+ this._popContext();
+
+ if (r !== undefined && r === errorObj && promise !== null) {
+ promise._rejectCallback(r.e, true, true);
+ promise = null;
+ }
+};
+
+Promise.prototype._settlePromiseFromHandler = function (
+ handler, receiver, value, promise
+) {
+ if (promise._isRejected()) return;
+ promise._pushContext();
+ var x;
+ if (receiver === APPLY && !this._isRejected()) {
+ x = tryCatch(handler).apply(this._boundValue(), value);
+ } else {
+ x = tryCatch(handler).call(receiver, value);
+ }
+ promise._popContext();
+
+ if (x === errorObj || x === promise || x === NEXT_FILTER) {
+ var err = x === promise ? makeSelfResolutionError() : x.e;
+ promise._rejectCallback(err, false, true);
+ } else {
+ promise._resolveCallback(x);
+ }
+};
+
+Promise.prototype._target = function() {
+ var ret = this;
+ while (ret._isFollowing()) ret = ret._followee();
+ return ret;
+};
+
+Promise.prototype._followee = function() {
+ return this._rejectionHandler0;
+};
+
+Promise.prototype._setFollowee = function(promise) {
+ this._rejectionHandler0 = promise;
+};
+
+Promise.prototype._cleanValues = function () {
+ if (this._cancellable()) {
+ this._cancellationParent = undefined;
+ }
+};
+
+Promise.prototype._propagateFrom = function (parent, flags) {
+ if ((flags & 1) > 0 && parent._cancellable()) {
+ this._setCancellable();
+ this._cancellationParent = parent;
+ }
+ if ((flags & 4) > 0 && parent._isBound()) {
+ this._setBoundTo(parent._boundTo);
+ }
+};
+
+Promise.prototype._fulfill = function (value) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ this._fulfillUnchecked(value);
+};
+
+Promise.prototype._reject = function (reason, carriedStackTrace) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ this._rejectUnchecked(reason, carriedStackTrace);
+};
+
+Promise.prototype._settlePromiseAt = function (index) {
+ var promise = this._promiseAt(index);
+ var isPromise = promise instanceof Promise;
+
+ if (isPromise && promise._isMigrated()) {
+ promise._unsetIsMigrated();
+ return async.invoke(this._settlePromiseAt, this, index);
+ }
+ var handler = this._isFulfilled()
+ ? this._fulfillmentHandlerAt(index)
+ : this._rejectionHandlerAt(index);
+
+ var carriedStackTrace =
+ this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined;
+ var value = this._settledValue;
+ var receiver = this._receiverAt(index);
+ this._clearCallbackDataAtIndex(index);
+
+ if (typeof handler === "function") {
+ if (!isPromise) {
+ handler.call(receiver, value, promise);
+ } else {
+ this._settlePromiseFromHandler(handler, receiver, value, promise);
+ }
+ } else if (receiver instanceof PromiseArray) {
+ if (!receiver._isResolved()) {
+ if (this._isFulfilled()) {
+ receiver._promiseFulfilled(value, promise);
+ }
+ else {
+ receiver._promiseRejected(value, promise);
+ }
+ }
+ } else if (isPromise) {
+ if (this._isFulfilled()) {
+ promise._fulfill(value);
+ } else {
+ promise._reject(value, carriedStackTrace);
+ }
+ }
+
+ if (index >= 4 && (index & 31) === 4)
+ async.invokeLater(this._setLength, this, 0);
+};
+
+Promise.prototype._clearCallbackDataAtIndex = function(index) {
+ if (index === 0) {
+ if (!this._isCarryingStackTrace()) {
+ this._fulfillmentHandler0 = undefined;
+ }
+ this._rejectionHandler0 =
+ this._progressHandler0 =
+ this._receiver0 =
+ this._promise0 = undefined;
+ } else {
+ var base = index * 5 - 5;
+ this[base + 3] =
+ this[base + 4] =
+ this[base + 0] =
+ this[base + 1] =
+ this[base + 2] = undefined;
+ }
+};
+
+Promise.prototype._isSettlePromisesQueued = function () {
+ return (this._bitField &
+ -1073741824) === -1073741824;
+};
+
+Promise.prototype._setSettlePromisesQueued = function () {
+ this._bitField = this._bitField | -1073741824;
+};
+
+Promise.prototype._unsetSettlePromisesQueued = function () {
+ this._bitField = this._bitField & (~-1073741824);
+};
+
+Promise.prototype._queueSettlePromises = function() {
+ async.settlePromises(this);
+ this._setSettlePromisesQueued();
+};
+
+Promise.prototype._fulfillUnchecked = function (value) {
+ if (value === this) {
+ var err = makeSelfResolutionError();
+ this._attachExtraTrace(err);
+ return this._rejectUnchecked(err, undefined);
+ }
+ this._setFulfilled();
+ this._settledValue = value;
+ this._cleanValues();
+
+ if (this._length() > 0) {
+ this._queueSettlePromises();
+ }
+};
+
+Promise.prototype._rejectUncheckedCheckError = function (reason) {
+ var trace = util.ensureErrorObject(reason);
+ this._rejectUnchecked(reason, trace === reason ? undefined : trace);
+};
+
+Promise.prototype._rejectUnchecked = function (reason, trace) {
+ if (reason === this) {
+ var err = makeSelfResolutionError();
+ this._attachExtraTrace(err);
+ return this._rejectUnchecked(err);
+ }
+ this._setRejected();
+ this._settledValue = reason;
+ this._cleanValues();
+
+ if (this._isFinal()) {
+ async.throwLater(function(e) {
+ if ("stack" in e) {
+ async.invokeFirst(
+ CapturedTrace.unhandledRejection, undefined, e);
+ }
+ throw e;
+ }, trace === undefined ? reason : trace);
+ return;
+ }
+
+ if (trace !== undefined && trace !== reason) {
+ this._setCarriedStackTrace(trace);
+ }
+
+ if (this._length() > 0) {
+ this._queueSettlePromises();
+ } else {
+ this._ensurePossibleRejectionHandled();
+ }
+};
+
+Promise.prototype._settlePromises = function () {
+ this._unsetSettlePromisesQueued();
+ var len = this._length();
+ for (var i = 0; i < len; i++) {
+ this._settlePromiseAt(i);
+ }
+};
+
+
+util.notEnumerableProp(Promise,
+ "_makeSelfResolutionError",
+ makeSelfResolutionError);
+
+_dereq_("./progress.js")(Promise, PromiseArray);
+_dereq_("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection);
+_dereq_("./bind.js")(Promise, INTERNAL, tryConvertToPromise);
+_dereq_("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise);
+_dereq_("./direct_resolve.js")(Promise);
+_dereq_("./synchronous_inspection.js")(Promise);
+_dereq_("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL);
+Promise.version = "2.11.0";
+Promise.Promise = Promise;
+_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL);
+_dereq_('./cancel.js')(Promise);
+_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext);
+_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise);
+_dereq_('./nodeify.js')(Promise);
+_dereq_('./call_get.js')(Promise);
+_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);
+_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);
+_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL);
+_dereq_('./settle.js')(Promise, PromiseArray);
+_dereq_('./some.js')(Promise, PromiseArray, apiRejection);
+_dereq_('./promisify.js')(Promise, INTERNAL);
+_dereq_('./any.js')(Promise);
+_dereq_('./each.js')(Promise, INTERNAL);
+_dereq_('./timers.js')(Promise, INTERNAL);
+_dereq_('./filter.js')(Promise, INTERNAL);
+
+ util.toFastProperties(Promise);
+ util.toFastProperties(Promise.prototype);
+ function fillTypes(value) {
+ var p = new Promise(INTERNAL);
+ p._fulfillmentHandler0 = value;
+ p._rejectionHandler0 = value;
+ p._progressHandler0 = value;
+ p._promise0 = value;
+ p._receiver0 = value;
+ p._settledValue = value;
+ }
+ // Complete slack tracking, opt out of field-type tracking and
+ // stabilize map
+ fillTypes({a: 1});
+ fillTypes({b: 2});
+ fillTypes({c: 3});
+ fillTypes(1);
+ fillTypes(function(){});
+ fillTypes(undefined);
+ fillTypes(false);
+ fillTypes(new Promise(INTERNAL));
+ CapturedTrace.setBounds(async.firstLineError, util.lastLineError);
+ return Promise;
+
+};
+
+},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, INTERNAL, tryConvertToPromise,
+ apiRejection) {
+var util = _dereq_("./util.js");
+var isArray = util.isArray;
+
+function toResolutionValue(val) {
+ switch(val) {
+ case -2: return [];
+ case -3: return {};
+ }
+}
+
+function PromiseArray(values) {
+ var promise = this._promise = new Promise(INTERNAL);
+ var parent;
+ if (values instanceof Promise) {
+ parent = values;
+ promise._propagateFrom(parent, 1 | 4);
+ }
+ this._values = values;
+ this._length = 0;
+ this._totalResolved = 0;
+ this._init(undefined, -2);
+}
+PromiseArray.prototype.length = function () {
+ return this._length;
+};
+
+PromiseArray.prototype.promise = function () {
+ return this._promise;
+};
+
+PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
+ var values = tryConvertToPromise(this._values, this._promise);
+ if (values instanceof Promise) {
+ values = values._target();
+ this._values = values;
+ if (values._isFulfilled()) {
+ values = values._value();
+ if (!isArray(values)) {
+ var err = new Promise.TypeError("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a");
+ this.__hardReject__(err);
+ return;
+ }
+ } else if (values._isPending()) {
+ values._then(
+ init,
+ this._reject,
+ undefined,
+ this,
+ resolveValueIfEmpty
+ );
+ return;
+ } else {
+ this._reject(values._reason());
+ return;
+ }
+ } else if (!isArray(values)) {
+ this._promise._reject(apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a")._reason());
+ return;
+ }
+
+ if (values.length === 0) {
+ if (resolveValueIfEmpty === -5) {
+ this._resolveEmptyArray();
+ }
+ else {
+ this._resolve(toResolutionValue(resolveValueIfEmpty));
+ }
+ return;
+ }
+ var len = this.getActualLength(values.length);
+ this._length = len;
+ this._values = this.shouldCopyValues() ? new Array(len) : this._values;
+ var promise = this._promise;
+ for (var i = 0; i < len; ++i) {
+ var isResolved = this._isResolved();
+ var maybePromise = tryConvertToPromise(values[i], promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ if (isResolved) {
+ maybePromise._ignoreRejections();
+ } else if (maybePromise._isPending()) {
+ maybePromise._proxyPromiseArray(this, i);
+ } else if (maybePromise._isFulfilled()) {
+ this._promiseFulfilled(maybePromise._value(), i);
+ } else {
+ this._promiseRejected(maybePromise._reason(), i);
+ }
+ } else if (!isResolved) {
+ this._promiseFulfilled(maybePromise, i);
+ }
+ }
+};
+
+PromiseArray.prototype._isResolved = function () {
+ return this._values === null;
+};
+
+PromiseArray.prototype._resolve = function (value) {
+ this._values = null;
+ this._promise._fulfill(value);
+};
+
+PromiseArray.prototype.__hardReject__ =
+PromiseArray.prototype._reject = function (reason) {
+ this._values = null;
+ this._promise._rejectCallback(reason, false, true);
+};
+
+PromiseArray.prototype._promiseProgressed = function (progressValue, index) {
+ this._promise._progress({
+ index: index,
+ value: progressValue
+ });
+};
+
+
+PromiseArray.prototype._promiseFulfilled = function (value, index) {
+ this._values[index] = value;
+ var totalResolved = ++this._totalResolved;
+ if (totalResolved >= this._length) {
+ this._resolve(this._values);
+ }
+};
+
+PromiseArray.prototype._promiseRejected = function (reason, index) {
+ this._totalResolved++;
+ this._reject(reason);
+};
+
+PromiseArray.prototype.shouldCopyValues = function () {
+ return true;
+};
+
+PromiseArray.prototype.getActualLength = function (len) {
+ return len;
+};
+
+return PromiseArray;
+};
+
+},{"./util.js":38}],25:[function(_dereq_,module,exports){
+"use strict";
+var util = _dereq_("./util.js");
+var maybeWrapAsError = util.maybeWrapAsError;
+var errors = _dereq_("./errors.js");
+var TimeoutError = errors.TimeoutError;
+var OperationalError = errors.OperationalError;
+var haveGetters = util.haveGetters;
+var es5 = _dereq_("./es5.js");
+
+function isUntypedError(obj) {
+ return obj instanceof Error &&
+ es5.getPrototypeOf(obj) === Error.prototype;
+}
+
+var rErrorKey = /^(?:name|message|stack|cause)$/;
+function wrapAsOperationalError(obj) {
+ var ret;
+ if (isUntypedError(obj)) {
+ ret = new OperationalError(obj);
+ ret.name = obj.name;
+ ret.message = obj.message;
+ ret.stack = obj.stack;
+ var keys = es5.keys(obj);
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ if (!rErrorKey.test(key)) {
+ ret[key] = obj[key];
+ }
+ }
+ return ret;
+ }
+ util.markAsOriginatingFromRejection(obj);
+ return obj;
+}
+
+function nodebackForPromise(promise) {
+ return function(err, value) {
+ if (promise === null) return;
+
+ if (err) {
+ var wrapped = wrapAsOperationalError(maybeWrapAsError(err));
+ promise._attachExtraTrace(wrapped);
+ promise._reject(wrapped);
+ } else if (arguments.length > 2) {
+ var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}
+ promise._fulfill(args);
+ } else {
+ promise._fulfill(value);
+ }
+
+ promise = null;
+ };
+}
+
+
+var PromiseResolver;
+if (!haveGetters) {
+ PromiseResolver = function (promise) {
+ this.promise = promise;
+ this.asCallback = nodebackForPromise(promise);
+ this.callback = this.asCallback;
+ };
+}
+else {
+ PromiseResolver = function (promise) {
+ this.promise = promise;
+ };
+}
+if (haveGetters) {
+ var prop = {
+ get: function() {
+ return nodebackForPromise(this.promise);
+ }
+ };
+ es5.defineProperty(PromiseResolver.prototype, "asCallback", prop);
+ es5.defineProperty(PromiseResolver.prototype, "callback", prop);
+}
+
+PromiseResolver._nodebackForPromise = nodebackForPromise;
+
+PromiseResolver.prototype.toString = function () {
+ return "[object PromiseResolver]";
+};
+
+PromiseResolver.prototype.resolve =
+PromiseResolver.prototype.fulfill = function (value) {
+ if (!(this instanceof PromiseResolver)) {
+ throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a");
+ }
+ this.promise._resolveCallback(value);
+};
+
+PromiseResolver.prototype.reject = function (reason) {
+ if (!(this instanceof PromiseResolver)) {
+ throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a");
+ }
+ this.promise._rejectCallback(reason);
+};
+
+PromiseResolver.prototype.progress = function (value) {
+ if (!(this instanceof PromiseResolver)) {
+ throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a");
+ }
+ this.promise._progress(value);
+};
+
+PromiseResolver.prototype.cancel = function (err) {
+ this.promise.cancel(err);
+};
+
+PromiseResolver.prototype.timeout = function () {
+ this.reject(new TimeoutError("timeout"));
+};
+
+PromiseResolver.prototype.isResolved = function () {
+ return this.promise.isResolved();
+};
+
+PromiseResolver.prototype.toJSON = function () {
+ return this.promise.toJSON();
+};
+
+module.exports = PromiseResolver;
+
+},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var THIS = {};
+var util = _dereq_("./util.js");
+var nodebackForPromise = _dereq_("./promise_resolver.js")
+ ._nodebackForPromise;
+var withAppended = util.withAppended;
+var maybeWrapAsError = util.maybeWrapAsError;
+var canEvaluate = util.canEvaluate;
+var TypeError = _dereq_("./errors").TypeError;
+var defaultSuffix = "Async";
+var defaultPromisified = {__isPromisified__: true};
+var noCopyProps = [
+ "arity", "length",
+ "name",
+ "arguments",
+ "caller",
+ "callee",
+ "prototype",
+ "__isPromisified__"
+];
+var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");
+
+var defaultFilter = function(name) {
+ return util.isIdentifier(name) &&
+ name.charAt(0) !== "_" &&
+ name !== "constructor";
+};
+
+function propsFilter(key) {
+ return !noCopyPropsPattern.test(key);
+}
+
+function isPromisified(fn) {
+ try {
+ return fn.__isPromisified__ === true;
+ }
+ catch (e) {
+ return false;
+ }
+}
+
+function hasPromisified(obj, key, suffix) {
+ var val = util.getDataPropertyOrDefault(obj, key + suffix,
+ defaultPromisified);
+ return val ? isPromisified(val) : false;
+}
+function checkValid(ret, suffix, suffixRegexp) {
+ for (var i = 0; i < ret.length; i += 2) {
+ var key = ret[i];
+ if (suffixRegexp.test(key)) {
+ var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");
+ for (var j = 0; j < ret.length; j += 2) {
+ if (ret[j] === keyWithoutAsyncSuffix) {
+ throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/iWrZbw\u000a"
+ .replace("%s", suffix));
+ }
+ }
+ }
+ }
+}
+
+function promisifiableMethods(obj, suffix, suffixRegexp, filter) {
+ var keys = util.inheritedDataKeys(obj);
+ var ret = [];
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ var value = obj[key];
+ var passesDefaultFilter = filter === defaultFilter
+ ? true : defaultFilter(key, value, obj);
+ if (typeof value === "function" &&
+ !isPromisified(value) &&
+ !hasPromisified(obj, key, suffix) &&
+ filter(key, value, obj, passesDefaultFilter)) {
+ ret.push(key, value);
+ }
+ }
+ checkValid(ret, suffix, suffixRegexp);
+ return ret;
+}
+
+var escapeIdentRegex = function(str) {
+ return str.replace(/([$])/, "\\$");
+};
+
+var makeNodePromisifiedEval;
+if (!true) {
+var switchCaseArgumentOrder = function(likelyArgumentCount) {
+ var ret = [likelyArgumentCount];
+ var min = Math.max(0, likelyArgumentCount - 1 - 3);
+ for(var i = likelyArgumentCount - 1; i >= min; --i) {
+ ret.push(i);
+ }
+ for(var i = likelyArgumentCount + 1; i <= 3; ++i) {
+ ret.push(i);
+ }
+ return ret;
+};
+
+var argumentSequence = function(argumentCount) {
+ return util.filledRange(argumentCount, "_arg", "");
+};
+
+var parameterDeclaration = function(parameterCount) {
+ return util.filledRange(
+ Math.max(parameterCount, 3), "_arg", "");
+};
+
+var parameterCount = function(fn) {
+ if (typeof fn.length === "number") {
+ return Math.max(Math.min(fn.length, 1023 + 1), 0);
+ }
+ return 0;
+};
+
+makeNodePromisifiedEval =
+function(callback, receiver, originalName, fn) {
+ var newParameterCount = Math.max(0, parameterCount(fn) - 1);
+ var argumentOrder = switchCaseArgumentOrder(newParameterCount);
+ var shouldProxyThis = typeof callback === "string" || receiver === THIS;
+
+ function generateCallForArgumentCount(count) {
+ var args = argumentSequence(count).join(", ");
+ var comma = count > 0 ? ", " : "";
+ var ret;
+ if (shouldProxyThis) {
+ ret = "ret = callback.call(this, {{args}}, nodeback); break;\n";
+ } else {
+ ret = receiver === undefined
+ ? "ret = callback({{args}}, nodeback); break;\n"
+ : "ret = callback.call(receiver, {{args}}, nodeback); break;\n";
+ }
+ return ret.replace("{{args}}", args).replace(", ", comma);
+ }
+
+ function generateArgumentSwitchCase() {
+ var ret = "";
+ for (var i = 0; i < argumentOrder.length; ++i) {
+ ret += "case " + argumentOrder[i] +":" +
+ generateCallForArgumentCount(argumentOrder[i]);
+ }
+
+ ret += " \n\
+ default: \n\
+ var args = new Array(len + 1); \n\
+ var i = 0; \n\
+ for (var i = 0; i < len; ++i) { \n\
+ args[i] = arguments[i]; \n\
+ } \n\
+ args[i] = nodeback; \n\
+ [CodeForCall] \n\
+ break; \n\
+ ".replace("[CodeForCall]", (shouldProxyThis
+ ? "ret = callback.apply(this, args);\n"
+ : "ret = callback.apply(receiver, args);\n"));
+ return ret;
+ }
+
+ var getFunctionCode = typeof callback === "string"
+ ? ("this != null ? this['"+callback+"'] : fn")
+ : "fn";
+
+ return new Function("Promise",
+ "fn",
+ "receiver",
+ "withAppended",
+ "maybeWrapAsError",
+ "nodebackForPromise",
+ "tryCatch",
+ "errorObj",
+ "notEnumerableProp",
+ "INTERNAL","'use strict'; \n\
+ var ret = function (Parameters) { \n\
+ 'use strict'; \n\
+ var len = arguments.length; \n\
+ var promise = new Promise(INTERNAL); \n\
+ promise._captureStackTrace(); \n\
+ var nodeback = nodebackForPromise(promise); \n\
+ var ret; \n\
+ var callback = tryCatch([GetFunctionCode]); \n\
+ switch(len) { \n\
+ [CodeForSwitchCase] \n\
+ } \n\
+ if (ret === errorObj) { \n\
+ promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\
+ } \n\
+ return promise; \n\
+ }; \n\
+ notEnumerableProp(ret, '__isPromisified__', true); \n\
+ return ret; \n\
+ "
+ .replace("Parameters", parameterDeclaration(newParameterCount))
+ .replace("[CodeForSwitchCase]", generateArgumentSwitchCase())
+ .replace("[GetFunctionCode]", getFunctionCode))(
+ Promise,
+ fn,
+ receiver,
+ withAppended,
+ maybeWrapAsError,
+ nodebackForPromise,
+ util.tryCatch,
+ util.errorObj,
+ util.notEnumerableProp,
+ INTERNAL
+ );
+};
+}
+
+function makeNodePromisifiedClosure(callback, receiver, _, fn) {
+ var defaultThis = (function() {return this;})();
+ var method = callback;
+ if (typeof method === "string") {
+ callback = fn;
+ }
+ function promisified() {
+ var _receiver = receiver;
+ if (receiver === THIS) _receiver = this;
+ var promise = new Promise(INTERNAL);
+ promise._captureStackTrace();
+ var cb = typeof method === "string" && this !== defaultThis
+ ? this[method] : callback;
+ var fn = nodebackForPromise(promise);
+ try {
+ cb.apply(_receiver, withAppended(arguments, fn));
+ } catch(e) {
+ promise._rejectCallback(maybeWrapAsError(e), true, true);
+ }
+ return promise;
+ }
+ util.notEnumerableProp(promisified, "__isPromisified__", true);
+ return promisified;
+}
+
+var makeNodePromisified = canEvaluate
+ ? makeNodePromisifiedEval
+ : makeNodePromisifiedClosure;
+
+function promisifyAll(obj, suffix, filter, promisifier) {
+ var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");
+ var methods =
+ promisifiableMethods(obj, suffix, suffixRegexp, filter);
+
+ for (var i = 0, len = methods.length; i < len; i+= 2) {
+ var key = methods[i];
+ var fn = methods[i+1];
+ var promisifiedKey = key + suffix;
+ if (promisifier === makeNodePromisified) {
+ obj[promisifiedKey] =
+ makeNodePromisified(key, THIS, key, fn, suffix);
+ } else {
+ var promisified = promisifier(fn, function() {
+ return makeNodePromisified(key, THIS, key, fn, suffix);
+ });
+ util.notEnumerableProp(promisified, "__isPromisified__", true);
+ obj[promisifiedKey] = promisified;
+ }
+ }
+ util.toFastProperties(obj);
+ return obj;
+}
+
+function promisify(callback, receiver) {
+ return makeNodePromisified(callback, receiver, undefined, callback);
+}
+
+Promise.promisify = function (fn, receiver) {
+ if (typeof fn !== "function") {
+ throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ }
+ if (isPromisified(fn)) {
+ return fn;
+ }
+ var ret = promisify(fn, arguments.length < 2 ? THIS : receiver);
+ util.copyDescriptors(fn, ret, propsFilter);
+ return ret;
+};
+
+Promise.promisifyAll = function (target, options) {
+ if (typeof target !== "function" && typeof target !== "object") {
+ throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/9ITlV0\u000a");
+ }
+ options = Object(options);
+ var suffix = options.suffix;
+ if (typeof suffix !== "string") suffix = defaultSuffix;
+ var filter = options.filter;
+ if (typeof filter !== "function") filter = defaultFilter;
+ var promisifier = options.promisifier;
+ if (typeof promisifier !== "function") promisifier = makeNodePromisified;
+
+ if (!util.isIdentifier(suffix)) {
+ throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/8FZo5V\u000a");
+ }
+
+ var keys = util.inheritedDataKeys(target);
+ for (var i = 0; i < keys.length; ++i) {
+ var value = target[keys[i]];
+ if (keys[i] !== "constructor" &&
+ util.isClass(value)) {
+ promisifyAll(value.prototype, suffix, filter, promisifier);
+ promisifyAll(value, suffix, filter, promisifier);
+ }
+ }
+
+ return promisifyAll(target, suffix, filter, promisifier);
+};
+};
+
+
+},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(
+ Promise, PromiseArray, tryConvertToPromise, apiRejection) {
+var util = _dereq_("./util.js");
+var isObject = util.isObject;
+var es5 = _dereq_("./es5.js");
+
+function PropertiesPromiseArray(obj) {
+ var keys = es5.keys(obj);
+ var len = keys.length;
+ var values = new Array(len * 2);
+ for (var i = 0; i < len; ++i) {
+ var key = keys[i];
+ values[i] = obj[key];
+ values[i + len] = key;
+ }
+ this.constructor$(values);
+}
+util.inherits(PropertiesPromiseArray, PromiseArray);
+
+PropertiesPromiseArray.prototype._init = function () {
+ this._init$(undefined, -3) ;
+};
+
+PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ this._values[index] = value;
+ var totalResolved = ++this._totalResolved;
+ if (totalResolved >= this._length) {
+ var val = {};
+ var keyOffset = this.length();
+ for (var i = 0, len = this.length(); i < len; ++i) {
+ val[this._values[i + keyOffset]] = this._values[i];
+ }
+ this._resolve(val);
+ }
+};
+
+PropertiesPromiseArray.prototype._promiseProgressed = function (value, index) {
+ this._promise._progress({
+ key: this._values[index + this.length()],
+ value: value
+ });
+};
+
+PropertiesPromiseArray.prototype.shouldCopyValues = function () {
+ return false;
+};
+
+PropertiesPromiseArray.prototype.getActualLength = function (len) {
+ return len >> 1;
+};
+
+function props(promises) {
+ var ret;
+ var castValue = tryConvertToPromise(promises);
+
+ if (!isObject(castValue)) {
+ return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/OsFKC8\u000a");
+ } else if (castValue instanceof Promise) {
+ ret = castValue._then(
+ Promise.props, undefined, undefined, undefined, undefined);
+ } else {
+ ret = new PropertiesPromiseArray(castValue).promise();
+ }
+
+ if (castValue instanceof Promise) {
+ ret._propagateFrom(castValue, 4);
+ }
+ return ret;
+}
+
+Promise.prototype.props = function () {
+ return props(this);
+};
+
+Promise.props = function (promises) {
+ return props(promises);
+};
+};
+
+},{"./es5.js":14,"./util.js":38}],28:[function(_dereq_,module,exports){
+"use strict";
+function arrayMove(src, srcIndex, dst, dstIndex, len) {
+ for (var j = 0; j < len; ++j) {
+ dst[j + dstIndex] = src[j + srcIndex];
+ src[j + srcIndex] = void 0;
+ }
+}
+
+function Queue(capacity) {
+ this._capacity = capacity;
+ this._length = 0;
+ this._front = 0;
+}
+
+Queue.prototype._willBeOverCapacity = function (size) {
+ return this._capacity < size;
+};
+
+Queue.prototype._pushOne = function (arg) {
+ var length = this.length();
+ this._checkCapacity(length + 1);
+ var i = (this._front + length) & (this._capacity - 1);
+ this[i] = arg;
+ this._length = length + 1;
+};
+
+Queue.prototype._unshiftOne = function(value) {
+ var capacity = this._capacity;
+ this._checkCapacity(this.length() + 1);
+ var front = this._front;
+ var i = (((( front - 1 ) &
+ ( capacity - 1) ) ^ capacity ) - capacity );
+ this[i] = value;
+ this._front = i;
+ this._length = this.length() + 1;
+};
+
+Queue.prototype.unshift = function(fn, receiver, arg) {
+ this._unshiftOne(arg);
+ this._unshiftOne(receiver);
+ this._unshiftOne(fn);
+};
+
+Queue.prototype.push = function (fn, receiver, arg) {
+ var length = this.length() + 3;
+ if (this._willBeOverCapacity(length)) {
+ this._pushOne(fn);
+ this._pushOne(receiver);
+ this._pushOne(arg);
+ return;
+ }
+ var j = this._front + length - 3;
+ this._checkCapacity(length);
+ var wrapMask = this._capacity - 1;
+ this[(j + 0) & wrapMask] = fn;
+ this[(j + 1) & wrapMask] = receiver;
+ this[(j + 2) & wrapMask] = arg;
+ this._length = length;
+};
+
+Queue.prototype.shift = function () {
+ var front = this._front,
+ ret = this[front];
+
+ this[front] = undefined;
+ this._front = (front + 1) & (this._capacity - 1);
+ this._length--;
+ return ret;
+};
+
+Queue.prototype.length = function () {
+ return this._length;
+};
+
+Queue.prototype._checkCapacity = function (size) {
+ if (this._capacity < size) {
+ this._resizeTo(this._capacity << 1);
+ }
+};
+
+Queue.prototype._resizeTo = function (capacity) {
+ var oldCapacity = this._capacity;
+ this._capacity = capacity;
+ var front = this._front;
+ var length = this._length;
+ var moveItemsCount = (front + length) & (oldCapacity - 1);
+ arrayMove(this, 0, this, oldCapacity, moveItemsCount);
+};
+
+module.exports = Queue;
+
+},{}],29:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(
+ Promise, INTERNAL, tryConvertToPromise, apiRejection) {
+var isArray = _dereq_("./util.js").isArray;
+
+var raceLater = function (promise) {
+ return promise.then(function(array) {
+ return race(array, promise);
+ });
+};
+
+function race(promises, parent) {
+ var maybePromise = tryConvertToPromise(promises);
+
+ if (maybePromise instanceof Promise) {
+ return raceLater(maybePromise);
+ } else if (!isArray(promises)) {
+ return apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a");
+ }
+
+ var ret = new Promise(INTERNAL);
+ if (parent !== undefined) {
+ ret._propagateFrom(parent, 4 | 1);
+ }
+ var fulfill = ret._fulfill;
+ var reject = ret._reject;
+ for (var i = 0, len = promises.length; i < len; ++i) {
+ var val = promises[i];
+
+ if (val === undefined && !(i in promises)) {
+ continue;
+ }
+
+ Promise.cast(val)._then(fulfill, reject, undefined, ret, null);
+ }
+ return ret;
+}
+
+Promise.race = function (promises) {
+ return race(promises, undefined);
+};
+
+Promise.prototype.race = function () {
+ return race(this, undefined);
+};
+
+};
+
+},{"./util.js":38}],30:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise,
+ PromiseArray,
+ apiRejection,
+ tryConvertToPromise,
+ INTERNAL) {
+var getDomain = Promise._getDomain;
+var async = _dereq_("./async.js");
+var util = _dereq_("./util.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+function ReductionPromiseArray(promises, fn, accum, _each) {
+ this.constructor$(promises);
+ this._promise._captureStackTrace();
+ this._preservedValues = _each === INTERNAL ? [] : null;
+ this._zerothIsAccum = (accum === undefined);
+ this._gotAccum = false;
+ this._reducingIndex = (this._zerothIsAccum ? 1 : 0);
+ this._valuesPhase = undefined;
+ var maybePromise = tryConvertToPromise(accum, this._promise);
+ var rejected = false;
+ var isPromise = maybePromise instanceof Promise;
+ if (isPromise) {
+ maybePromise = maybePromise._target();
+ if (maybePromise._isPending()) {
+ maybePromise._proxyPromiseArray(this, -1);
+ } else if (maybePromise._isFulfilled()) {
+ accum = maybePromise._value();
+ this._gotAccum = true;
+ } else {
+ this._reject(maybePromise._reason());
+ rejected = true;
+ }
+ }
+ if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true;
+ var domain = getDomain();
+ this._callback = domain === null ? fn : domain.bind(fn);
+ this._accum = accum;
+ if (!rejected) async.invoke(init, this, undefined);
+}
+function init() {
+ this._init$(undefined, -5);
+}
+util.inherits(ReductionPromiseArray, PromiseArray);
+
+ReductionPromiseArray.prototype._init = function () {};
+
+ReductionPromiseArray.prototype._resolveEmptyArray = function () {
+ if (this._gotAccum || this._zerothIsAccum) {
+ this._resolve(this._preservedValues !== null
+ ? [] : this._accum);
+ }
+};
+
+ReductionPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ var values = this._values;
+ values[index] = value;
+ var length = this.length();
+ var preservedValues = this._preservedValues;
+ var isEach = preservedValues !== null;
+ var gotAccum = this._gotAccum;
+ var valuesPhase = this._valuesPhase;
+ var valuesPhaseIndex;
+ if (!valuesPhase) {
+ valuesPhase = this._valuesPhase = new Array(length);
+ for (valuesPhaseIndex=0; valuesPhaseIndex= this._length) {
+ this._resolve(this._values);
+ }
+};
+
+SettledPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ var ret = new PromiseInspection();
+ ret._bitField = 268435456;
+ ret._settledValue = value;
+ this._promiseResolved(index, ret);
+};
+SettledPromiseArray.prototype._promiseRejected = function (reason, index) {
+ var ret = new PromiseInspection();
+ ret._bitField = 134217728;
+ ret._settledValue = reason;
+ this._promiseResolved(index, ret);
+};
+
+Promise.settle = function (promises) {
+ return new SettledPromiseArray(promises).promise();
+};
+
+Promise.prototype.settle = function () {
+ return new SettledPromiseArray(this).promise();
+};
+};
+
+},{"./util.js":38}],33:[function(_dereq_,module,exports){
+"use strict";
+module.exports =
+function(Promise, PromiseArray, apiRejection) {
+var util = _dereq_("./util.js");
+var RangeError = _dereq_("./errors.js").RangeError;
+var AggregateError = _dereq_("./errors.js").AggregateError;
+var isArray = util.isArray;
+
+
+function SomePromiseArray(values) {
+ this.constructor$(values);
+ this._howMany = 0;
+ this._unwrap = false;
+ this._initialized = false;
+}
+util.inherits(SomePromiseArray, PromiseArray);
+
+SomePromiseArray.prototype._init = function () {
+ if (!this._initialized) {
+ return;
+ }
+ if (this._howMany === 0) {
+ this._resolve([]);
+ return;
+ }
+ this._init$(undefined, -5);
+ var isArrayResolved = isArray(this._values);
+ if (!this._isResolved() &&
+ isArrayResolved &&
+ this._howMany > this._canPossiblyFulfill()) {
+ this._reject(this._getRangeError(this.length()));
+ }
+};
+
+SomePromiseArray.prototype.init = function () {
+ this._initialized = true;
+ this._init();
+};
+
+SomePromiseArray.prototype.setUnwrap = function () {
+ this._unwrap = true;
+};
+
+SomePromiseArray.prototype.howMany = function () {
+ return this._howMany;
+};
+
+SomePromiseArray.prototype.setHowMany = function (count) {
+ this._howMany = count;
+};
+
+SomePromiseArray.prototype._promiseFulfilled = function (value) {
+ this._addFulfilled(value);
+ if (this._fulfilled() === this.howMany()) {
+ this._values.length = this.howMany();
+ if (this.howMany() === 1 && this._unwrap) {
+ this._resolve(this._values[0]);
+ } else {
+ this._resolve(this._values);
+ }
+ }
+
+};
+SomePromiseArray.prototype._promiseRejected = function (reason) {
+ this._addRejected(reason);
+ if (this.howMany() > this._canPossiblyFulfill()) {
+ var e = new AggregateError();
+ for (var i = this.length(); i < this._values.length; ++i) {
+ e.push(this._values[i]);
+ }
+ this._reject(e);
+ }
+};
+
+SomePromiseArray.prototype._fulfilled = function () {
+ return this._totalResolved;
+};
+
+SomePromiseArray.prototype._rejected = function () {
+ return this._values.length - this.length();
+};
+
+SomePromiseArray.prototype._addRejected = function (reason) {
+ this._values.push(reason);
+};
+
+SomePromiseArray.prototype._addFulfilled = function (value) {
+ this._values[this._totalResolved++] = value;
+};
+
+SomePromiseArray.prototype._canPossiblyFulfill = function () {
+ return this.length() - this._rejected();
+};
+
+SomePromiseArray.prototype._getRangeError = function (count) {
+ var message = "Input array must contain at least " +
+ this._howMany + " items but contains only " + count + " items";
+ return new RangeError(message);
+};
+
+SomePromiseArray.prototype._resolveEmptyArray = function () {
+ this._reject(this._getRangeError(0));
+};
+
+function some(promises, howMany) {
+ if ((howMany | 0) !== howMany || howMany < 0) {
+ return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/1wAmHx\u000a");
+ }
+ var ret = new SomePromiseArray(promises);
+ var promise = ret.promise();
+ ret.setHowMany(howMany);
+ ret.init();
+ return promise;
+}
+
+Promise.some = function (promises, howMany) {
+ return some(promises, howMany);
+};
+
+Promise.prototype.some = function (howMany) {
+ return some(this, howMany);
+};
+
+Promise._SomePromiseArray = SomePromiseArray;
+};
+
+},{"./errors.js":13,"./util.js":38}],34:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise) {
+function PromiseInspection(promise) {
+ if (promise !== undefined) {
+ promise = promise._target();
+ this._bitField = promise._bitField;
+ this._settledValue = promise._settledValue;
+ }
+ else {
+ this._bitField = 0;
+ this._settledValue = undefined;
+ }
+}
+
+PromiseInspection.prototype.value = function () {
+ if (!this.isFulfilled()) {
+ throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a");
+ }
+ return this._settledValue;
+};
+
+PromiseInspection.prototype.error =
+PromiseInspection.prototype.reason = function () {
+ if (!this.isRejected()) {
+ throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a");
+ }
+ return this._settledValue;
+};
+
+PromiseInspection.prototype.isFulfilled =
+Promise.prototype._isFulfilled = function () {
+ return (this._bitField & 268435456) > 0;
+};
+
+PromiseInspection.prototype.isRejected =
+Promise.prototype._isRejected = function () {
+ return (this._bitField & 134217728) > 0;
+};
+
+PromiseInspection.prototype.isPending =
+Promise.prototype._isPending = function () {
+ return (this._bitField & 402653184) === 0;
+};
+
+PromiseInspection.prototype.isResolved =
+Promise.prototype._isResolved = function () {
+ return (this._bitField & 402653184) > 0;
+};
+
+Promise.prototype.isPending = function() {
+ return this._target()._isPending();
+};
+
+Promise.prototype.isRejected = function() {
+ return this._target()._isRejected();
+};
+
+Promise.prototype.isFulfilled = function() {
+ return this._target()._isFulfilled();
+};
+
+Promise.prototype.isResolved = function() {
+ return this._target()._isResolved();
+};
+
+Promise.prototype._value = function() {
+ return this._settledValue;
+};
+
+Promise.prototype._reason = function() {
+ this._unsetRejectionIsUnhandled();
+ return this._settledValue;
+};
+
+Promise.prototype.value = function() {
+ var target = this._target();
+ if (!target.isFulfilled()) {
+ throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a");
+ }
+ return target._settledValue;
+};
+
+Promise.prototype.reason = function() {
+ var target = this._target();
+ if (!target.isRejected()) {
+ throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a");
+ }
+ target._unsetRejectionIsUnhandled();
+ return target._settledValue;
+};
+
+
+Promise.PromiseInspection = PromiseInspection;
+};
+
+},{}],35:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var util = _dereq_("./util.js");
+var errorObj = util.errorObj;
+var isObject = util.isObject;
+
+function tryConvertToPromise(obj, context) {
+ if (isObject(obj)) {
+ if (obj instanceof Promise) {
+ return obj;
+ }
+ else if (isAnyBluebirdPromise(obj)) {
+ var ret = new Promise(INTERNAL);
+ obj._then(
+ ret._fulfillUnchecked,
+ ret._rejectUncheckedCheckError,
+ ret._progressUnchecked,
+ ret,
+ null
+ );
+ return ret;
+ }
+ var then = util.tryCatch(getThen)(obj);
+ if (then === errorObj) {
+ if (context) context._pushContext();
+ var ret = Promise.reject(then.e);
+ if (context) context._popContext();
+ return ret;
+ } else if (typeof then === "function") {
+ return doThenable(obj, then, context);
+ }
+ }
+ return obj;
+}
+
+function getThen(obj) {
+ return obj.then;
+}
+
+var hasProp = {}.hasOwnProperty;
+function isAnyBluebirdPromise(obj) {
+ return hasProp.call(obj, "_promise0");
+}
+
+function doThenable(x, then, context) {
+ var promise = new Promise(INTERNAL);
+ var ret = promise;
+ if (context) context._pushContext();
+ promise._captureStackTrace();
+ if (context) context._popContext();
+ var synchronous = true;
+ var result = util.tryCatch(then).call(x,
+ resolveFromThenable,
+ rejectFromThenable,
+ progressFromThenable);
+ synchronous = false;
+ if (promise && result === errorObj) {
+ promise._rejectCallback(result.e, true, true);
+ promise = null;
+ }
+
+ function resolveFromThenable(value) {
+ if (!promise) return;
+ promise._resolveCallback(value);
+ promise = null;
+ }
+
+ function rejectFromThenable(reason) {
+ if (!promise) return;
+ promise._rejectCallback(reason, synchronous, true);
+ promise = null;
+ }
+
+ function progressFromThenable(value) {
+ if (!promise) return;
+ if (typeof promise._progress === "function") {
+ promise._progress(value);
+ }
+ }
+ return ret;
+}
+
+return tryConvertToPromise;
+};
+
+},{"./util.js":38}],36:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var util = _dereq_("./util.js");
+var TimeoutError = Promise.TimeoutError;
+
+var afterTimeout = function (promise, message) {
+ if (!promise.isPending()) return;
+
+ var err;
+ if(!util.isPrimitive(message) && (message instanceof Error)) {
+ err = message;
+ } else {
+ if (typeof message !== "string") {
+ message = "operation timed out";
+ }
+ err = new TimeoutError(message);
+ }
+ util.markAsOriginatingFromRejection(err);
+ promise._attachExtraTrace(err);
+ promise._cancel(err);
+};
+
+var afterValue = function(value) { return delay(+this).thenReturn(value); };
+var delay = Promise.delay = function (value, ms) {
+ if (ms === undefined) {
+ ms = value;
+ value = undefined;
+ var ret = new Promise(INTERNAL);
+ setTimeout(function() { ret._fulfill(); }, ms);
+ return ret;
+ }
+ ms = +ms;
+ return Promise.resolve(value)._then(afterValue, null, null, ms, undefined);
+};
+
+Promise.prototype.delay = function (ms) {
+ return delay(this, ms);
+};
+
+function successClear(value) {
+ var handle = this;
+ if (handle instanceof Number) handle = +handle;
+ clearTimeout(handle);
+ return value;
+}
+
+function failureClear(reason) {
+ var handle = this;
+ if (handle instanceof Number) handle = +handle;
+ clearTimeout(handle);
+ throw reason;
+}
+
+Promise.prototype.timeout = function (ms, message) {
+ ms = +ms;
+ var ret = this.then().cancellable();
+ ret._cancellationParent = this;
+ var handle = setTimeout(function timeoutTimeout() {
+ afterTimeout(ret, message);
+ }, ms);
+ return ret._then(successClear, failureClear, undefined, handle, undefined);
+};
+
+};
+
+},{"./util.js":38}],37:[function(_dereq_,module,exports){
+"use strict";
+module.exports = function (Promise, apiRejection, tryConvertToPromise,
+ createContext) {
+ var TypeError = _dereq_("./errors.js").TypeError;
+ var inherits = _dereq_("./util.js").inherits;
+ var PromiseInspection = Promise.PromiseInspection;
+
+ function inspectionMapper(inspections) {
+ var len = inspections.length;
+ for (var i = 0; i < len; ++i) {
+ var inspection = inspections[i];
+ if (inspection.isRejected()) {
+ return Promise.reject(inspection.error());
+ }
+ inspections[i] = inspection._settledValue;
+ }
+ return inspections;
+ }
+
+ function thrower(e) {
+ setTimeout(function(){throw e;}, 0);
+ }
+
+ function castPreservingDisposable(thenable) {
+ var maybePromise = tryConvertToPromise(thenable);
+ if (maybePromise !== thenable &&
+ typeof thenable._isDisposable === "function" &&
+ typeof thenable._getDisposer === "function" &&
+ thenable._isDisposable()) {
+ maybePromise._setDisposable(thenable._getDisposer());
+ }
+ return maybePromise;
+ }
+ function dispose(resources, inspection) {
+ var i = 0;
+ var len = resources.length;
+ var ret = Promise.defer();
+ function iterator() {
+ if (i >= len) return ret.resolve();
+ var maybePromise = castPreservingDisposable(resources[i++]);
+ if (maybePromise instanceof Promise &&
+ maybePromise._isDisposable()) {
+ try {
+ maybePromise = tryConvertToPromise(
+ maybePromise._getDisposer().tryDispose(inspection),
+ resources.promise);
+ } catch (e) {
+ return thrower(e);
+ }
+ if (maybePromise instanceof Promise) {
+ return maybePromise._then(iterator, thrower,
+ null, null, null);
+ }
+ }
+ iterator();
+ }
+ iterator();
+ return ret.promise;
+ }
+
+ function disposerSuccess(value) {
+ var inspection = new PromiseInspection();
+ inspection._settledValue = value;
+ inspection._bitField = 268435456;
+ return dispose(this, inspection).thenReturn(value);
+ }
+
+ function disposerFail(reason) {
+ var inspection = new PromiseInspection();
+ inspection._settledValue = reason;
+ inspection._bitField = 134217728;
+ return dispose(this, inspection).thenThrow(reason);
+ }
+
+ function Disposer(data, promise, context) {
+ this._data = data;
+ this._promise = promise;
+ this._context = context;
+ }
+
+ Disposer.prototype.data = function () {
+ return this._data;
+ };
+
+ Disposer.prototype.promise = function () {
+ return this._promise;
+ };
+
+ Disposer.prototype.resource = function () {
+ if (this.promise().isFulfilled()) {
+ return this.promise().value();
+ }
+ return null;
+ };
+
+ Disposer.prototype.tryDispose = function(inspection) {
+ var resource = this.resource();
+ var context = this._context;
+ if (context !== undefined) context._pushContext();
+ var ret = resource !== null
+ ? this.doDispose(resource, inspection) : null;
+ if (context !== undefined) context._popContext();
+ this._promise._unsetDisposable();
+ this._data = null;
+ return ret;
+ };
+
+ Disposer.isDisposer = function (d) {
+ return (d != null &&
+ typeof d.resource === "function" &&
+ typeof d.tryDispose === "function");
+ };
+
+ function FunctionDisposer(fn, promise, context) {
+ this.constructor$(fn, promise, context);
+ }
+ inherits(FunctionDisposer, Disposer);
+
+ FunctionDisposer.prototype.doDispose = function (resource, inspection) {
+ var fn = this.data();
+ return fn.call(resource, resource, inspection);
+ };
+
+ function maybeUnwrapDisposer(value) {
+ if (Disposer.isDisposer(value)) {
+ this.resources[this.index]._setDisposable(value);
+ return value.promise();
+ }
+ return value;
+ }
+
+ Promise.using = function () {
+ var len = arguments.length;
+ if (len < 2) return apiRejection(
+ "you must pass at least 2 arguments to Promise.using");
+ var fn = arguments[len - 1];
+ if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+
+ var input;
+ var spreadArgs = true;
+ if (len === 2 && Array.isArray(arguments[0])) {
+ input = arguments[0];
+ len = input.length;
+ spreadArgs = false;
+ } else {
+ input = arguments;
+ len--;
+ }
+ var resources = new Array(len);
+ for (var i = 0; i < len; ++i) {
+ var resource = input[i];
+ if (Disposer.isDisposer(resource)) {
+ var disposer = resource;
+ resource = resource.promise();
+ resource._setDisposable(disposer);
+ } else {
+ var maybePromise = tryConvertToPromise(resource);
+ if (maybePromise instanceof Promise) {
+ resource =
+ maybePromise._then(maybeUnwrapDisposer, null, null, {
+ resources: resources,
+ index: i
+ }, undefined);
+ }
+ }
+ resources[i] = resource;
+ }
+
+ var promise = Promise.settle(resources)
+ .then(inspectionMapper)
+ .then(function(vals) {
+ promise._pushContext();
+ var ret;
+ try {
+ ret = spreadArgs
+ ? fn.apply(undefined, vals) : fn.call(undefined, vals);
+ } finally {
+ promise._popContext();
+ }
+ return ret;
+ })
+ ._then(
+ disposerSuccess, disposerFail, undefined, resources, undefined);
+ resources.promise = promise;
+ return promise;
+ };
+
+ Promise.prototype._setDisposable = function (disposer) {
+ this._bitField = this._bitField | 262144;
+ this._disposer = disposer;
+ };
+
+ Promise.prototype._isDisposable = function () {
+ return (this._bitField & 262144) > 0;
+ };
+
+ Promise.prototype._getDisposer = function () {
+ return this._disposer;
+ };
+
+ Promise.prototype._unsetDisposable = function () {
+ this._bitField = this._bitField & (~262144);
+ this._disposer = undefined;
+ };
+
+ Promise.prototype.disposer = function (fn) {
+ if (typeof fn === "function") {
+ return new FunctionDisposer(fn, this, createContext());
+ }
+ throw new TypeError();
+ };
+
+};
+
+},{"./errors.js":13,"./util.js":38}],38:[function(_dereq_,module,exports){
+"use strict";
+var es5 = _dereq_("./es5.js");
+var canEvaluate = typeof navigator == "undefined";
+var haveGetters = (function(){
+ try {
+ var o = {};
+ es5.defineProperty(o, "f", {
+ get: function () {
+ return 3;
+ }
+ });
+ return o.f === 3;
+ }
+ catch (e) {
+ return false;
+ }
+
+})();
+
+var errorObj = {e: {}};
+var tryCatchTarget;
+function tryCatcher() {
+ try {
+ var target = tryCatchTarget;
+ tryCatchTarget = null;
+ return target.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+}
+function tryCatch(fn) {
+ tryCatchTarget = fn;
+ return tryCatcher;
+}
+
+var inherits = function(Child, Parent) {
+ var hasProp = {}.hasOwnProperty;
+
+ function T() {
+ this.constructor = Child;
+ this.constructor$ = Parent;
+ for (var propertyName in Parent.prototype) {
+ if (hasProp.call(Parent.prototype, propertyName) &&
+ propertyName.charAt(propertyName.length-1) !== "$"
+ ) {
+ this[propertyName + "$"] = Parent.prototype[propertyName];
+ }
+ }
+ }
+ T.prototype = Parent.prototype;
+ Child.prototype = new T();
+ return Child.prototype;
+};
+
+
+function isPrimitive(val) {
+ return val == null || val === true || val === false ||
+ typeof val === "string" || typeof val === "number";
+
+}
+
+function isObject(value) {
+ return !isPrimitive(value);
+}
+
+function maybeWrapAsError(maybeError) {
+ if (!isPrimitive(maybeError)) return maybeError;
+
+ return new Error(safeToString(maybeError));
+}
+
+function withAppended(target, appendee) {
+ var len = target.length;
+ var ret = new Array(len + 1);
+ var i;
+ for (i = 0; i < len; ++i) {
+ ret[i] = target[i];
+ }
+ ret[i] = appendee;
+ return ret;
+}
+
+function getDataPropertyOrDefault(obj, key, defaultValue) {
+ if (es5.isES5) {
+ var desc = Object.getOwnPropertyDescriptor(obj, key);
+
+ if (desc != null) {
+ return desc.get == null && desc.set == null
+ ? desc.value
+ : defaultValue;
+ }
+ } else {
+ return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;
+ }
+}
+
+function notEnumerableProp(obj, name, value) {
+ if (isPrimitive(obj)) return obj;
+ var descriptor = {
+ value: value,
+ configurable: true,
+ enumerable: false,
+ writable: true
+ };
+ es5.defineProperty(obj, name, descriptor);
+ return obj;
+}
+
+function thrower(r) {
+ throw r;
+}
+
+var inheritedDataKeys = (function() {
+ var excludedPrototypes = [
+ Array.prototype,
+ Object.prototype,
+ Function.prototype
+ ];
+
+ var isExcludedProto = function(val) {
+ for (var i = 0; i < excludedPrototypes.length; ++i) {
+ if (excludedPrototypes[i] === val) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ if (es5.isES5) {
+ var getKeys = Object.getOwnPropertyNames;
+ return function(obj) {
+ var ret = [];
+ var visitedKeys = Object.create(null);
+ while (obj != null && !isExcludedProto(obj)) {
+ var keys;
+ try {
+ keys = getKeys(obj);
+ } catch (e) {
+ return ret;
+ }
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ if (visitedKeys[key]) continue;
+ visitedKeys[key] = true;
+ var desc = Object.getOwnPropertyDescriptor(obj, key);
+ if (desc != null && desc.get == null && desc.set == null) {
+ ret.push(key);
+ }
+ }
+ obj = es5.getPrototypeOf(obj);
+ }
+ return ret;
+ };
+ } else {
+ var hasProp = {}.hasOwnProperty;
+ return function(obj) {
+ if (isExcludedProto(obj)) return [];
+ var ret = [];
+
+ /*jshint forin:false */
+ enumeration: for (var key in obj) {
+ if (hasProp.call(obj, key)) {
+ ret.push(key);
+ } else {
+ for (var i = 0; i < excludedPrototypes.length; ++i) {
+ if (hasProp.call(excludedPrototypes[i], key)) {
+ continue enumeration;
+ }
+ }
+ ret.push(key);
+ }
+ }
+ return ret;
+ };
+ }
+
+})();
+
+var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
+function isClass(fn) {
+ try {
+ if (typeof fn === "function") {
+ var keys = es5.names(fn.prototype);
+
+ var hasMethods = es5.isES5 && keys.length > 1;
+ var hasMethodsOtherThanConstructor = keys.length > 0 &&
+ !(keys.length === 1 && keys[0] === "constructor");
+ var hasThisAssignmentAndStaticMethods =
+ thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;
+
+ if (hasMethods || hasMethodsOtherThanConstructor ||
+ hasThisAssignmentAndStaticMethods) {
+ return true;
+ }
+ }
+ return false;
+ } catch (e) {
+ return false;
+ }
+}
+
+function toFastProperties(obj) {
+ /*jshint -W027,-W055,-W031*/
+ function f() {}
+ f.prototype = obj;
+ var l = 8;
+ while (l--) new f();
+ return obj;
+ eval(obj);
+}
+
+var rident = /^[a-z$_][a-z$_0-9]*$/i;
+function isIdentifier(str) {
+ return rident.test(str);
+}
+
+function filledRange(count, prefix, suffix) {
+ var ret = new Array(count);
+ for(var i = 0; i < count; ++i) {
+ ret[i] = prefix + i + suffix;
+ }
+ return ret;
+}
+
+function safeToString(obj) {
+ try {
+ return obj + "";
+ } catch (e) {
+ return "[no string representation]";
+ }
+}
+
+function markAsOriginatingFromRejection(e) {
+ try {
+ notEnumerableProp(e, "isOperational", true);
+ }
+ catch(ignore) {}
+}
+
+function originatesFromRejection(e) {
+ if (e == null) return false;
+ return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) ||
+ e["isOperational"] === true);
+}
+
+function canAttachTrace(obj) {
+ return obj instanceof Error && es5.propertyIsWritable(obj, "stack");
+}
+
+var ensureErrorObject = (function() {
+ if (!("stack" in new Error())) {
+ return function(value) {
+ if (canAttachTrace(value)) return value;
+ try {throw new Error(safeToString(value));}
+ catch(err) {return err;}
+ };
+ } else {
+ return function(value) {
+ if (canAttachTrace(value)) return value;
+ return new Error(safeToString(value));
+ };
+ }
+})();
+
+function classString(obj) {
+ return {}.toString.call(obj);
+}
+
+function copyDescriptors(from, to, filter) {
+ var keys = es5.names(from);
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ if (filter(key)) {
+ try {
+ es5.defineProperty(to, key, es5.getDescriptor(from, key));
+ } catch (ignore) {}
+ }
+ }
+}
+
+var ret = {
+ isClass: isClass,
+ isIdentifier: isIdentifier,
+ inheritedDataKeys: inheritedDataKeys,
+ getDataPropertyOrDefault: getDataPropertyOrDefault,
+ thrower: thrower,
+ isArray: es5.isArray,
+ haveGetters: haveGetters,
+ notEnumerableProp: notEnumerableProp,
+ isPrimitive: isPrimitive,
+ isObject: isObject,
+ canEvaluate: canEvaluate,
+ errorObj: errorObj,
+ tryCatch: tryCatch,
+ inherits: inherits,
+ withAppended: withAppended,
+ maybeWrapAsError: maybeWrapAsError,
+ toFastProperties: toFastProperties,
+ filledRange: filledRange,
+ toString: safeToString,
+ canAttachTrace: canAttachTrace,
+ ensureErrorObject: ensureErrorObject,
+ originatesFromRejection: originatesFromRejection,
+ markAsOriginatingFromRejection: markAsOriginatingFromRejection,
+ classString: classString,
+ copyDescriptors: copyDescriptors,
+ hasDevTools: typeof chrome !== "undefined" && chrome &&
+ typeof chrome.loadTimes === "function",
+ isNode: typeof process !== "undefined" &&
+ classString(process).toLowerCase() === "[object process]"
+};
+ret.isRecentNode = ret.isNode && (function() {
+ var version = process.versions.node.split(".").map(Number);
+ return (version[0] === 0 && version[1] > 10) || (version[0] > 0);
+})();
+
+if (ret.isNode) ret.toFastProperties(process);
+
+try {throw new Error(); } catch (e) {ret.lastLineError = e;}
+module.exports = ret;
+
+},{"./es5.js":14}]},{},[4])(4)
+}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; }
\ No newline at end of file
diff --git a/Nodejs/node_modules/bluebird/js/browser/bluebird.min.js b/Nodejs/node_modules/bluebird/js/browser/bluebird.min.js
new file mode 100644
index 0000000..bcbd965
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/browser/bluebird.min.js
@@ -0,0 +1,31 @@
+/* @preserve
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2013-2015 Petka Antonov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
+/**
+ * bluebird build version 2.11.0
+ * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers
+*/
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0},n.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},h.hasDevTools?(c.isStatic&&(c=function(t){setTimeout(t,0)}),n.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},n.prototype.invoke=function(t,e,r){this._trampolineEnabled?o.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},n.prototype.settlePromises=function(t){this._trampolineEnabled?s.call(this,t):this._schedule(function(){t._settlePromises()})}):(n.prototype.invokeLater=i,n.prototype.invoke=o,n.prototype.settlePromises=s),n.prototype.invokeFirst=function(t,e,r){this._normalQueue.unshift(t,e,r),this._queueTick()},n.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},n.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},n.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},n.prototype._reset=function(){this._isTickUsed=!1},e.exports=new n,e.exports.firstLineError=a},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(u._setBoundTo(a),a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return s._setBoundTo(o),o instanceof t?o._then(function(){s._resolveCallback(i)},s._reject,s._progress,s,null):s._resolveCallback(i),s}}},{}],4:[function(t,e,r){"use strict";function n(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise.js")();o.noConflict=n,e.exports=o},{"./promise.js":23}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier;e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e,r){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e,r){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.lengtht)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),p.notEnumerableProp(t,"stack",r(a,u)),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;la||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write("[31m"+t+"[39m\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e,r){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundValue(),u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e,r){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e,r){"use strict";e.exports=function(e,r){var n,i,o=e._getDomain,s=t("./async.js"),a=t("./errors.js").Warning,u=t("./util.js"),c=u.canAttachTrace,l=u.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return u.isNode&&0==process.env.BLUEBIRD_DEBUG&&(l=!1),l&&s.disableTrampolineIfNecessary(),e.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},e.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),s.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return l&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(l&&c(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);u.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),u.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new a(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){var e=o();i="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=o();n="function"==typeof t?null===e?t:e.bind(t):void 0},e.longStackTraces=function(){if(s.haveItemsQueued()&&l===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");l=r.isSupported(),l&&s.disableTrampolineIfNecessary()},e.hasLongStackTraces=function(){return l&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},l=!1),function(){return l}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e,r){"use strict";var n=t("./util.js"),i=n.isPrimitive;e.exports=function(t){var e=function(){return this},r=function(){throw this},n=function(){},o=function(){throw void 0},s=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(r){return void 0===r?this.then(n):i(r)?this._then(s(r,2),void 0,void 0,void 0,void 0):(r instanceof t&&r._ignoreRejections(),this._then(e,void 0,void 0,r,void 0))},t.prototype["throw"]=t.prototype.thenThrow=function(t){return void 0===t?this.then(o):i(t)?this._then(s(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(h(this,"message","string"==typeof n?n:e),h(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function i(t){return this instanceof i?(h(this,"name","OperationalError"),h(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(h(this,"message",t.message),h(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,s,a=t("./es5.js"),u=a.freeze,c=t("./util.js"),l=c.inherits,h=c.notEnumerableProp,p=n("Warning","warning"),f=n("CancellationError","cancellation error"),_=n("TimeoutError","timeout error"),d=n("AggregateError","aggregate error");try{o=TypeError,s=RangeError}catch(v){o=n("TypeError","type error"),s=n("RangeError","range error")}for(var y="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:i.bind(e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:d,l.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj,_={},d=[];h.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===_){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundValue();this._promise._pushContext();var l=p(u).call(c,t,r,o);if(this._promise._popContext(),l===f)return this._reject(l.e);var h=i(l,this._promise);if(h instanceof e){if(h=h._target(),h._isPending())return a>=1&&this._inFlight++,n[r]=_,h._proxyPromiseArray(this,r);if(!h._isFulfilled())return this._reject(h._reason());l=h._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e,r){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundValue(),[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundValue(),i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundValue(),t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e,r){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e,r){"use strict";e.exports=function(){function r(t){if("function"!=typeof t)throw new p("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==r)throw new p("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==f&&this._resolveFromResolver(t)}function n(t){var e=new r(f);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._progressHandler0=t,e._promise0=t,e._receiver0=t,e._settledValue=t}var i,o=function(){return new p("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},s=function(){return new r.PromiseInspection(this._target())},a=function(t){return r.reject(new p(t))},u=t("./util.js");i=u.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},u.notEnumerableProp(r,"_getDomain",i);var c={},l=t("./async.js"),h=t("./errors.js"),p=r.TypeError=h.TypeError;r.RangeError=h.RangeError,r.CancellationError=h.CancellationError,r.TimeoutError=h.TimeoutError,r.OperationalError=h.OperationalError,r.RejectionError=h.OperationalError,r.AggregateError=h.AggregateError;var f=function(){},_={},d={e:null},v=t("./thenables.js")(r,f),y=t("./promise_array.js")(r,f,v,a),g=t("./captured_trace.js")(),m=t("./debuggability.js")(r,g),j=t("./context.js")(r,g,m),b=t("./catch_filter.js")(d),w=t("./promise_resolver.js"),k=w._nodebackForPromise,E=u.errorObj,F=u.tryCatch;return r.prototype.toString=function(){return"[object Promise]"},r.prototype.caught=r.prototype["catch"]=function(t){var e=arguments.length;if(e>1){var n,i=new Array(e-1),o=0;for(n=0;e-1>n;++n){var s=arguments[n];if("function"!=typeof s)return r.reject(new p("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new b(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},r.prototype.reflect=function(){return this._then(s,s,void 0,this,void 0)},r.prototype.then=function(t,e,r){if(m()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+u.classString(t);arguments.length>1&&(n+=", "+u.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0);
+},r.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,_,void 0)},r.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return new y(this).promise()},r.prototype.error=function(t){return this.caught(u.originatesFromRejection,t)},r.getNewLibraryCopy=e.exports,r.is=function(t){return t instanceof r},r.fromNode=function(t){var e=new r(f),n=F(t)(k(e));return n===E&&e._rejectCallback(n.e,!0,!0),e},r.all=function(t){return new y(t).promise()},r.defer=r.pending=function(){var t=new r(f);return new w(t)},r.cast=function(t){var e=v(t);if(!(e instanceof r)){var n=e;e=new r(f),e._fulfillUnchecked(n)}return e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(f);return e._captureStackTrace(),e._rejectCallback(t,!0),e},r.setScheduler=function(t){if("function"!=typeof t)throw new p("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=l._schedule;return l._schedule=t,e},r.prototype._then=function(t,e,n,o,s){var a=void 0!==s,u=a?s:new r(f);a||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(void 0===o&&(o=this._boundTo),a||u._setIsMigrated());var h=c._addCallbacks(t,e,n,u,o,i());return c._isResolved()&&!c._isSettlePromisesQueued()&&l.invoke(c._settlePromiseAtPostResolution,c,h),u},r.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},r.prototype._length=function(){return 131071&this._bitField},r.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},r.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},r.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},r.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},r.prototype._setRejected=function(){this._bitField=134217728|this._bitField},r.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},r.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},r.prototype._isFinal=function(){return(33554432&this._bitField)>0},r.prototype._cancellable=function(){return(67108864&this._bitField)>0},r.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},r.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},r.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},r.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},r.prototype._isMigrated=function(){return(4194304&this._bitField)>0},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return e===c?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},r.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},r.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},r.prototype._boundValue=function(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t},r.prototype._migrateCallbacks=function(t,e){var n=t._fulfillmentHandlerAt(e),i=t._rejectionHandlerAt(e),o=t._progressHandlerAt(e),s=t._promiseAt(e),a=t._receiverAt(e);s instanceof r&&s._setIsMigrated(),void 0===a&&(a=c),this._addCallbacks(n,i,o,s,a,null)},r.prototype._addCallbacks=function(t,e,r,n,i,o){var s=this._length();if(s>=131066&&(s=0,this._setLength(0)),0===s)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=null===o?t:o.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:o.bind(e)),"function"==typeof r&&(this._progressHandler0=null===o?r:o.bind(r));else{var a=5*s-5;this[a+3]=n,this[a+4]=i,"function"==typeof t&&(this[a+0]=null===o?t:o.bind(t)),"function"==typeof e&&(this[a+1]=null===o?e:o.bind(e)),"function"==typeof r&&(this[a+2]=null===o?r:o.bind(r))}return this._setLength(s+1),s},r.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},r.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},r.prototype._resolveCallback=function(t,e){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(o(),!1,!0);var n=v(t,this);if(!(n instanceof r))return this._fulfill(t);var i=1|(e?4:0);this._propagateFrom(n,i);var s=n._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},r.prototype._rejectCallback=function(t,e,r){r||u.markAsOriginatingFromRejection(t);var n=u.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},r.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=F(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===E&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},r.prototype._settlePromiseFromHandler=function(t,e,r,n){if(!n._isRejected()){n._pushContext();var i;if(i=e!==_||this._isRejected()?F(t).call(e,r):F(t).apply(this._boundValue(),r),n._popContext(),i===E||i===n||i===d){var s=i===n?o():i.e;n._rejectCallback(s,!1,!0)}else n._resolveCallback(i)}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},r.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},r.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},r.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},r.prototype._settlePromiseAt=function(t){var e=this._promiseAt(t),n=e instanceof r;if(n&&e._isMigrated())return e._unsetIsMigrated(),l.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,a=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,a,s,e):i.call(a,s,e):a instanceof y?a._isResolved()||(this._isFulfilled()?a._promiseFulfilled(s,e):a._promiseRejected(s,e)):n&&(this._isFulfilled()?e._fulfill(s):e._reject(s,o)),t>=4&&4===(31&t)&&l.invokeLater(this._setLength,this,0)},r.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},r.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},r.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},r.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},r.prototype._queueSettlePromises=function(){l.settlePromises(this),this._setSettlePromisesQueued()},r.prototype._fulfillUnchecked=function(t){if(t===this){var e=o();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},r.prototype._rejectUncheckedCheckError=function(t){var e=u.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},r.prototype._rejectUnchecked=function(t,e){if(t===this){var r=o();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void l.throwLater(function(t){throw"stack"in t&&l.invokeFirst(g.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},r.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},u.notEnumerableProp(r,"_makeSelfResolutionError",o),t("./progress.js")(r,y),t("./method.js")(r,f,v,a),t("./bind.js")(r,f,v),t("./finally.js")(r,d,v),t("./direct_resolve.js")(r),t("./synchronous_inspection.js")(r),t("./join.js")(r,y,v,f),r.version="2.11.0",r.Promise=r,t("./map.js")(r,y,a,v,f),t("./cancel.js")(r),t("./using.js")(r,a,v,j),t("./generators.js")(r,a,f,v),t("./nodeify.js")(r),t("./call_get.js")(r),t("./props.js")(r,y,v,a),t("./race.js")(r,f,v,a),t("./reduce.js")(r,y,a,v,f),t("./settle.js")(r,y),t("./some.js")(r,y,a),t("./promisify.js")(r,f),t("./any.js")(r),t("./each.js")(r,f),t("./timers.js")(r,f),t("./filter.js")(r,f),u.toFastProperties(r),u.toFastProperties(r.prototype),n({a:1}),n({b:2}),n({c:3}),n(1),n(function(){}),n(void 0),n(!1),n(new r(f)),g.setBounds(l.firstLineError,u.lastLineError),r}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._ignoreRejections():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t,e){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e,r){"use strict";function n(t){return t instanceof Error&&f.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(n(t)){e=new h(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=f.keys(t),i=0;i2){for(var o=arguments.length,s=new Array(o-1),a=1;o>a;++a)s[a-1]=arguments[a];t._fulfill(s)}else t._fulfill(r);t=null}}}var s,a=t("./util.js"),u=a.maybeWrapAsError,c=t("./errors.js"),l=c.TimeoutError,h=c.OperationalError,p=a.haveGetters,f=t("./es5.js"),_=/^(?:name|message|stack|cause)$/;if(s=p?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=o(t),this.callback=this.asCallback},p){var d={get:function(){return o(this.promise)}};f.defineProperty(s.prototype,"asCallback",d),f.defineProperty(s.prototype,"callback",d)}s._nodebackForPromise=o,s.prototype.toString=function(){return"[object PromiseResolver]"},s.prototype.resolve=s.prototype.fulfill=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},s.prototype.reject=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},s.prototype.progress=function(t){if(!(this instanceof s))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},s.prototype.cancel=function(t){this.promise.cancel(t)},s.prototype.timeout=function(){this.reject(new l("timeout"))},s.prototype.isResolved=function(){return this.promise.isResolved()},s.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=s},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t){return!w.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;ns;s+=2){var c=o[s],l=o[s+1],h=c+e;if(n===F)t[h]=F(c,p,c,l,e);else{var _=n(l,function(){return F(c,p,c,l,e)});f.notEnumerableProp(_,"__isPromisified__",!0),t[h]=_}}return f.toFastProperties(t),t}function l(t,e){return F(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],w=new RegExp("^(?:"+b.join("|")+")$"),k=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},F=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=k);var i=e.promisifier;if("function"!=typeof i&&(i=F),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;si;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacityp;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),h=!1,p=u instanceof e;p&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),h=!0)),p||this._zerothIsAccum||(this._gotAccum=!0);var f=c();this._callback=null===f?r:f.bind(r),this._accum=n,h||l.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj;h.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var h,_=this._callback,d=this._promise._boundValue(),v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),h=p(_).call(d,t,v,s)):h=p(_).call(d,this._accum,t,v,s),this._promise._popContext(),h===f)return this._reject(h.e);var y=i(h,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());h=y._value()}this._reducingIndex=v+1,this._accum=h}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e,r){"use strict";var n,i=t("./util"),o=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(i.isNode&&"undefined"==typeof MutationObserver){var s=global.setImmediate,a=process.nextTick;n=i.isRecentNode?function(t){s.call(global,t)}:function(t){a.call(process,t)}}else"undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?n="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:o:(n=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},n.isStatic=!0);e.exports=n},{"./util":38}],32:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(t){l&&(l._resolveCallback(t),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){var r;!o.isPrimitive(e)&&e instanceof Error?r=e:("string"!=typeof e&&(e="operation timed out"),r=new s(e)),o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");var s,a=!0;2===t&&Array.isArray(arguments[0])?(s=arguments[0],
+t=s.length,a=!1):(s=arguments,t--);for(var u=new Array(t),p=0;t>p;++p){var _=s[p];if(h.isDisposer(_)){var d=_;_=_.promise(),_._setDisposable(d)}else{var v=n(_);v instanceof e&&(_=v._then(f,null,null,{resources:u,index:p},void 0))}u[p]=_}var y=e.settle(u).then(o).then(function(t){y._pushContext();var e;try{e=a?i.apply(void 0,t):i.call(void 0,t)}finally{y._popContext()}return e})._then(c,l,void 0,u,void 0);return u.promise=y,y},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{var t=C;return C=null,t.apply(this,arguments)}catch(e){return F.e=e,F}}function i(t){return C=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!w.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return w.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=w.names(t.prototype),r=w.isES5&&e.length>1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&w.names(t).length>0;if(r||n||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&w.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=w.names(t),i=0;i10||t[0]>0}(),A.isNode&&A.toFastProperties(process);try{throw new Error}catch(O){A.lastLineError=O}e.exports=A},{"./es5.js":14}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);
\ No newline at end of file
diff --git a/Nodejs/node_modules/bluebird/js/main/any.js b/Nodejs/node_modules/bluebird/js/main/any.js
new file mode 100644
index 0000000..05a6228
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/any.js
@@ -0,0 +1,21 @@
+"use strict";
+module.exports = function(Promise) {
+var SomePromiseArray = Promise._SomePromiseArray;
+function any(promises) {
+ var ret = new SomePromiseArray(promises);
+ var promise = ret.promise();
+ ret.setHowMany(1);
+ ret.setUnwrap();
+ ret.init();
+ return promise;
+}
+
+Promise.any = function (promises) {
+ return any(promises);
+};
+
+Promise.prototype.any = function () {
+ return any(this);
+};
+
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/assert.js b/Nodejs/node_modules/bluebird/js/main/assert.js
new file mode 100644
index 0000000..a98955c
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/assert.js
@@ -0,0 +1,55 @@
+"use strict";
+module.exports = (function(){
+var AssertionError = (function() {
+ function AssertionError(a) {
+ this.constructor$(a);
+ this.message = a;
+ this.name = "AssertionError";
+ }
+ AssertionError.prototype = new Error();
+ AssertionError.prototype.constructor = AssertionError;
+ AssertionError.prototype.constructor$ = Error;
+ return AssertionError;
+})();
+
+function getParams(args) {
+ var params = [];
+ for (var i = 0; i < args.length; ++i) params.push("arg" + i);
+ return params;
+}
+
+function nativeAssert(callName, args, expect) {
+ try {
+ var params = getParams(args);
+ var constructorArgs = params;
+ constructorArgs.push("return " +
+ callName + "("+ params.join(",") + ");");
+ var fn = Function.apply(null, constructorArgs);
+ return fn.apply(null, args);
+ } catch (e) {
+ if (!(e instanceof SyntaxError)) {
+ throw e;
+ } else {
+ return expect;
+ }
+ }
+}
+
+return function assert(boolExpr, message) {
+ if (boolExpr === true) return;
+
+ if (typeof boolExpr === "string" &&
+ boolExpr.charAt(0) === "%") {
+ var nativeCallName = boolExpr;
+ var $_len = arguments.length;var args = new Array($_len - 2); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];}
+ if (nativeAssert(nativeCallName, args, message) === message) return;
+ message = (nativeCallName + " !== " + message);
+ }
+
+ var ret = new AssertionError(message);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(ret, assert);
+ }
+ throw ret;
+};
+})();
diff --git a/Nodejs/node_modules/bluebird/js/main/async.js b/Nodejs/node_modules/bluebird/js/main/async.js
new file mode 100644
index 0000000..0104459
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/async.js
@@ -0,0 +1,150 @@
+"use strict";
+var firstLineError;
+try {throw new Error(); } catch (e) {firstLineError = e;}
+var schedule = require("./schedule.js");
+var Queue = require("./queue.js");
+var util = require("./util.js");
+
+function Async() {
+ this._isTickUsed = false;
+ this._lateQueue = new Queue(16);
+ this._normalQueue = new Queue(16);
+ this._trampolineEnabled = true;
+ var self = this;
+ this.drainQueues = function () {
+ self._drainQueues();
+ };
+ this._schedule =
+ schedule.isStatic ? schedule(this.drainQueues) : schedule;
+}
+
+Async.prototype.disableTrampolineIfNecessary = function() {
+ if (util.hasDevTools) {
+ this._trampolineEnabled = false;
+ }
+};
+
+Async.prototype.enableTrampoline = function() {
+ if (!this._trampolineEnabled) {
+ this._trampolineEnabled = true;
+ this._schedule = function(fn) {
+ setTimeout(fn, 0);
+ };
+ }
+};
+
+Async.prototype.haveItemsQueued = function () {
+ return this._normalQueue.length() > 0;
+};
+
+Async.prototype.throwLater = function(fn, arg) {
+ if (arguments.length === 1) {
+ arg = fn;
+ fn = function () { throw arg; };
+ }
+ if (typeof setTimeout !== "undefined") {
+ setTimeout(function() {
+ fn(arg);
+ }, 0);
+ } else try {
+ this._schedule(function() {
+ fn(arg);
+ });
+ } catch (e) {
+ throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a");
+ }
+};
+
+function AsyncInvokeLater(fn, receiver, arg) {
+ this._lateQueue.push(fn, receiver, arg);
+ this._queueTick();
+}
+
+function AsyncInvoke(fn, receiver, arg) {
+ this._normalQueue.push(fn, receiver, arg);
+ this._queueTick();
+}
+
+function AsyncSettlePromises(promise) {
+ this._normalQueue._pushOne(promise);
+ this._queueTick();
+}
+
+if (!util.hasDevTools) {
+ Async.prototype.invokeLater = AsyncInvokeLater;
+ Async.prototype.invoke = AsyncInvoke;
+ Async.prototype.settlePromises = AsyncSettlePromises;
+} else {
+ if (schedule.isStatic) {
+ schedule = function(fn) { setTimeout(fn, 0); };
+ }
+ Async.prototype.invokeLater = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvokeLater.call(this, fn, receiver, arg);
+ } else {
+ this._schedule(function() {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 100);
+ });
+ }
+ };
+
+ Async.prototype.invoke = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvoke.call(this, fn, receiver, arg);
+ } else {
+ this._schedule(function() {
+ fn.call(receiver, arg);
+ });
+ }
+ };
+
+ Async.prototype.settlePromises = function(promise) {
+ if (this._trampolineEnabled) {
+ AsyncSettlePromises.call(this, promise);
+ } else {
+ this._schedule(function() {
+ promise._settlePromises();
+ });
+ }
+ };
+}
+
+Async.prototype.invokeFirst = function (fn, receiver, arg) {
+ this._normalQueue.unshift(fn, receiver, arg);
+ this._queueTick();
+};
+
+Async.prototype._drainQueue = function(queue) {
+ while (queue.length() > 0) {
+ var fn = queue.shift();
+ if (typeof fn !== "function") {
+ fn._settlePromises();
+ continue;
+ }
+ var receiver = queue.shift();
+ var arg = queue.shift();
+ fn.call(receiver, arg);
+ }
+};
+
+Async.prototype._drainQueues = function () {
+ this._drainQueue(this._normalQueue);
+ this._reset();
+ this._drainQueue(this._lateQueue);
+};
+
+Async.prototype._queueTick = function () {
+ if (!this._isTickUsed) {
+ this._isTickUsed = true;
+ this._schedule(this.drainQueues);
+ }
+};
+
+Async.prototype._reset = function () {
+ this._isTickUsed = false;
+};
+
+module.exports = new Async();
+module.exports.firstLineError = firstLineError;
diff --git a/Nodejs/node_modules/bluebird/js/main/bind.js b/Nodejs/node_modules/bluebird/js/main/bind.js
new file mode 100644
index 0000000..9d8257a
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/bind.js
@@ -0,0 +1,72 @@
+"use strict";
+module.exports = function(Promise, INTERNAL, tryConvertToPromise) {
+var rejectThis = function(_, e) {
+ this._reject(e);
+};
+
+var targetRejected = function(e, context) {
+ context.promiseRejectionQueued = true;
+ context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
+};
+
+var bindingResolved = function(thisArg, context) {
+ if (this._isPending()) {
+ this._resolveCallback(context.target);
+ }
+};
+
+var bindingRejected = function(e, context) {
+ if (!context.promiseRejectionQueued) this._reject(e);
+};
+
+Promise.prototype.bind = function (thisArg) {
+ var maybePromise = tryConvertToPromise(thisArg);
+ var ret = new Promise(INTERNAL);
+ ret._propagateFrom(this, 1);
+ var target = this._target();
+
+ ret._setBoundTo(maybePromise);
+ if (maybePromise instanceof Promise) {
+ var context = {
+ promiseRejectionQueued: false,
+ promise: ret,
+ target: target,
+ bindingPromise: maybePromise
+ };
+ target._then(INTERNAL, targetRejected, ret._progress, ret, context);
+ maybePromise._then(
+ bindingResolved, bindingRejected, ret._progress, ret, context);
+ } else {
+ ret._resolveCallback(target);
+ }
+ return ret;
+};
+
+Promise.prototype._setBoundTo = function (obj) {
+ if (obj !== undefined) {
+ this._bitField = this._bitField | 131072;
+ this._boundTo = obj;
+ } else {
+ this._bitField = this._bitField & (~131072);
+ }
+};
+
+Promise.prototype._isBound = function () {
+ return (this._bitField & 131072) === 131072;
+};
+
+Promise.bind = function (thisArg, value) {
+ var maybePromise = tryConvertToPromise(thisArg);
+ var ret = new Promise(INTERNAL);
+
+ ret._setBoundTo(maybePromise);
+ if (maybePromise instanceof Promise) {
+ maybePromise._then(function() {
+ ret._resolveCallback(value);
+ }, ret._reject, ret._progress, ret, null);
+ } else {
+ ret._resolveCallback(value);
+ }
+ return ret;
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/bluebird.js b/Nodejs/node_modules/bluebird/js/main/bluebird.js
new file mode 100644
index 0000000..ed6226e
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/bluebird.js
@@ -0,0 +1,11 @@
+"use strict";
+var old;
+if (typeof Promise !== "undefined") old = Promise;
+function noConflict() {
+ try { if (Promise === bluebird) Promise = old; }
+ catch (e) {}
+ return bluebird;
+}
+var bluebird = require("./promise.js")();
+bluebird.noConflict = noConflict;
+module.exports = bluebird;
diff --git a/Nodejs/node_modules/bluebird/js/main/call_get.js b/Nodejs/node_modules/bluebird/js/main/call_get.js
new file mode 100644
index 0000000..62c166d
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/call_get.js
@@ -0,0 +1,123 @@
+"use strict";
+var cr = Object.create;
+if (cr) {
+ var callerCache = cr(null);
+ var getterCache = cr(null);
+ callerCache[" size"] = getterCache[" size"] = 0;
+}
+
+module.exports = function(Promise) {
+var util = require("./util.js");
+var canEvaluate = util.canEvaluate;
+var isIdentifier = util.isIdentifier;
+
+var getMethodCaller;
+var getGetter;
+if (!false) {
+var makeMethodCaller = function (methodName) {
+ return new Function("ensureMethod", " \n\
+ return function(obj) { \n\
+ 'use strict' \n\
+ var len = this.length; \n\
+ ensureMethod(obj, 'methodName'); \n\
+ switch(len) { \n\
+ case 1: return obj.methodName(this[0]); \n\
+ case 2: return obj.methodName(this[0], this[1]); \n\
+ case 3: return obj.methodName(this[0], this[1], this[2]); \n\
+ case 0: return obj.methodName(); \n\
+ default: \n\
+ return obj.methodName.apply(obj, this); \n\
+ } \n\
+ }; \n\
+ ".replace(/methodName/g, methodName))(ensureMethod);
+};
+
+var makeGetter = function (propertyName) {
+ return new Function("obj", " \n\
+ 'use strict'; \n\
+ return obj.propertyName; \n\
+ ".replace("propertyName", propertyName));
+};
+
+var getCompiled = function(name, compiler, cache) {
+ var ret = cache[name];
+ if (typeof ret !== "function") {
+ if (!isIdentifier(name)) {
+ return null;
+ }
+ ret = compiler(name);
+ cache[name] = ret;
+ cache[" size"]++;
+ if (cache[" size"] > 512) {
+ var keys = Object.keys(cache);
+ for (var i = 0; i < 256; ++i) delete cache[keys[i]];
+ cache[" size"] = keys.length - 256;
+ }
+ }
+ return ret;
+};
+
+getMethodCaller = function(name) {
+ return getCompiled(name, makeMethodCaller, callerCache);
+};
+
+getGetter = function(name) {
+ return getCompiled(name, makeGetter, getterCache);
+};
+}
+
+function ensureMethod(obj, methodName) {
+ var fn;
+ if (obj != null) fn = obj[methodName];
+ if (typeof fn !== "function") {
+ var message = "Object " + util.classString(obj) + " has no method '" +
+ util.toString(methodName) + "'";
+ throw new Promise.TypeError(message);
+ }
+ return fn;
+}
+
+function caller(obj) {
+ var methodName = this.pop();
+ var fn = ensureMethod(obj, methodName);
+ return fn.apply(obj, this);
+}
+Promise.prototype.call = function (methodName) {
+ var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}
+ if (!false) {
+ if (canEvaluate) {
+ var maybeCaller = getMethodCaller(methodName);
+ if (maybeCaller !== null) {
+ return this._then(
+ maybeCaller, undefined, undefined, args, undefined);
+ }
+ }
+ }
+ args.push(methodName);
+ return this._then(caller, undefined, undefined, args, undefined);
+};
+
+function namedGetter(obj) {
+ return obj[this];
+}
+function indexedGetter(obj) {
+ var index = +this;
+ if (index < 0) index = Math.max(0, index + obj.length);
+ return obj[index];
+}
+Promise.prototype.get = function (propertyName) {
+ var isIndex = (typeof propertyName === "number");
+ var getter;
+ if (!isIndex) {
+ if (canEvaluate) {
+ var maybeGetter = getGetter(propertyName);
+ getter = maybeGetter !== null ? maybeGetter : namedGetter;
+ } else {
+ getter = namedGetter;
+ }
+ } else {
+ getter = indexedGetter;
+ }
+ return this._then(getter, undefined, undefined, propertyName, undefined);
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/cancel.js b/Nodejs/node_modules/bluebird/js/main/cancel.js
new file mode 100644
index 0000000..9eb40b6
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/cancel.js
@@ -0,0 +1,48 @@
+"use strict";
+module.exports = function(Promise) {
+var errors = require("./errors.js");
+var async = require("./async.js");
+var CancellationError = errors.CancellationError;
+
+Promise.prototype._cancel = function (reason) {
+ if (!this.isCancellable()) return this;
+ var parent;
+ var promiseToReject = this;
+ while ((parent = promiseToReject._cancellationParent) !== undefined &&
+ parent.isCancellable()) {
+ promiseToReject = parent;
+ }
+ this._unsetCancellable();
+ promiseToReject._target()._rejectCallback(reason, false, true);
+};
+
+Promise.prototype.cancel = function (reason) {
+ if (!this.isCancellable()) return this;
+ if (reason === undefined) reason = new CancellationError();
+ async.invokeLater(this._cancel, this, reason);
+ return this;
+};
+
+Promise.prototype.cancellable = function () {
+ if (this._cancellable()) return this;
+ async.enableTrampoline();
+ this._setCancellable();
+ this._cancellationParent = undefined;
+ return this;
+};
+
+Promise.prototype.uncancellable = function () {
+ var ret = this.then();
+ ret._unsetCancellable();
+ return ret;
+};
+
+Promise.prototype.fork = function (didFulfill, didReject, didProgress) {
+ var ret = this._then(didFulfill, didReject, didProgress,
+ undefined, undefined);
+
+ ret._setCancellable();
+ ret._cancellationParent = undefined;
+ return ret;
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/captured_trace.js b/Nodejs/node_modules/bluebird/js/main/captured_trace.js
new file mode 100644
index 0000000..802acd3
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/captured_trace.js
@@ -0,0 +1,493 @@
+"use strict";
+module.exports = function() {
+var async = require("./async.js");
+var util = require("./util.js");
+var bluebirdFramePattern =
+ /[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/;
+var stackFramePattern = null;
+var formatStack = null;
+var indentStackFrames = false;
+var warn;
+
+function CapturedTrace(parent) {
+ this._parent = parent;
+ var length = this._length = 1 + (parent === undefined ? 0 : parent._length);
+ captureStackTrace(this, CapturedTrace);
+ if (length > 32) this.uncycle();
+}
+util.inherits(CapturedTrace, Error);
+
+CapturedTrace.prototype.uncycle = function() {
+ var length = this._length;
+ if (length < 2) return;
+ var nodes = [];
+ var stackToIndex = {};
+
+ for (var i = 0, node = this; node !== undefined; ++i) {
+ nodes.push(node);
+ node = node._parent;
+ }
+ length = this._length = i;
+ for (var i = length - 1; i >= 0; --i) {
+ var stack = nodes[i].stack;
+ if (stackToIndex[stack] === undefined) {
+ stackToIndex[stack] = i;
+ }
+ }
+ for (var i = 0; i < length; ++i) {
+ var currentStack = nodes[i].stack;
+ var index = stackToIndex[currentStack];
+ if (index !== undefined && index !== i) {
+ if (index > 0) {
+ nodes[index - 1]._parent = undefined;
+ nodes[index - 1]._length = 1;
+ }
+ nodes[i]._parent = undefined;
+ nodes[i]._length = 1;
+ var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;
+
+ if (index < length - 1) {
+ cycleEdgeNode._parent = nodes[index + 1];
+ cycleEdgeNode._parent.uncycle();
+ cycleEdgeNode._length =
+ cycleEdgeNode._parent._length + 1;
+ } else {
+ cycleEdgeNode._parent = undefined;
+ cycleEdgeNode._length = 1;
+ }
+ var currentChildLength = cycleEdgeNode._length + 1;
+ for (var j = i - 2; j >= 0; --j) {
+ nodes[j]._length = currentChildLength;
+ currentChildLength++;
+ }
+ return;
+ }
+ }
+};
+
+CapturedTrace.prototype.parent = function() {
+ return this._parent;
+};
+
+CapturedTrace.prototype.hasParent = function() {
+ return this._parent !== undefined;
+};
+
+CapturedTrace.prototype.attachExtraTrace = function(error) {
+ if (error.__stackCleaned__) return;
+ this.uncycle();
+ var parsed = CapturedTrace.parseStackAndMessage(error);
+ var message = parsed.message;
+ var stacks = [parsed.stack];
+
+ var trace = this;
+ while (trace !== undefined) {
+ stacks.push(cleanStack(trace.stack.split("\n")));
+ trace = trace._parent;
+ }
+ removeCommonRoots(stacks);
+ removeDuplicateOrEmptyJumps(stacks);
+ util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
+ util.notEnumerableProp(error, "__stackCleaned__", true);
+};
+
+function reconstructStack(message, stacks) {
+ for (var i = 0; i < stacks.length - 1; ++i) {
+ stacks[i].push("From previous event:");
+ stacks[i] = stacks[i].join("\n");
+ }
+ if (i < stacks.length) {
+ stacks[i] = stacks[i].join("\n");
+ }
+ return message + "\n" + stacks.join("\n");
+}
+
+function removeDuplicateOrEmptyJumps(stacks) {
+ for (var i = 0; i < stacks.length; ++i) {
+ if (stacks[i].length === 0 ||
+ ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {
+ stacks.splice(i, 1);
+ i--;
+ }
+ }
+}
+
+function removeCommonRoots(stacks) {
+ var current = stacks[0];
+ for (var i = 1; i < stacks.length; ++i) {
+ var prev = stacks[i];
+ var currentLastIndex = current.length - 1;
+ var currentLastLine = current[currentLastIndex];
+ var commonRootMeetPoint = -1;
+
+ for (var j = prev.length - 1; j >= 0; --j) {
+ if (prev[j] === currentLastLine) {
+ commonRootMeetPoint = j;
+ break;
+ }
+ }
+
+ for (var j = commonRootMeetPoint; j >= 0; --j) {
+ var line = prev[j];
+ if (current[currentLastIndex] === line) {
+ current.pop();
+ currentLastIndex--;
+ } else {
+ break;
+ }
+ }
+ current = prev;
+ }
+}
+
+function cleanStack(stack) {
+ var ret = [];
+ for (var i = 0; i < stack.length; ++i) {
+ var line = stack[i];
+ var isTraceLine = stackFramePattern.test(line) ||
+ " (No stack trace)" === line;
+ var isInternalFrame = isTraceLine && shouldIgnore(line);
+ if (isTraceLine && !isInternalFrame) {
+ if (indentStackFrames && line.charAt(0) !== " ") {
+ line = " " + line;
+ }
+ ret.push(line);
+ }
+ }
+ return ret;
+}
+
+function stackFramesAsArray(error) {
+ var stack = error.stack.replace(/\s+$/g, "").split("\n");
+ for (var i = 0; i < stack.length; ++i) {
+ var line = stack[i];
+ if (" (No stack trace)" === line || stackFramePattern.test(line)) {
+ break;
+ }
+ }
+ if (i > 0) {
+ stack = stack.slice(i);
+ }
+ return stack;
+}
+
+CapturedTrace.parseStackAndMessage = function(error) {
+ var stack = error.stack;
+ var message = error.toString();
+ stack = typeof stack === "string" && stack.length > 0
+ ? stackFramesAsArray(error) : [" (No stack trace)"];
+ return {
+ message: message,
+ stack: cleanStack(stack)
+ };
+};
+
+CapturedTrace.formatAndLogError = function(error, title) {
+ if (typeof console !== "undefined") {
+ var message;
+ if (typeof error === "object" || typeof error === "function") {
+ var stack = error.stack;
+ message = title + formatStack(stack, error);
+ } else {
+ message = title + String(error);
+ }
+ if (typeof warn === "function") {
+ warn(message);
+ } else if (typeof console.log === "function" ||
+ typeof console.log === "object") {
+ console.log(message);
+ }
+ }
+};
+
+CapturedTrace.unhandledRejection = function (reason) {
+ CapturedTrace.formatAndLogError(reason, "^--- With additional stack trace: ");
+};
+
+CapturedTrace.isSupported = function () {
+ return typeof captureStackTrace === "function";
+};
+
+CapturedTrace.fireRejectionEvent =
+function(name, localHandler, reason, promise) {
+ var localEventFired = false;
+ try {
+ if (typeof localHandler === "function") {
+ localEventFired = true;
+ if (name === "rejectionHandled") {
+ localHandler(promise);
+ } else {
+ localHandler(reason, promise);
+ }
+ }
+ } catch (e) {
+ async.throwLater(e);
+ }
+
+ var globalEventFired = false;
+ try {
+ globalEventFired = fireGlobalEvent(name, reason, promise);
+ } catch (e) {
+ globalEventFired = true;
+ async.throwLater(e);
+ }
+
+ var domEventFired = false;
+ if (fireDomEvent) {
+ try {
+ domEventFired = fireDomEvent(name.toLowerCase(), {
+ reason: reason,
+ promise: promise
+ });
+ } catch (e) {
+ domEventFired = true;
+ async.throwLater(e);
+ }
+ }
+
+ if (!globalEventFired && !localEventFired && !domEventFired &&
+ name === "unhandledRejection") {
+ CapturedTrace.formatAndLogError(reason, "Unhandled rejection ");
+ }
+};
+
+function formatNonError(obj) {
+ var str;
+ if (typeof obj === "function") {
+ str = "[function " +
+ (obj.name || "anonymous") +
+ "]";
+ } else {
+ str = obj.toString();
+ var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/;
+ if (ruselessToString.test(str)) {
+ try {
+ var newStr = JSON.stringify(obj);
+ str = newStr;
+ }
+ catch(e) {
+
+ }
+ }
+ if (str.length === 0) {
+ str = "(empty array)";
+ }
+ }
+ return ("(<" + snip(str) + ">, no stack trace)");
+}
+
+function snip(str) {
+ var maxChars = 41;
+ if (str.length < maxChars) {
+ return str;
+ }
+ return str.substr(0, maxChars - 3) + "...";
+}
+
+var shouldIgnore = function() { return false; };
+var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;
+function parseLineInfo(line) {
+ var matches = line.match(parseLineInfoRegex);
+ if (matches) {
+ return {
+ fileName: matches[1],
+ line: parseInt(matches[2], 10)
+ };
+ }
+}
+CapturedTrace.setBounds = function(firstLineError, lastLineError) {
+ if (!CapturedTrace.isSupported()) return;
+ var firstStackLines = firstLineError.stack.split("\n");
+ var lastStackLines = lastLineError.stack.split("\n");
+ var firstIndex = -1;
+ var lastIndex = -1;
+ var firstFileName;
+ var lastFileName;
+ for (var i = 0; i < firstStackLines.length; ++i) {
+ var result = parseLineInfo(firstStackLines[i]);
+ if (result) {
+ firstFileName = result.fileName;
+ firstIndex = result.line;
+ break;
+ }
+ }
+ for (var i = 0; i < lastStackLines.length; ++i) {
+ var result = parseLineInfo(lastStackLines[i]);
+ if (result) {
+ lastFileName = result.fileName;
+ lastIndex = result.line;
+ break;
+ }
+ }
+ if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||
+ firstFileName !== lastFileName || firstIndex >= lastIndex) {
+ return;
+ }
+
+ shouldIgnore = function(line) {
+ if (bluebirdFramePattern.test(line)) return true;
+ var info = parseLineInfo(line);
+ if (info) {
+ if (info.fileName === firstFileName &&
+ (firstIndex <= info.line && info.line <= lastIndex)) {
+ return true;
+ }
+ }
+ return false;
+ };
+};
+
+var captureStackTrace = (function stackDetection() {
+ var v8stackFramePattern = /^\s*at\s*/;
+ var v8stackFormatter = function(stack, error) {
+ if (typeof stack === "string") return stack;
+
+ if (error.name !== undefined &&
+ error.message !== undefined) {
+ return error.toString();
+ }
+ return formatNonError(error);
+ };
+
+ if (typeof Error.stackTraceLimit === "number" &&
+ typeof Error.captureStackTrace === "function") {
+ Error.stackTraceLimit = Error.stackTraceLimit + 6;
+ stackFramePattern = v8stackFramePattern;
+ formatStack = v8stackFormatter;
+ var captureStackTrace = Error.captureStackTrace;
+
+ shouldIgnore = function(line) {
+ return bluebirdFramePattern.test(line);
+ };
+ return function(receiver, ignoreUntil) {
+ Error.stackTraceLimit = Error.stackTraceLimit + 6;
+ captureStackTrace(receiver, ignoreUntil);
+ Error.stackTraceLimit = Error.stackTraceLimit - 6;
+ };
+ }
+ var err = new Error();
+
+ if (typeof err.stack === "string" &&
+ err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) {
+ stackFramePattern = /@/;
+ formatStack = v8stackFormatter;
+ indentStackFrames = true;
+ return function captureStackTrace(o) {
+ o.stack = new Error().stack;
+ };
+ }
+
+ var hasStackAfterThrow;
+ try { throw new Error(); }
+ catch(e) {
+ hasStackAfterThrow = ("stack" in e);
+ }
+ if (!("stack" in err) && hasStackAfterThrow &&
+ typeof Error.stackTraceLimit === "number") {
+ stackFramePattern = v8stackFramePattern;
+ formatStack = v8stackFormatter;
+ return function captureStackTrace(o) {
+ Error.stackTraceLimit = Error.stackTraceLimit + 6;
+ try { throw new Error(); }
+ catch(e) { o.stack = e.stack; }
+ Error.stackTraceLimit = Error.stackTraceLimit - 6;
+ };
+ }
+
+ formatStack = function(stack, error) {
+ if (typeof stack === "string") return stack;
+
+ if ((typeof error === "object" ||
+ typeof error === "function") &&
+ error.name !== undefined &&
+ error.message !== undefined) {
+ return error.toString();
+ }
+ return formatNonError(error);
+ };
+
+ return null;
+
+})([]);
+
+var fireDomEvent;
+var fireGlobalEvent = (function() {
+ if (util.isNode) {
+ return function(name, reason, promise) {
+ if (name === "rejectionHandled") {
+ return process.emit(name, promise);
+ } else {
+ return process.emit(name, reason, promise);
+ }
+ };
+ } else {
+ var customEventWorks = false;
+ var anyEventWorks = true;
+ try {
+ var ev = new self.CustomEvent("test");
+ customEventWorks = ev instanceof CustomEvent;
+ } catch (e) {}
+ if (!customEventWorks) {
+ try {
+ var event = document.createEvent("CustomEvent");
+ event.initCustomEvent("testingtheevent", false, true, {});
+ self.dispatchEvent(event);
+ } catch (e) {
+ anyEventWorks = false;
+ }
+ }
+ if (anyEventWorks) {
+ fireDomEvent = function(type, detail) {
+ var event;
+ if (customEventWorks) {
+ event = new self.CustomEvent(type, {
+ detail: detail,
+ bubbles: false,
+ cancelable: true
+ });
+ } else if (self.dispatchEvent) {
+ event = document.createEvent("CustomEvent");
+ event.initCustomEvent(type, false, true, detail);
+ }
+
+ return event ? !self.dispatchEvent(event) : false;
+ };
+ }
+
+ var toWindowMethodNameMap = {};
+ toWindowMethodNameMap["unhandledRejection"] = ("on" +
+ "unhandledRejection").toLowerCase();
+ toWindowMethodNameMap["rejectionHandled"] = ("on" +
+ "rejectionHandled").toLowerCase();
+
+ return function(name, reason, promise) {
+ var methodName = toWindowMethodNameMap[name];
+ var method = self[methodName];
+ if (!method) return false;
+ if (name === "rejectionHandled") {
+ method.call(self, promise);
+ } else {
+ method.call(self, reason, promise);
+ }
+ return true;
+ };
+ }
+})();
+
+if (typeof console !== "undefined" && typeof console.warn !== "undefined") {
+ warn = function (message) {
+ console.warn(message);
+ };
+ if (util.isNode && process.stderr.isTTY) {
+ warn = function(message) {
+ process.stderr.write("\u001b[31m" + message + "\u001b[39m\n");
+ };
+ } else if (!util.isNode && typeof (new Error().stack) === "string") {
+ warn = function(message) {
+ console.warn("%c" + message, "color: red");
+ };
+ }
+}
+
+return CapturedTrace;
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/catch_filter.js b/Nodejs/node_modules/bluebird/js/main/catch_filter.js
new file mode 100644
index 0000000..df12733
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/catch_filter.js
@@ -0,0 +1,66 @@
+"use strict";
+module.exports = function(NEXT_FILTER) {
+var util = require("./util.js");
+var errors = require("./errors.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+var keys = require("./es5.js").keys;
+var TypeError = errors.TypeError;
+
+function CatchFilter(instances, callback, promise) {
+ this._instances = instances;
+ this._callback = callback;
+ this._promise = promise;
+}
+
+function safePredicate(predicate, e) {
+ var safeObject = {};
+ var retfilter = tryCatch(predicate).call(safeObject, e);
+
+ if (retfilter === errorObj) return retfilter;
+
+ var safeKeys = keys(safeObject);
+ if (safeKeys.length) {
+ errorObj.e = new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a");
+ return errorObj;
+ }
+ return retfilter;
+}
+
+CatchFilter.prototype.doFilter = function (e) {
+ var cb = this._callback;
+ var promise = this._promise;
+ var boundTo = promise._boundValue();
+ for (var i = 0, len = this._instances.length; i < len; ++i) {
+ var item = this._instances[i];
+ var itemIsErrorType = item === Error ||
+ (item != null && item.prototype instanceof Error);
+
+ if (itemIsErrorType && e instanceof item) {
+ var ret = tryCatch(cb).call(boundTo, e);
+ if (ret === errorObj) {
+ NEXT_FILTER.e = ret.e;
+ return NEXT_FILTER;
+ }
+ return ret;
+ } else if (typeof item === "function" && !itemIsErrorType) {
+ var shouldHandle = safePredicate(item, e);
+ if (shouldHandle === errorObj) {
+ e = errorObj.e;
+ break;
+ } else if (shouldHandle) {
+ var ret = tryCatch(cb).call(boundTo, e);
+ if (ret === errorObj) {
+ NEXT_FILTER.e = ret.e;
+ return NEXT_FILTER;
+ }
+ return ret;
+ }
+ }
+ }
+ NEXT_FILTER.e = e;
+ return NEXT_FILTER;
+};
+
+return CatchFilter;
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/context.js b/Nodejs/node_modules/bluebird/js/main/context.js
new file mode 100644
index 0000000..ccd7702
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/context.js
@@ -0,0 +1,38 @@
+"use strict";
+module.exports = function(Promise, CapturedTrace, isDebugging) {
+var contextStack = [];
+function Context() {
+ this._trace = new CapturedTrace(peekContext());
+}
+Context.prototype._pushContext = function () {
+ if (!isDebugging()) return;
+ if (this._trace !== undefined) {
+ contextStack.push(this._trace);
+ }
+};
+
+Context.prototype._popContext = function () {
+ if (!isDebugging()) return;
+ if (this._trace !== undefined) {
+ contextStack.pop();
+ }
+};
+
+function createContext() {
+ if (isDebugging()) return new Context();
+}
+
+function peekContext() {
+ var lastIndex = contextStack.length - 1;
+ if (lastIndex >= 0) {
+ return contextStack[lastIndex];
+ }
+ return undefined;
+}
+
+Promise.prototype._peekContext = peekContext;
+Promise.prototype._pushContext = Context.prototype._pushContext;
+Promise.prototype._popContext = Context.prototype._popContext;
+
+return createContext;
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/debuggability.js b/Nodejs/node_modules/bluebird/js/main/debuggability.js
new file mode 100644
index 0000000..106baf6
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/debuggability.js
@@ -0,0 +1,162 @@
+"use strict";
+module.exports = function(Promise, CapturedTrace) {
+var getDomain = Promise._getDomain;
+var async = require("./async.js");
+var Warning = require("./errors.js").Warning;
+var util = require("./util.js");
+var canAttachTrace = util.canAttachTrace;
+var unhandledRejectionHandled;
+var possiblyUnhandledRejection;
+var debugging = false || (util.isNode &&
+ (!!process.env["BLUEBIRD_DEBUG"] ||
+ process.env["NODE_ENV"] === "development"));
+
+if (util.isNode && process.env["BLUEBIRD_DEBUG"] == 0) debugging = false;
+
+if (debugging) {
+ async.disableTrampolineIfNecessary();
+}
+
+Promise.prototype._ignoreRejections = function() {
+ this._unsetRejectionIsUnhandled();
+ this._bitField = this._bitField | 16777216;
+};
+
+Promise.prototype._ensurePossibleRejectionHandled = function () {
+ if ((this._bitField & 16777216) !== 0) return;
+ this._setRejectionIsUnhandled();
+ async.invokeLater(this._notifyUnhandledRejection, this, undefined);
+};
+
+Promise.prototype._notifyUnhandledRejectionIsHandled = function () {
+ CapturedTrace.fireRejectionEvent("rejectionHandled",
+ unhandledRejectionHandled, undefined, this);
+};
+
+Promise.prototype._notifyUnhandledRejection = function () {
+ if (this._isRejectionUnhandled()) {
+ var reason = this._getCarriedStackTrace() || this._settledValue;
+ this._setUnhandledRejectionIsNotified();
+ CapturedTrace.fireRejectionEvent("unhandledRejection",
+ possiblyUnhandledRejection, reason, this);
+ }
+};
+
+Promise.prototype._setUnhandledRejectionIsNotified = function () {
+ this._bitField = this._bitField | 524288;
+};
+
+Promise.prototype._unsetUnhandledRejectionIsNotified = function () {
+ this._bitField = this._bitField & (~524288);
+};
+
+Promise.prototype._isUnhandledRejectionNotified = function () {
+ return (this._bitField & 524288) > 0;
+};
+
+Promise.prototype._setRejectionIsUnhandled = function () {
+ this._bitField = this._bitField | 2097152;
+};
+
+Promise.prototype._unsetRejectionIsUnhandled = function () {
+ this._bitField = this._bitField & (~2097152);
+ if (this._isUnhandledRejectionNotified()) {
+ this._unsetUnhandledRejectionIsNotified();
+ this._notifyUnhandledRejectionIsHandled();
+ }
+};
+
+Promise.prototype._isRejectionUnhandled = function () {
+ return (this._bitField & 2097152) > 0;
+};
+
+Promise.prototype._setCarriedStackTrace = function (capturedTrace) {
+ this._bitField = this._bitField | 1048576;
+ this._fulfillmentHandler0 = capturedTrace;
+};
+
+Promise.prototype._isCarryingStackTrace = function () {
+ return (this._bitField & 1048576) > 0;
+};
+
+Promise.prototype._getCarriedStackTrace = function () {
+ return this._isCarryingStackTrace()
+ ? this._fulfillmentHandler0
+ : undefined;
+};
+
+Promise.prototype._captureStackTrace = function () {
+ if (debugging) {
+ this._trace = new CapturedTrace(this._peekContext());
+ }
+ return this;
+};
+
+Promise.prototype._attachExtraTrace = function (error, ignoreSelf) {
+ if (debugging && canAttachTrace(error)) {
+ var trace = this._trace;
+ if (trace !== undefined) {
+ if (ignoreSelf) trace = trace._parent;
+ }
+ if (trace !== undefined) {
+ trace.attachExtraTrace(error);
+ } else if (!error.__stackCleaned__) {
+ var parsed = CapturedTrace.parseStackAndMessage(error);
+ util.notEnumerableProp(error, "stack",
+ parsed.message + "\n" + parsed.stack.join("\n"));
+ util.notEnumerableProp(error, "__stackCleaned__", true);
+ }
+ }
+};
+
+Promise.prototype._warn = function(message) {
+ var warning = new Warning(message);
+ var ctx = this._peekContext();
+ if (ctx) {
+ ctx.attachExtraTrace(warning);
+ } else {
+ var parsed = CapturedTrace.parseStackAndMessage(warning);
+ warning.stack = parsed.message + "\n" + parsed.stack.join("\n");
+ }
+ CapturedTrace.formatAndLogError(warning, "");
+};
+
+Promise.onPossiblyUnhandledRejection = function (fn) {
+ var domain = getDomain();
+ possiblyUnhandledRejection =
+ typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))
+ : undefined;
+};
+
+Promise.onUnhandledRejectionHandled = function (fn) {
+ var domain = getDomain();
+ unhandledRejectionHandled =
+ typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))
+ : undefined;
+};
+
+Promise.longStackTraces = function () {
+ if (async.haveItemsQueued() &&
+ debugging === false
+ ) {
+ throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a");
+ }
+ debugging = CapturedTrace.isSupported();
+ if (debugging) {
+ async.disableTrampolineIfNecessary();
+ }
+};
+
+Promise.hasLongStackTraces = function () {
+ return debugging && CapturedTrace.isSupported();
+};
+
+if (!CapturedTrace.isSupported()) {
+ Promise.longStackTraces = function(){};
+ debugging = false;
+}
+
+return function() {
+ return debugging;
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/direct_resolve.js b/Nodejs/node_modules/bluebird/js/main/direct_resolve.js
new file mode 100644
index 0000000..054685a
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/direct_resolve.js
@@ -0,0 +1,63 @@
+"use strict";
+var util = require("./util.js");
+var isPrimitive = util.isPrimitive;
+
+module.exports = function(Promise) {
+var returner = function () {
+ return this;
+};
+var thrower = function () {
+ throw this;
+};
+var returnUndefined = function() {};
+var throwUndefined = function() {
+ throw undefined;
+};
+
+var wrapper = function (value, action) {
+ if (action === 1) {
+ return function () {
+ throw value;
+ };
+ } else if (action === 2) {
+ return function () {
+ return value;
+ };
+ }
+};
+
+
+Promise.prototype["return"] =
+Promise.prototype.thenReturn = function (value) {
+ if (value === undefined) return this.then(returnUndefined);
+
+ if (isPrimitive(value)) {
+ return this._then(
+ wrapper(value, 2),
+ undefined,
+ undefined,
+ undefined,
+ undefined
+ );
+ } else if (value instanceof Promise) {
+ value._ignoreRejections();
+ }
+ return this._then(returner, undefined, undefined, value, undefined);
+};
+
+Promise.prototype["throw"] =
+Promise.prototype.thenThrow = function (reason) {
+ if (reason === undefined) return this.then(throwUndefined);
+
+ if (isPrimitive(reason)) {
+ return this._then(
+ wrapper(reason, 1),
+ undefined,
+ undefined,
+ undefined,
+ undefined
+ );
+ }
+ return this._then(thrower, undefined, undefined, reason, undefined);
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/each.js b/Nodejs/node_modules/bluebird/js/main/each.js
new file mode 100644
index 0000000..a37e22c
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/each.js
@@ -0,0 +1,12 @@
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var PromiseReduce = Promise.reduce;
+
+Promise.prototype.each = function (fn) {
+ return PromiseReduce(this, fn, null, INTERNAL);
+};
+
+Promise.each = function (promises, fn) {
+ return PromiseReduce(promises, fn, null, INTERNAL);
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/errors.js b/Nodejs/node_modules/bluebird/js/main/errors.js
new file mode 100644
index 0000000..c334bb1
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/errors.js
@@ -0,0 +1,111 @@
+"use strict";
+var es5 = require("./es5.js");
+var Objectfreeze = es5.freeze;
+var util = require("./util.js");
+var inherits = util.inherits;
+var notEnumerableProp = util.notEnumerableProp;
+
+function subError(nameProperty, defaultMessage) {
+ function SubError(message) {
+ if (!(this instanceof SubError)) return new SubError(message);
+ notEnumerableProp(this, "message",
+ typeof message === "string" ? message : defaultMessage);
+ notEnumerableProp(this, "name", nameProperty);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ } else {
+ Error.call(this);
+ }
+ }
+ inherits(SubError, Error);
+ return SubError;
+}
+
+var _TypeError, _RangeError;
+var Warning = subError("Warning", "warning");
+var CancellationError = subError("CancellationError", "cancellation error");
+var TimeoutError = subError("TimeoutError", "timeout error");
+var AggregateError = subError("AggregateError", "aggregate error");
+try {
+ _TypeError = TypeError;
+ _RangeError = RangeError;
+} catch(e) {
+ _TypeError = subError("TypeError", "type error");
+ _RangeError = subError("RangeError", "range error");
+}
+
+var methods = ("join pop push shift unshift slice filter forEach some " +
+ "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");
+
+for (var i = 0; i < methods.length; ++i) {
+ if (typeof Array.prototype[methods[i]] === "function") {
+ AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];
+ }
+}
+
+es5.defineProperty(AggregateError.prototype, "length", {
+ value: 0,
+ configurable: false,
+ writable: true,
+ enumerable: true
+});
+AggregateError.prototype["isOperational"] = true;
+var level = 0;
+AggregateError.prototype.toString = function() {
+ var indent = Array(level * 4 + 1).join(" ");
+ var ret = "\n" + indent + "AggregateError of:" + "\n";
+ level++;
+ indent = Array(level * 4 + 1).join(" ");
+ for (var i = 0; i < this.length; ++i) {
+ var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "";
+ var lines = str.split("\n");
+ for (var j = 0; j < lines.length; ++j) {
+ lines[j] = indent + lines[j];
+ }
+ str = lines.join("\n");
+ ret += str + "\n";
+ }
+ level--;
+ return ret;
+};
+
+function OperationalError(message) {
+ if (!(this instanceof OperationalError))
+ return new OperationalError(message);
+ notEnumerableProp(this, "name", "OperationalError");
+ notEnumerableProp(this, "message", message);
+ this.cause = message;
+ this["isOperational"] = true;
+
+ if (message instanceof Error) {
+ notEnumerableProp(this, "message", message.message);
+ notEnumerableProp(this, "stack", message.stack);
+ } else if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+}
+inherits(OperationalError, Error);
+
+var errorTypes = Error["__BluebirdErrorTypes__"];
+if (!errorTypes) {
+ errorTypes = Objectfreeze({
+ CancellationError: CancellationError,
+ TimeoutError: TimeoutError,
+ OperationalError: OperationalError,
+ RejectionError: OperationalError,
+ AggregateError: AggregateError
+ });
+ notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes);
+}
+
+module.exports = {
+ Error: Error,
+ TypeError: _TypeError,
+ RangeError: _RangeError,
+ CancellationError: errorTypes.CancellationError,
+ OperationalError: errorTypes.OperationalError,
+ TimeoutError: errorTypes.TimeoutError,
+ AggregateError: errorTypes.AggregateError,
+ Warning: Warning
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/es5.js b/Nodejs/node_modules/bluebird/js/main/es5.js
new file mode 100644
index 0000000..ea41d5a
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/es5.js
@@ -0,0 +1,80 @@
+var isES5 = (function(){
+ "use strict";
+ return this === undefined;
+})();
+
+if (isES5) {
+ module.exports = {
+ freeze: Object.freeze,
+ defineProperty: Object.defineProperty,
+ getDescriptor: Object.getOwnPropertyDescriptor,
+ keys: Object.keys,
+ names: Object.getOwnPropertyNames,
+ getPrototypeOf: Object.getPrototypeOf,
+ isArray: Array.isArray,
+ isES5: isES5,
+ propertyIsWritable: function(obj, prop) {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
+ return !!(!descriptor || descriptor.writable || descriptor.set);
+ }
+ };
+} else {
+ var has = {}.hasOwnProperty;
+ var str = {}.toString;
+ var proto = {}.constructor.prototype;
+
+ var ObjectKeys = function (o) {
+ var ret = [];
+ for (var key in o) {
+ if (has.call(o, key)) {
+ ret.push(key);
+ }
+ }
+ return ret;
+ };
+
+ var ObjectGetDescriptor = function(o, key) {
+ return {value: o[key]};
+ };
+
+ var ObjectDefineProperty = function (o, key, desc) {
+ o[key] = desc.value;
+ return o;
+ };
+
+ var ObjectFreeze = function (obj) {
+ return obj;
+ };
+
+ var ObjectGetPrototypeOf = function (obj) {
+ try {
+ return Object(obj).constructor.prototype;
+ }
+ catch (e) {
+ return proto;
+ }
+ };
+
+ var ArrayIsArray = function (obj) {
+ try {
+ return str.call(obj) === "[object Array]";
+ }
+ catch(e) {
+ return false;
+ }
+ };
+
+ module.exports = {
+ isArray: ArrayIsArray,
+ keys: ObjectKeys,
+ names: ObjectKeys,
+ defineProperty: ObjectDefineProperty,
+ getDescriptor: ObjectGetDescriptor,
+ freeze: ObjectFreeze,
+ getPrototypeOf: ObjectGetPrototypeOf,
+ isES5: isES5,
+ propertyIsWritable: function() {
+ return true;
+ }
+ };
+}
diff --git a/Nodejs/node_modules/bluebird/js/main/filter.js b/Nodejs/node_modules/bluebird/js/main/filter.js
new file mode 100644
index 0000000..ed57bf0
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/filter.js
@@ -0,0 +1,12 @@
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var PromiseMap = Promise.map;
+
+Promise.prototype.filter = function (fn, options) {
+ return PromiseMap(this, fn, options, INTERNAL);
+};
+
+Promise.filter = function (promises, fn, options) {
+ return PromiseMap(promises, fn, options, INTERNAL);
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/finally.js b/Nodejs/node_modules/bluebird/js/main/finally.js
new file mode 100644
index 0000000..c9342bc
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/finally.js
@@ -0,0 +1,98 @@
+"use strict";
+module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) {
+var util = require("./util.js");
+var isPrimitive = util.isPrimitive;
+var thrower = util.thrower;
+
+function returnThis() {
+ return this;
+}
+function throwThis() {
+ throw this;
+}
+function return$(r) {
+ return function() {
+ return r;
+ };
+}
+function throw$(r) {
+ return function() {
+ throw r;
+ };
+}
+function promisedFinally(ret, reasonOrValue, isFulfilled) {
+ var then;
+ if (isPrimitive(reasonOrValue)) {
+ then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue);
+ } else {
+ then = isFulfilled ? returnThis : throwThis;
+ }
+ return ret._then(then, thrower, undefined, reasonOrValue, undefined);
+}
+
+function finallyHandler(reasonOrValue) {
+ var promise = this.promise;
+ var handler = this.handler;
+
+ var ret = promise._isBound()
+ ? handler.call(promise._boundValue())
+ : handler();
+
+ if (ret !== undefined) {
+ var maybePromise = tryConvertToPromise(ret, promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ return promisedFinally(maybePromise, reasonOrValue,
+ promise.isFulfilled());
+ }
+ }
+
+ if (promise.isRejected()) {
+ NEXT_FILTER.e = reasonOrValue;
+ return NEXT_FILTER;
+ } else {
+ return reasonOrValue;
+ }
+}
+
+function tapHandler(value) {
+ var promise = this.promise;
+ var handler = this.handler;
+
+ var ret = promise._isBound()
+ ? handler.call(promise._boundValue(), value)
+ : handler(value);
+
+ if (ret !== undefined) {
+ var maybePromise = tryConvertToPromise(ret, promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ return promisedFinally(maybePromise, value, true);
+ }
+ }
+ return value;
+}
+
+Promise.prototype._passThroughHandler = function (handler, isFinally) {
+ if (typeof handler !== "function") return this.then();
+
+ var promiseAndHandler = {
+ promise: this,
+ handler: handler
+ };
+
+ return this._then(
+ isFinally ? finallyHandler : tapHandler,
+ isFinally ? finallyHandler : undefined, undefined,
+ promiseAndHandler, undefined);
+};
+
+Promise.prototype.lastly =
+Promise.prototype["finally"] = function (handler) {
+ return this._passThroughHandler(handler, true);
+};
+
+Promise.prototype.tap = function (handler) {
+ return this._passThroughHandler(handler, false);
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/generators.js b/Nodejs/node_modules/bluebird/js/main/generators.js
new file mode 100644
index 0000000..4c0568d
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/generators.js
@@ -0,0 +1,136 @@
+"use strict";
+module.exports = function(Promise,
+ apiRejection,
+ INTERNAL,
+ tryConvertToPromise) {
+var errors = require("./errors.js");
+var TypeError = errors.TypeError;
+var util = require("./util.js");
+var errorObj = util.errorObj;
+var tryCatch = util.tryCatch;
+var yieldHandlers = [];
+
+function promiseFromYieldHandler(value, yieldHandlers, traceParent) {
+ for (var i = 0; i < yieldHandlers.length; ++i) {
+ traceParent._pushContext();
+ var result = tryCatch(yieldHandlers[i])(value);
+ traceParent._popContext();
+ if (result === errorObj) {
+ traceParent._pushContext();
+ var ret = Promise.reject(errorObj.e);
+ traceParent._popContext();
+ return ret;
+ }
+ var maybePromise = tryConvertToPromise(result, traceParent);
+ if (maybePromise instanceof Promise) return maybePromise;
+ }
+ return null;
+}
+
+function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {
+ var promise = this._promise = new Promise(INTERNAL);
+ promise._captureStackTrace();
+ this._stack = stack;
+ this._generatorFunction = generatorFunction;
+ this._receiver = receiver;
+ this._generator = undefined;
+ this._yieldHandlers = typeof yieldHandler === "function"
+ ? [yieldHandler].concat(yieldHandlers)
+ : yieldHandlers;
+}
+
+PromiseSpawn.prototype.promise = function () {
+ return this._promise;
+};
+
+PromiseSpawn.prototype._run = function () {
+ this._generator = this._generatorFunction.call(this._receiver);
+ this._receiver =
+ this._generatorFunction = undefined;
+ this._next(undefined);
+};
+
+PromiseSpawn.prototype._continue = function (result) {
+ if (result === errorObj) {
+ return this._promise._rejectCallback(result.e, false, true);
+ }
+
+ var value = result.value;
+ if (result.done === true) {
+ this._promise._resolveCallback(value);
+ } else {
+ var maybePromise = tryConvertToPromise(value, this._promise);
+ if (!(maybePromise instanceof Promise)) {
+ maybePromise =
+ promiseFromYieldHandler(maybePromise,
+ this._yieldHandlers,
+ this._promise);
+ if (maybePromise === null) {
+ this._throw(
+ new TypeError(
+ "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/4Y4pDk\u000a\u000a".replace("%s", value) +
+ "From coroutine:\u000a" +
+ this._stack.split("\n").slice(1, -7).join("\n")
+ )
+ );
+ return;
+ }
+ }
+ maybePromise._then(
+ this._next,
+ this._throw,
+ undefined,
+ this,
+ null
+ );
+ }
+};
+
+PromiseSpawn.prototype._throw = function (reason) {
+ this._promise._attachExtraTrace(reason);
+ this._promise._pushContext();
+ var result = tryCatch(this._generator["throw"])
+ .call(this._generator, reason);
+ this._promise._popContext();
+ this._continue(result);
+};
+
+PromiseSpawn.prototype._next = function (value) {
+ this._promise._pushContext();
+ var result = tryCatch(this._generator.next).call(this._generator, value);
+ this._promise._popContext();
+ this._continue(result);
+};
+
+Promise.coroutine = function (generatorFunction, options) {
+ if (typeof generatorFunction !== "function") {
+ throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a");
+ }
+ var yieldHandler = Object(options).yieldHandler;
+ var PromiseSpawn$ = PromiseSpawn;
+ var stack = new Error().stack;
+ return function () {
+ var generator = generatorFunction.apply(this, arguments);
+ var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,
+ stack);
+ spawn._generator = generator;
+ spawn._next(undefined);
+ return spawn.promise();
+ };
+};
+
+Promise.coroutine.addYieldHandler = function(fn) {
+ if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ yieldHandlers.push(fn);
+};
+
+Promise.spawn = function (generatorFunction) {
+ if (typeof generatorFunction !== "function") {
+ return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a");
+ }
+ var spawn = new PromiseSpawn(generatorFunction, this);
+ var ret = spawn.promise();
+ spawn._run(Promise.spawn);
+ return ret;
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/join.js b/Nodejs/node_modules/bluebird/js/main/join.js
new file mode 100644
index 0000000..cf33eb1
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/join.js
@@ -0,0 +1,107 @@
+"use strict";
+module.exports =
+function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) {
+var util = require("./util.js");
+var canEvaluate = util.canEvaluate;
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+var reject;
+
+if (!false) {
+if (canEvaluate) {
+ var thenCallback = function(i) {
+ return new Function("value", "holder", " \n\
+ 'use strict'; \n\
+ holder.pIndex = value; \n\
+ holder.checkFulfillment(this); \n\
+ ".replace(/Index/g, i));
+ };
+
+ var caller = function(count) {
+ var values = [];
+ for (var i = 1; i <= count; ++i) values.push("holder.p" + i);
+ return new Function("holder", " \n\
+ 'use strict'; \n\
+ var callback = holder.fn; \n\
+ return callback(values); \n\
+ ".replace(/values/g, values.join(", ")));
+ };
+ var thenCallbacks = [];
+ var callers = [undefined];
+ for (var i = 1; i <= 5; ++i) {
+ thenCallbacks.push(thenCallback(i));
+ callers.push(caller(i));
+ }
+
+ var Holder = function(total, fn) {
+ this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null;
+ this.fn = fn;
+ this.total = total;
+ this.now = 0;
+ };
+
+ Holder.prototype.callers = callers;
+ Holder.prototype.checkFulfillment = function(promise) {
+ var now = this.now;
+ now++;
+ var total = this.total;
+ if (now >= total) {
+ var handler = this.callers[total];
+ promise._pushContext();
+ var ret = tryCatch(handler)(this);
+ promise._popContext();
+ if (ret === errorObj) {
+ promise._rejectCallback(ret.e, false, true);
+ } else {
+ promise._resolveCallback(ret);
+ }
+ } else {
+ this.now = now;
+ }
+ };
+
+ var reject = function (reason) {
+ this._reject(reason);
+ };
+}
+}
+
+Promise.join = function () {
+ var last = arguments.length - 1;
+ var fn;
+ if (last > 0 && typeof arguments[last] === "function") {
+ fn = arguments[last];
+ if (!false) {
+ if (last < 6 && canEvaluate) {
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ var holder = new Holder(last, fn);
+ var callbacks = thenCallbacks;
+ for (var i = 0; i < last; ++i) {
+ var maybePromise = tryConvertToPromise(arguments[i], ret);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ if (maybePromise._isPending()) {
+ maybePromise._then(callbacks[i], reject,
+ undefined, ret, holder);
+ } else if (maybePromise._isFulfilled()) {
+ callbacks[i].call(ret,
+ maybePromise._value(), holder);
+ } else {
+ ret._reject(maybePromise._reason());
+ }
+ } else {
+ callbacks[i].call(ret, maybePromise, holder);
+ }
+ }
+ return ret;
+ }
+ }
+ }
+ var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];}
+ if (fn) args.pop();
+ var ret = new PromiseArray(args).promise();
+ return fn !== undefined ? ret.spread(fn) : ret;
+};
+
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/map.js b/Nodejs/node_modules/bluebird/js/main/map.js
new file mode 100644
index 0000000..2f40efd
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/map.js
@@ -0,0 +1,133 @@
+"use strict";
+module.exports = function(Promise,
+ PromiseArray,
+ apiRejection,
+ tryConvertToPromise,
+ INTERNAL) {
+var getDomain = Promise._getDomain;
+var async = require("./async.js");
+var util = require("./util.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+var PENDING = {};
+var EMPTY_ARRAY = [];
+
+function MappingPromiseArray(promises, fn, limit, _filter) {
+ this.constructor$(promises);
+ this._promise._captureStackTrace();
+ var domain = getDomain();
+ this._callback = domain === null ? fn : domain.bind(fn);
+ this._preservedValues = _filter === INTERNAL
+ ? new Array(this.length())
+ : null;
+ this._limit = limit;
+ this._inFlight = 0;
+ this._queue = limit >= 1 ? [] : EMPTY_ARRAY;
+ async.invoke(init, this, undefined);
+}
+util.inherits(MappingPromiseArray, PromiseArray);
+function init() {this._init$(undefined, -2);}
+
+MappingPromiseArray.prototype._init = function () {};
+
+MappingPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ var values = this._values;
+ var length = this.length();
+ var preservedValues = this._preservedValues;
+ var limit = this._limit;
+ if (values[index] === PENDING) {
+ values[index] = value;
+ if (limit >= 1) {
+ this._inFlight--;
+ this._drainQueue();
+ if (this._isResolved()) return;
+ }
+ } else {
+ if (limit >= 1 && this._inFlight >= limit) {
+ values[index] = value;
+ this._queue.push(index);
+ return;
+ }
+ if (preservedValues !== null) preservedValues[index] = value;
+
+ var callback = this._callback;
+ var receiver = this._promise._boundValue();
+ this._promise._pushContext();
+ var ret = tryCatch(callback).call(receiver, value, index, length);
+ this._promise._popContext();
+ if (ret === errorObj) return this._reject(ret.e);
+
+ var maybePromise = tryConvertToPromise(ret, this._promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ if (maybePromise._isPending()) {
+ if (limit >= 1) this._inFlight++;
+ values[index] = PENDING;
+ return maybePromise._proxyPromiseArray(this, index);
+ } else if (maybePromise._isFulfilled()) {
+ ret = maybePromise._value();
+ } else {
+ return this._reject(maybePromise._reason());
+ }
+ }
+ values[index] = ret;
+ }
+ var totalResolved = ++this._totalResolved;
+ if (totalResolved >= length) {
+ if (preservedValues !== null) {
+ this._filter(values, preservedValues);
+ } else {
+ this._resolve(values);
+ }
+
+ }
+};
+
+MappingPromiseArray.prototype._drainQueue = function () {
+ var queue = this._queue;
+ var limit = this._limit;
+ var values = this._values;
+ while (queue.length > 0 && this._inFlight < limit) {
+ if (this._isResolved()) return;
+ var index = queue.pop();
+ this._promiseFulfilled(values[index], index);
+ }
+};
+
+MappingPromiseArray.prototype._filter = function (booleans, values) {
+ var len = values.length;
+ var ret = new Array(len);
+ var j = 0;
+ for (var i = 0; i < len; ++i) {
+ if (booleans[i]) ret[j++] = values[i];
+ }
+ ret.length = j;
+ this._resolve(ret);
+};
+
+MappingPromiseArray.prototype.preservedValues = function () {
+ return this._preservedValues;
+};
+
+function map(promises, fn, options, _filter) {
+ var limit = typeof options === "object" && options !== null
+ ? options.concurrency
+ : 0;
+ limit = typeof limit === "number" &&
+ isFinite(limit) && limit >= 1 ? limit : 0;
+ return new MappingPromiseArray(promises, fn, limit, _filter);
+}
+
+Promise.prototype.map = function (fn, options) {
+ if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+
+ return map(this, fn, options, null).promise();
+};
+
+Promise.map = function (promises, fn, options, _filter) {
+ if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ return map(promises, fn, options, _filter).promise();
+};
+
+
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/method.js b/Nodejs/node_modules/bluebird/js/main/method.js
new file mode 100644
index 0000000..3d3eeb1
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/method.js
@@ -0,0 +1,44 @@
+"use strict";
+module.exports =
+function(Promise, INTERNAL, tryConvertToPromise, apiRejection) {
+var util = require("./util.js");
+var tryCatch = util.tryCatch;
+
+Promise.method = function (fn) {
+ if (typeof fn !== "function") {
+ throw new Promise.TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ }
+ return function () {
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ ret._pushContext();
+ var value = tryCatch(fn).apply(this, arguments);
+ ret._popContext();
+ ret._resolveFromSyncValue(value);
+ return ret;
+ };
+};
+
+Promise.attempt = Promise["try"] = function (fn, args, ctx) {
+ if (typeof fn !== "function") {
+ return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ }
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ ret._pushContext();
+ var value = util.isArray(args)
+ ? tryCatch(fn).apply(ctx, args)
+ : tryCatch(fn).call(ctx, args);
+ ret._popContext();
+ ret._resolveFromSyncValue(value);
+ return ret;
+};
+
+Promise.prototype._resolveFromSyncValue = function (value) {
+ if (value === util.errorObj) {
+ this._rejectCallback(value.e, false, true);
+ } else {
+ this._resolveCallback(value, true);
+ }
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/nodeify.js b/Nodejs/node_modules/bluebird/js/main/nodeify.js
new file mode 100644
index 0000000..257565d
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/nodeify.js
@@ -0,0 +1,59 @@
+"use strict";
+module.exports = function(Promise) {
+var util = require("./util.js");
+var async = require("./async.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+
+function spreadAdapter(val, nodeback) {
+ var promise = this;
+ if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);
+ var ret =
+ tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));
+ if (ret === errorObj) {
+ async.throwLater(ret.e);
+ }
+}
+
+function successAdapter(val, nodeback) {
+ var promise = this;
+ var receiver = promise._boundValue();
+ var ret = val === undefined
+ ? tryCatch(nodeback).call(receiver, null)
+ : tryCatch(nodeback).call(receiver, null, val);
+ if (ret === errorObj) {
+ async.throwLater(ret.e);
+ }
+}
+function errorAdapter(reason, nodeback) {
+ var promise = this;
+ if (!reason) {
+ var target = promise._target();
+ var newReason = target._getCarriedStackTrace();
+ newReason.cause = reason;
+ reason = newReason;
+ }
+ var ret = tryCatch(nodeback).call(promise._boundValue(), reason);
+ if (ret === errorObj) {
+ async.throwLater(ret.e);
+ }
+}
+
+Promise.prototype.asCallback =
+Promise.prototype.nodeify = function (nodeback, options) {
+ if (typeof nodeback == "function") {
+ var adapter = successAdapter;
+ if (options !== undefined && Object(options).spread) {
+ adapter = spreadAdapter;
+ }
+ this._then(
+ adapter,
+ errorAdapter,
+ undefined,
+ this,
+ nodeback
+ );
+ }
+ return this;
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/progress.js b/Nodejs/node_modules/bluebird/js/main/progress.js
new file mode 100644
index 0000000..2e3e95e
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/progress.js
@@ -0,0 +1,76 @@
+"use strict";
+module.exports = function(Promise, PromiseArray) {
+var util = require("./util.js");
+var async = require("./async.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+
+Promise.prototype.progressed = function (handler) {
+ return this._then(undefined, undefined, handler, undefined, undefined);
+};
+
+Promise.prototype._progress = function (progressValue) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ this._target()._progressUnchecked(progressValue);
+
+};
+
+Promise.prototype._progressHandlerAt = function (index) {
+ return index === 0
+ ? this._progressHandler0
+ : this[(index << 2) + index - 5 + 2];
+};
+
+Promise.prototype._doProgressWith = function (progression) {
+ var progressValue = progression.value;
+ var handler = progression.handler;
+ var promise = progression.promise;
+ var receiver = progression.receiver;
+
+ var ret = tryCatch(handler).call(receiver, progressValue);
+ if (ret === errorObj) {
+ if (ret.e != null &&
+ ret.e.name !== "StopProgressPropagation") {
+ var trace = util.canAttachTrace(ret.e)
+ ? ret.e : new Error(util.toString(ret.e));
+ promise._attachExtraTrace(trace);
+ promise._progress(ret.e);
+ }
+ } else if (ret instanceof Promise) {
+ ret._then(promise._progress, null, null, promise, undefined);
+ } else {
+ promise._progress(ret);
+ }
+};
+
+
+Promise.prototype._progressUnchecked = function (progressValue) {
+ var len = this._length();
+ var progress = this._progress;
+ for (var i = 0; i < len; i++) {
+ var handler = this._progressHandlerAt(i);
+ var promise = this._promiseAt(i);
+ if (!(promise instanceof Promise)) {
+ var receiver = this._receiverAt(i);
+ if (typeof handler === "function") {
+ handler.call(receiver, progressValue, promise);
+ } else if (receiver instanceof PromiseArray &&
+ !receiver._isResolved()) {
+ receiver._promiseProgressed(progressValue, promise);
+ }
+ continue;
+ }
+
+ if (typeof handler === "function") {
+ async.invoke(this._doProgressWith, this, {
+ handler: handler,
+ promise: promise,
+ receiver: this._receiverAt(i),
+ value: progressValue
+ });
+ } else {
+ async.invoke(progress, promise, progressValue);
+ }
+ }
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/promise.js b/Nodejs/node_modules/bluebird/js/main/promise.js
new file mode 100644
index 0000000..820d0c7
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/promise.js
@@ -0,0 +1,759 @@
+"use strict";
+module.exports = function() {
+var makeSelfResolutionError = function () {
+ return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/LhFpo0\u000a");
+};
+var reflect = function() {
+ return new Promise.PromiseInspection(this._target());
+};
+var apiRejection = function(msg) {
+ return Promise.reject(new TypeError(msg));
+};
+
+var util = require("./util.js");
+
+var getDomain;
+if (util.isNode) {
+ getDomain = function() {
+ var ret = process.domain;
+ if (ret === undefined) ret = null;
+ return ret;
+ };
+} else {
+ getDomain = function() {
+ return null;
+ };
+}
+util.notEnumerableProp(Promise, "_getDomain", getDomain);
+
+var UNDEFINED_BINDING = {};
+var async = require("./async.js");
+var errors = require("./errors.js");
+var TypeError = Promise.TypeError = errors.TypeError;
+Promise.RangeError = errors.RangeError;
+Promise.CancellationError = errors.CancellationError;
+Promise.TimeoutError = errors.TimeoutError;
+Promise.OperationalError = errors.OperationalError;
+Promise.RejectionError = errors.OperationalError;
+Promise.AggregateError = errors.AggregateError;
+var INTERNAL = function(){};
+var APPLY = {};
+var NEXT_FILTER = {e: null};
+var tryConvertToPromise = require("./thenables.js")(Promise, INTERNAL);
+var PromiseArray =
+ require("./promise_array.js")(Promise, INTERNAL,
+ tryConvertToPromise, apiRejection);
+var CapturedTrace = require("./captured_trace.js")();
+var isDebugging = require("./debuggability.js")(Promise, CapturedTrace);
+ /*jshint unused:false*/
+var createContext =
+ require("./context.js")(Promise, CapturedTrace, isDebugging);
+var CatchFilter = require("./catch_filter.js")(NEXT_FILTER);
+var PromiseResolver = require("./promise_resolver.js");
+var nodebackForPromise = PromiseResolver._nodebackForPromise;
+var errorObj = util.errorObj;
+var tryCatch = util.tryCatch;
+
+function Promise(resolver) {
+ if (typeof resolver !== "function") {
+ throw new TypeError("the promise constructor requires a resolver function\u000a\u000a See http://goo.gl/EC22Yn\u000a");
+ }
+ if (this.constructor !== Promise) {
+ throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/KsIlge\u000a");
+ }
+ this._bitField = 0;
+ this._fulfillmentHandler0 = undefined;
+ this._rejectionHandler0 = undefined;
+ this._progressHandler0 = undefined;
+ this._promise0 = undefined;
+ this._receiver0 = undefined;
+ this._settledValue = undefined;
+ if (resolver !== INTERNAL) this._resolveFromResolver(resolver);
+}
+
+Promise.prototype.toString = function () {
+ return "[object Promise]";
+};
+
+Promise.prototype.caught = Promise.prototype["catch"] = function (fn) {
+ var len = arguments.length;
+ if (len > 1) {
+ var catchInstances = new Array(len - 1),
+ j = 0, i;
+ for (i = 0; i < len - 1; ++i) {
+ var item = arguments[i];
+ if (typeof item === "function") {
+ catchInstances[j++] = item;
+ } else {
+ return Promise.reject(
+ new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a"));
+ }
+ }
+ catchInstances.length = j;
+ fn = arguments[i];
+ var catchFilter = new CatchFilter(catchInstances, fn, this);
+ return this._then(undefined, catchFilter.doFilter, undefined,
+ catchFilter, undefined);
+ }
+ return this._then(undefined, fn, undefined, undefined, undefined);
+};
+
+Promise.prototype.reflect = function () {
+ return this._then(reflect, reflect, undefined, this, undefined);
+};
+
+Promise.prototype.then = function (didFulfill, didReject, didProgress) {
+ if (isDebugging() && arguments.length > 0 &&
+ typeof didFulfill !== "function" &&
+ typeof didReject !== "function") {
+ var msg = ".then() only accepts functions but was passed: " +
+ util.classString(didFulfill);
+ if (arguments.length > 1) {
+ msg += ", " + util.classString(didReject);
+ }
+ this._warn(msg);
+ }
+ return this._then(didFulfill, didReject, didProgress,
+ undefined, undefined);
+};
+
+Promise.prototype.done = function (didFulfill, didReject, didProgress) {
+ var promise = this._then(didFulfill, didReject, didProgress,
+ undefined, undefined);
+ promise._setIsFinal();
+};
+
+Promise.prototype.spread = function (didFulfill, didReject) {
+ return this.all()._then(didFulfill, didReject, undefined, APPLY, undefined);
+};
+
+Promise.prototype.isCancellable = function () {
+ return !this.isResolved() &&
+ this._cancellable();
+};
+
+Promise.prototype.toJSON = function () {
+ var ret = {
+ isFulfilled: false,
+ isRejected: false,
+ fulfillmentValue: undefined,
+ rejectionReason: undefined
+ };
+ if (this.isFulfilled()) {
+ ret.fulfillmentValue = this.value();
+ ret.isFulfilled = true;
+ } else if (this.isRejected()) {
+ ret.rejectionReason = this.reason();
+ ret.isRejected = true;
+ }
+ return ret;
+};
+
+Promise.prototype.all = function () {
+ return new PromiseArray(this).promise();
+};
+
+Promise.prototype.error = function (fn) {
+ return this.caught(util.originatesFromRejection, fn);
+};
+
+Promise.getNewLibraryCopy = module.exports;
+
+Promise.is = function (val) {
+ return val instanceof Promise;
+};
+
+Promise.fromNode = function(fn) {
+ var ret = new Promise(INTERNAL);
+ var result = tryCatch(fn)(nodebackForPromise(ret));
+ if (result === errorObj) {
+ ret._rejectCallback(result.e, true, true);
+ }
+ return ret;
+};
+
+Promise.all = function (promises) {
+ return new PromiseArray(promises).promise();
+};
+
+Promise.defer = Promise.pending = function () {
+ var promise = new Promise(INTERNAL);
+ return new PromiseResolver(promise);
+};
+
+Promise.cast = function (obj) {
+ var ret = tryConvertToPromise(obj);
+ if (!(ret instanceof Promise)) {
+ var val = ret;
+ ret = new Promise(INTERNAL);
+ ret._fulfillUnchecked(val);
+ }
+ return ret;
+};
+
+Promise.resolve = Promise.fulfilled = Promise.cast;
+
+Promise.reject = Promise.rejected = function (reason) {
+ var ret = new Promise(INTERNAL);
+ ret._captureStackTrace();
+ ret._rejectCallback(reason, true);
+ return ret;
+};
+
+Promise.setScheduler = function(fn) {
+ if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ var prev = async._schedule;
+ async._schedule = fn;
+ return prev;
+};
+
+Promise.prototype._then = function (
+ didFulfill,
+ didReject,
+ didProgress,
+ receiver,
+ internalData
+) {
+ var haveInternalData = internalData !== undefined;
+ var ret = haveInternalData ? internalData : new Promise(INTERNAL);
+
+ if (!haveInternalData) {
+ ret._propagateFrom(this, 4 | 1);
+ ret._captureStackTrace();
+ }
+
+ var target = this._target();
+ if (target !== this) {
+ if (receiver === undefined) receiver = this._boundTo;
+ if (!haveInternalData) ret._setIsMigrated();
+ }
+
+ var callbackIndex = target._addCallbacks(didFulfill,
+ didReject,
+ didProgress,
+ ret,
+ receiver,
+ getDomain());
+
+ if (target._isResolved() && !target._isSettlePromisesQueued()) {
+ async.invoke(
+ target._settlePromiseAtPostResolution, target, callbackIndex);
+ }
+
+ return ret;
+};
+
+Promise.prototype._settlePromiseAtPostResolution = function (index) {
+ if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled();
+ this._settlePromiseAt(index);
+};
+
+Promise.prototype._length = function () {
+ return this._bitField & 131071;
+};
+
+Promise.prototype._isFollowingOrFulfilledOrRejected = function () {
+ return (this._bitField & 939524096) > 0;
+};
+
+Promise.prototype._isFollowing = function () {
+ return (this._bitField & 536870912) === 536870912;
+};
+
+Promise.prototype._setLength = function (len) {
+ this._bitField = (this._bitField & -131072) |
+ (len & 131071);
+};
+
+Promise.prototype._setFulfilled = function () {
+ this._bitField = this._bitField | 268435456;
+};
+
+Promise.prototype._setRejected = function () {
+ this._bitField = this._bitField | 134217728;
+};
+
+Promise.prototype._setFollowing = function () {
+ this._bitField = this._bitField | 536870912;
+};
+
+Promise.prototype._setIsFinal = function () {
+ this._bitField = this._bitField | 33554432;
+};
+
+Promise.prototype._isFinal = function () {
+ return (this._bitField & 33554432) > 0;
+};
+
+Promise.prototype._cancellable = function () {
+ return (this._bitField & 67108864) > 0;
+};
+
+Promise.prototype._setCancellable = function () {
+ this._bitField = this._bitField | 67108864;
+};
+
+Promise.prototype._unsetCancellable = function () {
+ this._bitField = this._bitField & (~67108864);
+};
+
+Promise.prototype._setIsMigrated = function () {
+ this._bitField = this._bitField | 4194304;
+};
+
+Promise.prototype._unsetIsMigrated = function () {
+ this._bitField = this._bitField & (~4194304);
+};
+
+Promise.prototype._isMigrated = function () {
+ return (this._bitField & 4194304) > 0;
+};
+
+Promise.prototype._receiverAt = function (index) {
+ var ret = index === 0
+ ? this._receiver0
+ : this[
+ index * 5 - 5 + 4];
+ if (ret === UNDEFINED_BINDING) {
+ return undefined;
+ } else if (ret === undefined && this._isBound()) {
+ return this._boundValue();
+ }
+ return ret;
+};
+
+Promise.prototype._promiseAt = function (index) {
+ return index === 0
+ ? this._promise0
+ : this[index * 5 - 5 + 3];
+};
+
+Promise.prototype._fulfillmentHandlerAt = function (index) {
+ return index === 0
+ ? this._fulfillmentHandler0
+ : this[index * 5 - 5 + 0];
+};
+
+Promise.prototype._rejectionHandlerAt = function (index) {
+ return index === 0
+ ? this._rejectionHandler0
+ : this[index * 5 - 5 + 1];
+};
+
+Promise.prototype._boundValue = function() {
+ var ret = this._boundTo;
+ if (ret !== undefined) {
+ if (ret instanceof Promise) {
+ if (ret.isFulfilled()) {
+ return ret.value();
+ } else {
+ return undefined;
+ }
+ }
+ }
+ return ret;
+};
+
+Promise.prototype._migrateCallbacks = function (follower, index) {
+ var fulfill = follower._fulfillmentHandlerAt(index);
+ var reject = follower._rejectionHandlerAt(index);
+ var progress = follower._progressHandlerAt(index);
+ var promise = follower._promiseAt(index);
+ var receiver = follower._receiverAt(index);
+ if (promise instanceof Promise) promise._setIsMigrated();
+ if (receiver === undefined) receiver = UNDEFINED_BINDING;
+ this._addCallbacks(fulfill, reject, progress, promise, receiver, null);
+};
+
+Promise.prototype._addCallbacks = function (
+ fulfill,
+ reject,
+ progress,
+ promise,
+ receiver,
+ domain
+) {
+ var index = this._length();
+
+ if (index >= 131071 - 5) {
+ index = 0;
+ this._setLength(0);
+ }
+
+ if (index === 0) {
+ this._promise0 = promise;
+ if (receiver !== undefined) this._receiver0 = receiver;
+ if (typeof fulfill === "function" && !this._isCarryingStackTrace()) {
+ this._fulfillmentHandler0 =
+ domain === null ? fulfill : domain.bind(fulfill);
+ }
+ if (typeof reject === "function") {
+ this._rejectionHandler0 =
+ domain === null ? reject : domain.bind(reject);
+ }
+ if (typeof progress === "function") {
+ this._progressHandler0 =
+ domain === null ? progress : domain.bind(progress);
+ }
+ } else {
+ var base = index * 5 - 5;
+ this[base + 3] = promise;
+ this[base + 4] = receiver;
+ if (typeof fulfill === "function") {
+ this[base + 0] =
+ domain === null ? fulfill : domain.bind(fulfill);
+ }
+ if (typeof reject === "function") {
+ this[base + 1] =
+ domain === null ? reject : domain.bind(reject);
+ }
+ if (typeof progress === "function") {
+ this[base + 2] =
+ domain === null ? progress : domain.bind(progress);
+ }
+ }
+ this._setLength(index + 1);
+ return index;
+};
+
+Promise.prototype._setProxyHandlers = function (receiver, promiseSlotValue) {
+ var index = this._length();
+
+ if (index >= 131071 - 5) {
+ index = 0;
+ this._setLength(0);
+ }
+ if (index === 0) {
+ this._promise0 = promiseSlotValue;
+ this._receiver0 = receiver;
+ } else {
+ var base = index * 5 - 5;
+ this[base + 3] = promiseSlotValue;
+ this[base + 4] = receiver;
+ }
+ this._setLength(index + 1);
+};
+
+Promise.prototype._proxyPromiseArray = function (promiseArray, index) {
+ this._setProxyHandlers(promiseArray, index);
+};
+
+Promise.prototype._resolveCallback = function(value, shouldBind) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ if (value === this)
+ return this._rejectCallback(makeSelfResolutionError(), false, true);
+ var maybePromise = tryConvertToPromise(value, this);
+ if (!(maybePromise instanceof Promise)) return this._fulfill(value);
+
+ var propagationFlags = 1 | (shouldBind ? 4 : 0);
+ this._propagateFrom(maybePromise, propagationFlags);
+ var promise = maybePromise._target();
+ if (promise._isPending()) {
+ var len = this._length();
+ for (var i = 0; i < len; ++i) {
+ promise._migrateCallbacks(this, i);
+ }
+ this._setFollowing();
+ this._setLength(0);
+ this._setFollowee(promise);
+ } else if (promise._isFulfilled()) {
+ this._fulfillUnchecked(promise._value());
+ } else {
+ this._rejectUnchecked(promise._reason(),
+ promise._getCarriedStackTrace());
+ }
+};
+
+Promise.prototype._rejectCallback =
+function(reason, synchronous, shouldNotMarkOriginatingFromRejection) {
+ if (!shouldNotMarkOriginatingFromRejection) {
+ util.markAsOriginatingFromRejection(reason);
+ }
+ var trace = util.ensureErrorObject(reason);
+ var hasStack = trace === reason;
+ this._attachExtraTrace(trace, synchronous ? hasStack : false);
+ this._reject(reason, hasStack ? undefined : trace);
+};
+
+Promise.prototype._resolveFromResolver = function (resolver) {
+ var promise = this;
+ this._captureStackTrace();
+ this._pushContext();
+ var synchronous = true;
+ var r = tryCatch(resolver)(function(value) {
+ if (promise === null) return;
+ promise._resolveCallback(value);
+ promise = null;
+ }, function (reason) {
+ if (promise === null) return;
+ promise._rejectCallback(reason, synchronous);
+ promise = null;
+ });
+ synchronous = false;
+ this._popContext();
+
+ if (r !== undefined && r === errorObj && promise !== null) {
+ promise._rejectCallback(r.e, true, true);
+ promise = null;
+ }
+};
+
+Promise.prototype._settlePromiseFromHandler = function (
+ handler, receiver, value, promise
+) {
+ if (promise._isRejected()) return;
+ promise._pushContext();
+ var x;
+ if (receiver === APPLY && !this._isRejected()) {
+ x = tryCatch(handler).apply(this._boundValue(), value);
+ } else {
+ x = tryCatch(handler).call(receiver, value);
+ }
+ promise._popContext();
+
+ if (x === errorObj || x === promise || x === NEXT_FILTER) {
+ var err = x === promise ? makeSelfResolutionError() : x.e;
+ promise._rejectCallback(err, false, true);
+ } else {
+ promise._resolveCallback(x);
+ }
+};
+
+Promise.prototype._target = function() {
+ var ret = this;
+ while (ret._isFollowing()) ret = ret._followee();
+ return ret;
+};
+
+Promise.prototype._followee = function() {
+ return this._rejectionHandler0;
+};
+
+Promise.prototype._setFollowee = function(promise) {
+ this._rejectionHandler0 = promise;
+};
+
+Promise.prototype._cleanValues = function () {
+ if (this._cancellable()) {
+ this._cancellationParent = undefined;
+ }
+};
+
+Promise.prototype._propagateFrom = function (parent, flags) {
+ if ((flags & 1) > 0 && parent._cancellable()) {
+ this._setCancellable();
+ this._cancellationParent = parent;
+ }
+ if ((flags & 4) > 0 && parent._isBound()) {
+ this._setBoundTo(parent._boundTo);
+ }
+};
+
+Promise.prototype._fulfill = function (value) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ this._fulfillUnchecked(value);
+};
+
+Promise.prototype._reject = function (reason, carriedStackTrace) {
+ if (this._isFollowingOrFulfilledOrRejected()) return;
+ this._rejectUnchecked(reason, carriedStackTrace);
+};
+
+Promise.prototype._settlePromiseAt = function (index) {
+ var promise = this._promiseAt(index);
+ var isPromise = promise instanceof Promise;
+
+ if (isPromise && promise._isMigrated()) {
+ promise._unsetIsMigrated();
+ return async.invoke(this._settlePromiseAt, this, index);
+ }
+ var handler = this._isFulfilled()
+ ? this._fulfillmentHandlerAt(index)
+ : this._rejectionHandlerAt(index);
+
+ var carriedStackTrace =
+ this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined;
+ var value = this._settledValue;
+ var receiver = this._receiverAt(index);
+ this._clearCallbackDataAtIndex(index);
+
+ if (typeof handler === "function") {
+ if (!isPromise) {
+ handler.call(receiver, value, promise);
+ } else {
+ this._settlePromiseFromHandler(handler, receiver, value, promise);
+ }
+ } else if (receiver instanceof PromiseArray) {
+ if (!receiver._isResolved()) {
+ if (this._isFulfilled()) {
+ receiver._promiseFulfilled(value, promise);
+ }
+ else {
+ receiver._promiseRejected(value, promise);
+ }
+ }
+ } else if (isPromise) {
+ if (this._isFulfilled()) {
+ promise._fulfill(value);
+ } else {
+ promise._reject(value, carriedStackTrace);
+ }
+ }
+
+ if (index >= 4 && (index & 31) === 4)
+ async.invokeLater(this._setLength, this, 0);
+};
+
+Promise.prototype._clearCallbackDataAtIndex = function(index) {
+ if (index === 0) {
+ if (!this._isCarryingStackTrace()) {
+ this._fulfillmentHandler0 = undefined;
+ }
+ this._rejectionHandler0 =
+ this._progressHandler0 =
+ this._receiver0 =
+ this._promise0 = undefined;
+ } else {
+ var base = index * 5 - 5;
+ this[base + 3] =
+ this[base + 4] =
+ this[base + 0] =
+ this[base + 1] =
+ this[base + 2] = undefined;
+ }
+};
+
+Promise.prototype._isSettlePromisesQueued = function () {
+ return (this._bitField &
+ -1073741824) === -1073741824;
+};
+
+Promise.prototype._setSettlePromisesQueued = function () {
+ this._bitField = this._bitField | -1073741824;
+};
+
+Promise.prototype._unsetSettlePromisesQueued = function () {
+ this._bitField = this._bitField & (~-1073741824);
+};
+
+Promise.prototype._queueSettlePromises = function() {
+ async.settlePromises(this);
+ this._setSettlePromisesQueued();
+};
+
+Promise.prototype._fulfillUnchecked = function (value) {
+ if (value === this) {
+ var err = makeSelfResolutionError();
+ this._attachExtraTrace(err);
+ return this._rejectUnchecked(err, undefined);
+ }
+ this._setFulfilled();
+ this._settledValue = value;
+ this._cleanValues();
+
+ if (this._length() > 0) {
+ this._queueSettlePromises();
+ }
+};
+
+Promise.prototype._rejectUncheckedCheckError = function (reason) {
+ var trace = util.ensureErrorObject(reason);
+ this._rejectUnchecked(reason, trace === reason ? undefined : trace);
+};
+
+Promise.prototype._rejectUnchecked = function (reason, trace) {
+ if (reason === this) {
+ var err = makeSelfResolutionError();
+ this._attachExtraTrace(err);
+ return this._rejectUnchecked(err);
+ }
+ this._setRejected();
+ this._settledValue = reason;
+ this._cleanValues();
+
+ if (this._isFinal()) {
+ async.throwLater(function(e) {
+ if ("stack" in e) {
+ async.invokeFirst(
+ CapturedTrace.unhandledRejection, undefined, e);
+ }
+ throw e;
+ }, trace === undefined ? reason : trace);
+ return;
+ }
+
+ if (trace !== undefined && trace !== reason) {
+ this._setCarriedStackTrace(trace);
+ }
+
+ if (this._length() > 0) {
+ this._queueSettlePromises();
+ } else {
+ this._ensurePossibleRejectionHandled();
+ }
+};
+
+Promise.prototype._settlePromises = function () {
+ this._unsetSettlePromisesQueued();
+ var len = this._length();
+ for (var i = 0; i < len; i++) {
+ this._settlePromiseAt(i);
+ }
+};
+
+
+util.notEnumerableProp(Promise,
+ "_makeSelfResolutionError",
+ makeSelfResolutionError);
+
+require("./progress.js")(Promise, PromiseArray);
+require("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection);
+require("./bind.js")(Promise, INTERNAL, tryConvertToPromise);
+require("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise);
+require("./direct_resolve.js")(Promise);
+require("./synchronous_inspection.js")(Promise);
+require("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL);
+Promise.version = "2.11.0";
+Promise.Promise = Promise;
+require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL);
+require('./cancel.js')(Promise);
+require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext);
+require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise);
+require('./nodeify.js')(Promise);
+require('./call_get.js')(Promise);
+require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection);
+require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection);
+require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL);
+require('./settle.js')(Promise, PromiseArray);
+require('./some.js')(Promise, PromiseArray, apiRejection);
+require('./promisify.js')(Promise, INTERNAL);
+require('./any.js')(Promise);
+require('./each.js')(Promise, INTERNAL);
+require('./timers.js')(Promise, INTERNAL);
+require('./filter.js')(Promise, INTERNAL);
+
+ util.toFastProperties(Promise);
+ util.toFastProperties(Promise.prototype);
+ function fillTypes(value) {
+ var p = new Promise(INTERNAL);
+ p._fulfillmentHandler0 = value;
+ p._rejectionHandler0 = value;
+ p._progressHandler0 = value;
+ p._promise0 = value;
+ p._receiver0 = value;
+ p._settledValue = value;
+ }
+ // Complete slack tracking, opt out of field-type tracking and
+ // stabilize map
+ fillTypes({a: 1});
+ fillTypes({b: 2});
+ fillTypes({c: 3});
+ fillTypes(1);
+ fillTypes(function(){});
+ fillTypes(undefined);
+ fillTypes(false);
+ fillTypes(new Promise(INTERNAL));
+ CapturedTrace.setBounds(async.firstLineError, util.lastLineError);
+ return Promise;
+
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/promise_array.js b/Nodejs/node_modules/bluebird/js/main/promise_array.js
new file mode 100644
index 0000000..b2e8f1c
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/promise_array.js
@@ -0,0 +1,142 @@
+"use strict";
+module.exports = function(Promise, INTERNAL, tryConvertToPromise,
+ apiRejection) {
+var util = require("./util.js");
+var isArray = util.isArray;
+
+function toResolutionValue(val) {
+ switch(val) {
+ case -2: return [];
+ case -3: return {};
+ }
+}
+
+function PromiseArray(values) {
+ var promise = this._promise = new Promise(INTERNAL);
+ var parent;
+ if (values instanceof Promise) {
+ parent = values;
+ promise._propagateFrom(parent, 1 | 4);
+ }
+ this._values = values;
+ this._length = 0;
+ this._totalResolved = 0;
+ this._init(undefined, -2);
+}
+PromiseArray.prototype.length = function () {
+ return this._length;
+};
+
+PromiseArray.prototype.promise = function () {
+ return this._promise;
+};
+
+PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
+ var values = tryConvertToPromise(this._values, this._promise);
+ if (values instanceof Promise) {
+ values = values._target();
+ this._values = values;
+ if (values._isFulfilled()) {
+ values = values._value();
+ if (!isArray(values)) {
+ var err = new Promise.TypeError("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a");
+ this.__hardReject__(err);
+ return;
+ }
+ } else if (values._isPending()) {
+ values._then(
+ init,
+ this._reject,
+ undefined,
+ this,
+ resolveValueIfEmpty
+ );
+ return;
+ } else {
+ this._reject(values._reason());
+ return;
+ }
+ } else if (!isArray(values)) {
+ this._promise._reject(apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a")._reason());
+ return;
+ }
+
+ if (values.length === 0) {
+ if (resolveValueIfEmpty === -5) {
+ this._resolveEmptyArray();
+ }
+ else {
+ this._resolve(toResolutionValue(resolveValueIfEmpty));
+ }
+ return;
+ }
+ var len = this.getActualLength(values.length);
+ this._length = len;
+ this._values = this.shouldCopyValues() ? new Array(len) : this._values;
+ var promise = this._promise;
+ for (var i = 0; i < len; ++i) {
+ var isResolved = this._isResolved();
+ var maybePromise = tryConvertToPromise(values[i], promise);
+ if (maybePromise instanceof Promise) {
+ maybePromise = maybePromise._target();
+ if (isResolved) {
+ maybePromise._ignoreRejections();
+ } else if (maybePromise._isPending()) {
+ maybePromise._proxyPromiseArray(this, i);
+ } else if (maybePromise._isFulfilled()) {
+ this._promiseFulfilled(maybePromise._value(), i);
+ } else {
+ this._promiseRejected(maybePromise._reason(), i);
+ }
+ } else if (!isResolved) {
+ this._promiseFulfilled(maybePromise, i);
+ }
+ }
+};
+
+PromiseArray.prototype._isResolved = function () {
+ return this._values === null;
+};
+
+PromiseArray.prototype._resolve = function (value) {
+ this._values = null;
+ this._promise._fulfill(value);
+};
+
+PromiseArray.prototype.__hardReject__ =
+PromiseArray.prototype._reject = function (reason) {
+ this._values = null;
+ this._promise._rejectCallback(reason, false, true);
+};
+
+PromiseArray.prototype._promiseProgressed = function (progressValue, index) {
+ this._promise._progress({
+ index: index,
+ value: progressValue
+ });
+};
+
+
+PromiseArray.prototype._promiseFulfilled = function (value, index) {
+ this._values[index] = value;
+ var totalResolved = ++this._totalResolved;
+ if (totalResolved >= this._length) {
+ this._resolve(this._values);
+ }
+};
+
+PromiseArray.prototype._promiseRejected = function (reason, index) {
+ this._totalResolved++;
+ this._reject(reason);
+};
+
+PromiseArray.prototype.shouldCopyValues = function () {
+ return true;
+};
+
+PromiseArray.prototype.getActualLength = function (len) {
+ return len;
+};
+
+return PromiseArray;
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/promise_resolver.js b/Nodejs/node_modules/bluebird/js/main/promise_resolver.js
new file mode 100644
index 0000000..b180a32
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/promise_resolver.js
@@ -0,0 +1,123 @@
+"use strict";
+var util = require("./util.js");
+var maybeWrapAsError = util.maybeWrapAsError;
+var errors = require("./errors.js");
+var TimeoutError = errors.TimeoutError;
+var OperationalError = errors.OperationalError;
+var haveGetters = util.haveGetters;
+var es5 = require("./es5.js");
+
+function isUntypedError(obj) {
+ return obj instanceof Error &&
+ es5.getPrototypeOf(obj) === Error.prototype;
+}
+
+var rErrorKey = /^(?:name|message|stack|cause)$/;
+function wrapAsOperationalError(obj) {
+ var ret;
+ if (isUntypedError(obj)) {
+ ret = new OperationalError(obj);
+ ret.name = obj.name;
+ ret.message = obj.message;
+ ret.stack = obj.stack;
+ var keys = es5.keys(obj);
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ if (!rErrorKey.test(key)) {
+ ret[key] = obj[key];
+ }
+ }
+ return ret;
+ }
+ util.markAsOriginatingFromRejection(obj);
+ return obj;
+}
+
+function nodebackForPromise(promise) {
+ return function(err, value) {
+ if (promise === null) return;
+
+ if (err) {
+ var wrapped = wrapAsOperationalError(maybeWrapAsError(err));
+ promise._attachExtraTrace(wrapped);
+ promise._reject(wrapped);
+ } else if (arguments.length > 2) {
+ var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}
+ promise._fulfill(args);
+ } else {
+ promise._fulfill(value);
+ }
+
+ promise = null;
+ };
+}
+
+
+var PromiseResolver;
+if (!haveGetters) {
+ PromiseResolver = function (promise) {
+ this.promise = promise;
+ this.asCallback = nodebackForPromise(promise);
+ this.callback = this.asCallback;
+ };
+}
+else {
+ PromiseResolver = function (promise) {
+ this.promise = promise;
+ };
+}
+if (haveGetters) {
+ var prop = {
+ get: function() {
+ return nodebackForPromise(this.promise);
+ }
+ };
+ es5.defineProperty(PromiseResolver.prototype, "asCallback", prop);
+ es5.defineProperty(PromiseResolver.prototype, "callback", prop);
+}
+
+PromiseResolver._nodebackForPromise = nodebackForPromise;
+
+PromiseResolver.prototype.toString = function () {
+ return "[object PromiseResolver]";
+};
+
+PromiseResolver.prototype.resolve =
+PromiseResolver.prototype.fulfill = function (value) {
+ if (!(this instanceof PromiseResolver)) {
+ throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a");
+ }
+ this.promise._resolveCallback(value);
+};
+
+PromiseResolver.prototype.reject = function (reason) {
+ if (!(this instanceof PromiseResolver)) {
+ throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a");
+ }
+ this.promise._rejectCallback(reason);
+};
+
+PromiseResolver.prototype.progress = function (value) {
+ if (!(this instanceof PromiseResolver)) {
+ throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a");
+ }
+ this.promise._progress(value);
+};
+
+PromiseResolver.prototype.cancel = function (err) {
+ this.promise.cancel(err);
+};
+
+PromiseResolver.prototype.timeout = function () {
+ this.reject(new TimeoutError("timeout"));
+};
+
+PromiseResolver.prototype.isResolved = function () {
+ return this.promise.isResolved();
+};
+
+PromiseResolver.prototype.toJSON = function () {
+ return this.promise.toJSON();
+};
+
+module.exports = PromiseResolver;
diff --git a/Nodejs/node_modules/bluebird/js/main/promisify.js b/Nodejs/node_modules/bluebird/js/main/promisify.js
new file mode 100644
index 0000000..86763d6
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/promisify.js
@@ -0,0 +1,307 @@
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var THIS = {};
+var util = require("./util.js");
+var nodebackForPromise = require("./promise_resolver.js")
+ ._nodebackForPromise;
+var withAppended = util.withAppended;
+var maybeWrapAsError = util.maybeWrapAsError;
+var canEvaluate = util.canEvaluate;
+var TypeError = require("./errors").TypeError;
+var defaultSuffix = "Async";
+var defaultPromisified = {__isPromisified__: true};
+var noCopyProps = [
+ "arity", "length",
+ "name",
+ "arguments",
+ "caller",
+ "callee",
+ "prototype",
+ "__isPromisified__"
+];
+var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");
+
+var defaultFilter = function(name) {
+ return util.isIdentifier(name) &&
+ name.charAt(0) !== "_" &&
+ name !== "constructor";
+};
+
+function propsFilter(key) {
+ return !noCopyPropsPattern.test(key);
+}
+
+function isPromisified(fn) {
+ try {
+ return fn.__isPromisified__ === true;
+ }
+ catch (e) {
+ return false;
+ }
+}
+
+function hasPromisified(obj, key, suffix) {
+ var val = util.getDataPropertyOrDefault(obj, key + suffix,
+ defaultPromisified);
+ return val ? isPromisified(val) : false;
+}
+function checkValid(ret, suffix, suffixRegexp) {
+ for (var i = 0; i < ret.length; i += 2) {
+ var key = ret[i];
+ if (suffixRegexp.test(key)) {
+ var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");
+ for (var j = 0; j < ret.length; j += 2) {
+ if (ret[j] === keyWithoutAsyncSuffix) {
+ throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/iWrZbw\u000a"
+ .replace("%s", suffix));
+ }
+ }
+ }
+ }
+}
+
+function promisifiableMethods(obj, suffix, suffixRegexp, filter) {
+ var keys = util.inheritedDataKeys(obj);
+ var ret = [];
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ var value = obj[key];
+ var passesDefaultFilter = filter === defaultFilter
+ ? true : defaultFilter(key, value, obj);
+ if (typeof value === "function" &&
+ !isPromisified(value) &&
+ !hasPromisified(obj, key, suffix) &&
+ filter(key, value, obj, passesDefaultFilter)) {
+ ret.push(key, value);
+ }
+ }
+ checkValid(ret, suffix, suffixRegexp);
+ return ret;
+}
+
+var escapeIdentRegex = function(str) {
+ return str.replace(/([$])/, "\\$");
+};
+
+var makeNodePromisifiedEval;
+if (!false) {
+var switchCaseArgumentOrder = function(likelyArgumentCount) {
+ var ret = [likelyArgumentCount];
+ var min = Math.max(0, likelyArgumentCount - 1 - 3);
+ for(var i = likelyArgumentCount - 1; i >= min; --i) {
+ ret.push(i);
+ }
+ for(var i = likelyArgumentCount + 1; i <= 3; ++i) {
+ ret.push(i);
+ }
+ return ret;
+};
+
+var argumentSequence = function(argumentCount) {
+ return util.filledRange(argumentCount, "_arg", "");
+};
+
+var parameterDeclaration = function(parameterCount) {
+ return util.filledRange(
+ Math.max(parameterCount, 3), "_arg", "");
+};
+
+var parameterCount = function(fn) {
+ if (typeof fn.length === "number") {
+ return Math.max(Math.min(fn.length, 1023 + 1), 0);
+ }
+ return 0;
+};
+
+makeNodePromisifiedEval =
+function(callback, receiver, originalName, fn) {
+ var newParameterCount = Math.max(0, parameterCount(fn) - 1);
+ var argumentOrder = switchCaseArgumentOrder(newParameterCount);
+ var shouldProxyThis = typeof callback === "string" || receiver === THIS;
+
+ function generateCallForArgumentCount(count) {
+ var args = argumentSequence(count).join(", ");
+ var comma = count > 0 ? ", " : "";
+ var ret;
+ if (shouldProxyThis) {
+ ret = "ret = callback.call(this, {{args}}, nodeback); break;\n";
+ } else {
+ ret = receiver === undefined
+ ? "ret = callback({{args}}, nodeback); break;\n"
+ : "ret = callback.call(receiver, {{args}}, nodeback); break;\n";
+ }
+ return ret.replace("{{args}}", args).replace(", ", comma);
+ }
+
+ function generateArgumentSwitchCase() {
+ var ret = "";
+ for (var i = 0; i < argumentOrder.length; ++i) {
+ ret += "case " + argumentOrder[i] +":" +
+ generateCallForArgumentCount(argumentOrder[i]);
+ }
+
+ ret += " \n\
+ default: \n\
+ var args = new Array(len + 1); \n\
+ var i = 0; \n\
+ for (var i = 0; i < len; ++i) { \n\
+ args[i] = arguments[i]; \n\
+ } \n\
+ args[i] = nodeback; \n\
+ [CodeForCall] \n\
+ break; \n\
+ ".replace("[CodeForCall]", (shouldProxyThis
+ ? "ret = callback.apply(this, args);\n"
+ : "ret = callback.apply(receiver, args);\n"));
+ return ret;
+ }
+
+ var getFunctionCode = typeof callback === "string"
+ ? ("this != null ? this['"+callback+"'] : fn")
+ : "fn";
+
+ return new Function("Promise",
+ "fn",
+ "receiver",
+ "withAppended",
+ "maybeWrapAsError",
+ "nodebackForPromise",
+ "tryCatch",
+ "errorObj",
+ "notEnumerableProp",
+ "INTERNAL","'use strict'; \n\
+ var ret = function (Parameters) { \n\
+ 'use strict'; \n\
+ var len = arguments.length; \n\
+ var promise = new Promise(INTERNAL); \n\
+ promise._captureStackTrace(); \n\
+ var nodeback = nodebackForPromise(promise); \n\
+ var ret; \n\
+ var callback = tryCatch([GetFunctionCode]); \n\
+ switch(len) { \n\
+ [CodeForSwitchCase] \n\
+ } \n\
+ if (ret === errorObj) { \n\
+ promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\
+ } \n\
+ return promise; \n\
+ }; \n\
+ notEnumerableProp(ret, '__isPromisified__', true); \n\
+ return ret; \n\
+ "
+ .replace("Parameters", parameterDeclaration(newParameterCount))
+ .replace("[CodeForSwitchCase]", generateArgumentSwitchCase())
+ .replace("[GetFunctionCode]", getFunctionCode))(
+ Promise,
+ fn,
+ receiver,
+ withAppended,
+ maybeWrapAsError,
+ nodebackForPromise,
+ util.tryCatch,
+ util.errorObj,
+ util.notEnumerableProp,
+ INTERNAL
+ );
+};
+}
+
+function makeNodePromisifiedClosure(callback, receiver, _, fn) {
+ var defaultThis = (function() {return this;})();
+ var method = callback;
+ if (typeof method === "string") {
+ callback = fn;
+ }
+ function promisified() {
+ var _receiver = receiver;
+ if (receiver === THIS) _receiver = this;
+ var promise = new Promise(INTERNAL);
+ promise._captureStackTrace();
+ var cb = typeof method === "string" && this !== defaultThis
+ ? this[method] : callback;
+ var fn = nodebackForPromise(promise);
+ try {
+ cb.apply(_receiver, withAppended(arguments, fn));
+ } catch(e) {
+ promise._rejectCallback(maybeWrapAsError(e), true, true);
+ }
+ return promise;
+ }
+ util.notEnumerableProp(promisified, "__isPromisified__", true);
+ return promisified;
+}
+
+var makeNodePromisified = canEvaluate
+ ? makeNodePromisifiedEval
+ : makeNodePromisifiedClosure;
+
+function promisifyAll(obj, suffix, filter, promisifier) {
+ var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");
+ var methods =
+ promisifiableMethods(obj, suffix, suffixRegexp, filter);
+
+ for (var i = 0, len = methods.length; i < len; i+= 2) {
+ var key = methods[i];
+ var fn = methods[i+1];
+ var promisifiedKey = key + suffix;
+ if (promisifier === makeNodePromisified) {
+ obj[promisifiedKey] =
+ makeNodePromisified(key, THIS, key, fn, suffix);
+ } else {
+ var promisified = promisifier(fn, function() {
+ return makeNodePromisified(key, THIS, key, fn, suffix);
+ });
+ util.notEnumerableProp(promisified, "__isPromisified__", true);
+ obj[promisifiedKey] = promisified;
+ }
+ }
+ util.toFastProperties(obj);
+ return obj;
+}
+
+function promisify(callback, receiver) {
+ return makeNodePromisified(callback, receiver, undefined, callback);
+}
+
+Promise.promisify = function (fn, receiver) {
+ if (typeof fn !== "function") {
+ throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+ }
+ if (isPromisified(fn)) {
+ return fn;
+ }
+ var ret = promisify(fn, arguments.length < 2 ? THIS : receiver);
+ util.copyDescriptors(fn, ret, propsFilter);
+ return ret;
+};
+
+Promise.promisifyAll = function (target, options) {
+ if (typeof target !== "function" && typeof target !== "object") {
+ throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/9ITlV0\u000a");
+ }
+ options = Object(options);
+ var suffix = options.suffix;
+ if (typeof suffix !== "string") suffix = defaultSuffix;
+ var filter = options.filter;
+ if (typeof filter !== "function") filter = defaultFilter;
+ var promisifier = options.promisifier;
+ if (typeof promisifier !== "function") promisifier = makeNodePromisified;
+
+ if (!util.isIdentifier(suffix)) {
+ throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/8FZo5V\u000a");
+ }
+
+ var keys = util.inheritedDataKeys(target);
+ for (var i = 0; i < keys.length; ++i) {
+ var value = target[keys[i]];
+ if (keys[i] !== "constructor" &&
+ util.isClass(value)) {
+ promisifyAll(value.prototype, suffix, filter, promisifier);
+ promisifyAll(value, suffix, filter, promisifier);
+ }
+ }
+
+ return promisifyAll(target, suffix, filter, promisifier);
+};
+};
+
diff --git a/Nodejs/node_modules/bluebird/js/main/props.js b/Nodejs/node_modules/bluebird/js/main/props.js
new file mode 100644
index 0000000..d6f9e64
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/props.js
@@ -0,0 +1,79 @@
+"use strict";
+module.exports = function(
+ Promise, PromiseArray, tryConvertToPromise, apiRejection) {
+var util = require("./util.js");
+var isObject = util.isObject;
+var es5 = require("./es5.js");
+
+function PropertiesPromiseArray(obj) {
+ var keys = es5.keys(obj);
+ var len = keys.length;
+ var values = new Array(len * 2);
+ for (var i = 0; i < len; ++i) {
+ var key = keys[i];
+ values[i] = obj[key];
+ values[i + len] = key;
+ }
+ this.constructor$(values);
+}
+util.inherits(PropertiesPromiseArray, PromiseArray);
+
+PropertiesPromiseArray.prototype._init = function () {
+ this._init$(undefined, -3) ;
+};
+
+PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ this._values[index] = value;
+ var totalResolved = ++this._totalResolved;
+ if (totalResolved >= this._length) {
+ var val = {};
+ var keyOffset = this.length();
+ for (var i = 0, len = this.length(); i < len; ++i) {
+ val[this._values[i + keyOffset]] = this._values[i];
+ }
+ this._resolve(val);
+ }
+};
+
+PropertiesPromiseArray.prototype._promiseProgressed = function (value, index) {
+ this._promise._progress({
+ key: this._values[index + this.length()],
+ value: value
+ });
+};
+
+PropertiesPromiseArray.prototype.shouldCopyValues = function () {
+ return false;
+};
+
+PropertiesPromiseArray.prototype.getActualLength = function (len) {
+ return len >> 1;
+};
+
+function props(promises) {
+ var ret;
+ var castValue = tryConvertToPromise(promises);
+
+ if (!isObject(castValue)) {
+ return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/OsFKC8\u000a");
+ } else if (castValue instanceof Promise) {
+ ret = castValue._then(
+ Promise.props, undefined, undefined, undefined, undefined);
+ } else {
+ ret = new PropertiesPromiseArray(castValue).promise();
+ }
+
+ if (castValue instanceof Promise) {
+ ret._propagateFrom(castValue, 4);
+ }
+ return ret;
+}
+
+Promise.prototype.props = function () {
+ return props(this);
+};
+
+Promise.props = function (promises) {
+ return props(promises);
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/queue.js b/Nodejs/node_modules/bluebird/js/main/queue.js
new file mode 100644
index 0000000..84d57d5
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/queue.js
@@ -0,0 +1,90 @@
+"use strict";
+function arrayMove(src, srcIndex, dst, dstIndex, len) {
+ for (var j = 0; j < len; ++j) {
+ dst[j + dstIndex] = src[j + srcIndex];
+ src[j + srcIndex] = void 0;
+ }
+}
+
+function Queue(capacity) {
+ this._capacity = capacity;
+ this._length = 0;
+ this._front = 0;
+}
+
+Queue.prototype._willBeOverCapacity = function (size) {
+ return this._capacity < size;
+};
+
+Queue.prototype._pushOne = function (arg) {
+ var length = this.length();
+ this._checkCapacity(length + 1);
+ var i = (this._front + length) & (this._capacity - 1);
+ this[i] = arg;
+ this._length = length + 1;
+};
+
+Queue.prototype._unshiftOne = function(value) {
+ var capacity = this._capacity;
+ this._checkCapacity(this.length() + 1);
+ var front = this._front;
+ var i = (((( front - 1 ) &
+ ( capacity - 1) ) ^ capacity ) - capacity );
+ this[i] = value;
+ this._front = i;
+ this._length = this.length() + 1;
+};
+
+Queue.prototype.unshift = function(fn, receiver, arg) {
+ this._unshiftOne(arg);
+ this._unshiftOne(receiver);
+ this._unshiftOne(fn);
+};
+
+Queue.prototype.push = function (fn, receiver, arg) {
+ var length = this.length() + 3;
+ if (this._willBeOverCapacity(length)) {
+ this._pushOne(fn);
+ this._pushOne(receiver);
+ this._pushOne(arg);
+ return;
+ }
+ var j = this._front + length - 3;
+ this._checkCapacity(length);
+ var wrapMask = this._capacity - 1;
+ this[(j + 0) & wrapMask] = fn;
+ this[(j + 1) & wrapMask] = receiver;
+ this[(j + 2) & wrapMask] = arg;
+ this._length = length;
+};
+
+Queue.prototype.shift = function () {
+ var front = this._front,
+ ret = this[front];
+
+ this[front] = undefined;
+ this._front = (front + 1) & (this._capacity - 1);
+ this._length--;
+ return ret;
+};
+
+Queue.prototype.length = function () {
+ return this._length;
+};
+
+Queue.prototype._checkCapacity = function (size) {
+ if (this._capacity < size) {
+ this._resizeTo(this._capacity << 1);
+ }
+};
+
+Queue.prototype._resizeTo = function (capacity) {
+ var oldCapacity = this._capacity;
+ this._capacity = capacity;
+ var front = this._front;
+ var length = this._length;
+ var moveItemsCount = (front + length) & (oldCapacity - 1);
+ arrayMove(this, 0, this, oldCapacity, moveItemsCount);
+};
+
+module.exports = Queue;
diff --git a/Nodejs/node_modules/bluebird/js/main/race.js b/Nodejs/node_modules/bluebird/js/main/race.js
new file mode 100644
index 0000000..30e7bb0
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/race.js
@@ -0,0 +1,47 @@
+"use strict";
+module.exports = function(
+ Promise, INTERNAL, tryConvertToPromise, apiRejection) {
+var isArray = require("./util.js").isArray;
+
+var raceLater = function (promise) {
+ return promise.then(function(array) {
+ return race(array, promise);
+ });
+};
+
+function race(promises, parent) {
+ var maybePromise = tryConvertToPromise(promises);
+
+ if (maybePromise instanceof Promise) {
+ return raceLater(maybePromise);
+ } else if (!isArray(promises)) {
+ return apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a");
+ }
+
+ var ret = new Promise(INTERNAL);
+ if (parent !== undefined) {
+ ret._propagateFrom(parent, 4 | 1);
+ }
+ var fulfill = ret._fulfill;
+ var reject = ret._reject;
+ for (var i = 0, len = promises.length; i < len; ++i) {
+ var val = promises[i];
+
+ if (val === undefined && !(i in promises)) {
+ continue;
+ }
+
+ Promise.cast(val)._then(fulfill, reject, undefined, ret, null);
+ }
+ return ret;
+}
+
+Promise.race = function (promises) {
+ return race(promises, undefined);
+};
+
+Promise.prototype.race = function () {
+ return race(this, undefined);
+};
+
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/reduce.js b/Nodejs/node_modules/bluebird/js/main/reduce.js
new file mode 100644
index 0000000..1f92daf
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/reduce.js
@@ -0,0 +1,148 @@
+"use strict";
+module.exports = function(Promise,
+ PromiseArray,
+ apiRejection,
+ tryConvertToPromise,
+ INTERNAL) {
+var getDomain = Promise._getDomain;
+var async = require("./async.js");
+var util = require("./util.js");
+var tryCatch = util.tryCatch;
+var errorObj = util.errorObj;
+function ReductionPromiseArray(promises, fn, accum, _each) {
+ this.constructor$(promises);
+ this._promise._captureStackTrace();
+ this._preservedValues = _each === INTERNAL ? [] : null;
+ this._zerothIsAccum = (accum === undefined);
+ this._gotAccum = false;
+ this._reducingIndex = (this._zerothIsAccum ? 1 : 0);
+ this._valuesPhase = undefined;
+ var maybePromise = tryConvertToPromise(accum, this._promise);
+ var rejected = false;
+ var isPromise = maybePromise instanceof Promise;
+ if (isPromise) {
+ maybePromise = maybePromise._target();
+ if (maybePromise._isPending()) {
+ maybePromise._proxyPromiseArray(this, -1);
+ } else if (maybePromise._isFulfilled()) {
+ accum = maybePromise._value();
+ this._gotAccum = true;
+ } else {
+ this._reject(maybePromise._reason());
+ rejected = true;
+ }
+ }
+ if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true;
+ var domain = getDomain();
+ this._callback = domain === null ? fn : domain.bind(fn);
+ this._accum = accum;
+ if (!rejected) async.invoke(init, this, undefined);
+}
+function init() {
+ this._init$(undefined, -5);
+}
+util.inherits(ReductionPromiseArray, PromiseArray);
+
+ReductionPromiseArray.prototype._init = function () {};
+
+ReductionPromiseArray.prototype._resolveEmptyArray = function () {
+ if (this._gotAccum || this._zerothIsAccum) {
+ this._resolve(this._preservedValues !== null
+ ? [] : this._accum);
+ }
+};
+
+ReductionPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ var values = this._values;
+ values[index] = value;
+ var length = this.length();
+ var preservedValues = this._preservedValues;
+ var isEach = preservedValues !== null;
+ var gotAccum = this._gotAccum;
+ var valuesPhase = this._valuesPhase;
+ var valuesPhaseIndex;
+ if (!valuesPhase) {
+ valuesPhase = this._valuesPhase = new Array(length);
+ for (valuesPhaseIndex=0; valuesPhaseIndex= this._length) {
+ this._resolve(this._values);
+ }
+};
+
+SettledPromiseArray.prototype._promiseFulfilled = function (value, index) {
+ var ret = new PromiseInspection();
+ ret._bitField = 268435456;
+ ret._settledValue = value;
+ this._promiseResolved(index, ret);
+};
+SettledPromiseArray.prototype._promiseRejected = function (reason, index) {
+ var ret = new PromiseInspection();
+ ret._bitField = 134217728;
+ ret._settledValue = reason;
+ this._promiseResolved(index, ret);
+};
+
+Promise.settle = function (promises) {
+ return new SettledPromiseArray(promises).promise();
+};
+
+Promise.prototype.settle = function () {
+ return new SettledPromiseArray(this).promise();
+};
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/some.js b/Nodejs/node_modules/bluebird/js/main/some.js
new file mode 100644
index 0000000..f3968cf
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/some.js
@@ -0,0 +1,125 @@
+"use strict";
+module.exports =
+function(Promise, PromiseArray, apiRejection) {
+var util = require("./util.js");
+var RangeError = require("./errors.js").RangeError;
+var AggregateError = require("./errors.js").AggregateError;
+var isArray = util.isArray;
+
+
+function SomePromiseArray(values) {
+ this.constructor$(values);
+ this._howMany = 0;
+ this._unwrap = false;
+ this._initialized = false;
+}
+util.inherits(SomePromiseArray, PromiseArray);
+
+SomePromiseArray.prototype._init = function () {
+ if (!this._initialized) {
+ return;
+ }
+ if (this._howMany === 0) {
+ this._resolve([]);
+ return;
+ }
+ this._init$(undefined, -5);
+ var isArrayResolved = isArray(this._values);
+ if (!this._isResolved() &&
+ isArrayResolved &&
+ this._howMany > this._canPossiblyFulfill()) {
+ this._reject(this._getRangeError(this.length()));
+ }
+};
+
+SomePromiseArray.prototype.init = function () {
+ this._initialized = true;
+ this._init();
+};
+
+SomePromiseArray.prototype.setUnwrap = function () {
+ this._unwrap = true;
+};
+
+SomePromiseArray.prototype.howMany = function () {
+ return this._howMany;
+};
+
+SomePromiseArray.prototype.setHowMany = function (count) {
+ this._howMany = count;
+};
+
+SomePromiseArray.prototype._promiseFulfilled = function (value) {
+ this._addFulfilled(value);
+ if (this._fulfilled() === this.howMany()) {
+ this._values.length = this.howMany();
+ if (this.howMany() === 1 && this._unwrap) {
+ this._resolve(this._values[0]);
+ } else {
+ this._resolve(this._values);
+ }
+ }
+
+};
+SomePromiseArray.prototype._promiseRejected = function (reason) {
+ this._addRejected(reason);
+ if (this.howMany() > this._canPossiblyFulfill()) {
+ var e = new AggregateError();
+ for (var i = this.length(); i < this._values.length; ++i) {
+ e.push(this._values[i]);
+ }
+ this._reject(e);
+ }
+};
+
+SomePromiseArray.prototype._fulfilled = function () {
+ return this._totalResolved;
+};
+
+SomePromiseArray.prototype._rejected = function () {
+ return this._values.length - this.length();
+};
+
+SomePromiseArray.prototype._addRejected = function (reason) {
+ this._values.push(reason);
+};
+
+SomePromiseArray.prototype._addFulfilled = function (value) {
+ this._values[this._totalResolved++] = value;
+};
+
+SomePromiseArray.prototype._canPossiblyFulfill = function () {
+ return this.length() - this._rejected();
+};
+
+SomePromiseArray.prototype._getRangeError = function (count) {
+ var message = "Input array must contain at least " +
+ this._howMany + " items but contains only " + count + " items";
+ return new RangeError(message);
+};
+
+SomePromiseArray.prototype._resolveEmptyArray = function () {
+ this._reject(this._getRangeError(0));
+};
+
+function some(promises, howMany) {
+ if ((howMany | 0) !== howMany || howMany < 0) {
+ return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/1wAmHx\u000a");
+ }
+ var ret = new SomePromiseArray(promises);
+ var promise = ret.promise();
+ ret.setHowMany(howMany);
+ ret.init();
+ return promise;
+}
+
+Promise.some = function (promises, howMany) {
+ return some(promises, howMany);
+};
+
+Promise.prototype.some = function (howMany) {
+ return some(this, howMany);
+};
+
+Promise._SomePromiseArray = SomePromiseArray;
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/synchronous_inspection.js b/Nodejs/node_modules/bluebird/js/main/synchronous_inspection.js
new file mode 100644
index 0000000..7aac149
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/synchronous_inspection.js
@@ -0,0 +1,94 @@
+"use strict";
+module.exports = function(Promise) {
+function PromiseInspection(promise) {
+ if (promise !== undefined) {
+ promise = promise._target();
+ this._bitField = promise._bitField;
+ this._settledValue = promise._settledValue;
+ }
+ else {
+ this._bitField = 0;
+ this._settledValue = undefined;
+ }
+}
+
+PromiseInspection.prototype.value = function () {
+ if (!this.isFulfilled()) {
+ throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a");
+ }
+ return this._settledValue;
+};
+
+PromiseInspection.prototype.error =
+PromiseInspection.prototype.reason = function () {
+ if (!this.isRejected()) {
+ throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a");
+ }
+ return this._settledValue;
+};
+
+PromiseInspection.prototype.isFulfilled =
+Promise.prototype._isFulfilled = function () {
+ return (this._bitField & 268435456) > 0;
+};
+
+PromiseInspection.prototype.isRejected =
+Promise.prototype._isRejected = function () {
+ return (this._bitField & 134217728) > 0;
+};
+
+PromiseInspection.prototype.isPending =
+Promise.prototype._isPending = function () {
+ return (this._bitField & 402653184) === 0;
+};
+
+PromiseInspection.prototype.isResolved =
+Promise.prototype._isResolved = function () {
+ return (this._bitField & 402653184) > 0;
+};
+
+Promise.prototype.isPending = function() {
+ return this._target()._isPending();
+};
+
+Promise.prototype.isRejected = function() {
+ return this._target()._isRejected();
+};
+
+Promise.prototype.isFulfilled = function() {
+ return this._target()._isFulfilled();
+};
+
+Promise.prototype.isResolved = function() {
+ return this._target()._isResolved();
+};
+
+Promise.prototype._value = function() {
+ return this._settledValue;
+};
+
+Promise.prototype._reason = function() {
+ this._unsetRejectionIsUnhandled();
+ return this._settledValue;
+};
+
+Promise.prototype.value = function() {
+ var target = this._target();
+ if (!target.isFulfilled()) {
+ throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a");
+ }
+ return target._settledValue;
+};
+
+Promise.prototype.reason = function() {
+ var target = this._target();
+ if (!target.isRejected()) {
+ throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a");
+ }
+ target._unsetRejectionIsUnhandled();
+ return target._settledValue;
+};
+
+
+Promise.PromiseInspection = PromiseInspection;
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/thenables.js b/Nodejs/node_modules/bluebird/js/main/thenables.js
new file mode 100644
index 0000000..eadfffb
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/thenables.js
@@ -0,0 +1,84 @@
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var util = require("./util.js");
+var errorObj = util.errorObj;
+var isObject = util.isObject;
+
+function tryConvertToPromise(obj, context) {
+ if (isObject(obj)) {
+ if (obj instanceof Promise) {
+ return obj;
+ }
+ else if (isAnyBluebirdPromise(obj)) {
+ var ret = new Promise(INTERNAL);
+ obj._then(
+ ret._fulfillUnchecked,
+ ret._rejectUncheckedCheckError,
+ ret._progressUnchecked,
+ ret,
+ null
+ );
+ return ret;
+ }
+ var then = util.tryCatch(getThen)(obj);
+ if (then === errorObj) {
+ if (context) context._pushContext();
+ var ret = Promise.reject(then.e);
+ if (context) context._popContext();
+ return ret;
+ } else if (typeof then === "function") {
+ return doThenable(obj, then, context);
+ }
+ }
+ return obj;
+}
+
+function getThen(obj) {
+ return obj.then;
+}
+
+var hasProp = {}.hasOwnProperty;
+function isAnyBluebirdPromise(obj) {
+ return hasProp.call(obj, "_promise0");
+}
+
+function doThenable(x, then, context) {
+ var promise = new Promise(INTERNAL);
+ var ret = promise;
+ if (context) context._pushContext();
+ promise._captureStackTrace();
+ if (context) context._popContext();
+ var synchronous = true;
+ var result = util.tryCatch(then).call(x,
+ resolveFromThenable,
+ rejectFromThenable,
+ progressFromThenable);
+ synchronous = false;
+ if (promise && result === errorObj) {
+ promise._rejectCallback(result.e, true, true);
+ promise = null;
+ }
+
+ function resolveFromThenable(value) {
+ if (!promise) return;
+ promise._resolveCallback(value);
+ promise = null;
+ }
+
+ function rejectFromThenable(reason) {
+ if (!promise) return;
+ promise._rejectCallback(reason, synchronous, true);
+ promise = null;
+ }
+
+ function progressFromThenable(value) {
+ if (!promise) return;
+ if (typeof promise._progress === "function") {
+ promise._progress(value);
+ }
+ }
+ return ret;
+}
+
+return tryConvertToPromise;
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/timers.js b/Nodejs/node_modules/bluebird/js/main/timers.js
new file mode 100644
index 0000000..f26431a
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/timers.js
@@ -0,0 +1,64 @@
+"use strict";
+module.exports = function(Promise, INTERNAL) {
+var util = require("./util.js");
+var TimeoutError = Promise.TimeoutError;
+
+var afterTimeout = function (promise, message) {
+ if (!promise.isPending()) return;
+
+ var err;
+ if(!util.isPrimitive(message) && (message instanceof Error)) {
+ err = message;
+ } else {
+ if (typeof message !== "string") {
+ message = "operation timed out";
+ }
+ err = new TimeoutError(message);
+ }
+ util.markAsOriginatingFromRejection(err);
+ promise._attachExtraTrace(err);
+ promise._cancel(err);
+};
+
+var afterValue = function(value) { return delay(+this).thenReturn(value); };
+var delay = Promise.delay = function (value, ms) {
+ if (ms === undefined) {
+ ms = value;
+ value = undefined;
+ var ret = new Promise(INTERNAL);
+ setTimeout(function() { ret._fulfill(); }, ms);
+ return ret;
+ }
+ ms = +ms;
+ return Promise.resolve(value)._then(afterValue, null, null, ms, undefined);
+};
+
+Promise.prototype.delay = function (ms) {
+ return delay(this, ms);
+};
+
+function successClear(value) {
+ var handle = this;
+ if (handle instanceof Number) handle = +handle;
+ clearTimeout(handle);
+ return value;
+}
+
+function failureClear(reason) {
+ var handle = this;
+ if (handle instanceof Number) handle = +handle;
+ clearTimeout(handle);
+ throw reason;
+}
+
+Promise.prototype.timeout = function (ms, message) {
+ ms = +ms;
+ var ret = this.then().cancellable();
+ ret._cancellationParent = this;
+ var handle = setTimeout(function timeoutTimeout() {
+ afterTimeout(ret, message);
+ }, ms);
+ return ret._then(successClear, failureClear, undefined, handle, undefined);
+};
+
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/using.js b/Nodejs/node_modules/bluebird/js/main/using.js
new file mode 100644
index 0000000..957182d
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/using.js
@@ -0,0 +1,213 @@
+"use strict";
+module.exports = function (Promise, apiRejection, tryConvertToPromise,
+ createContext) {
+ var TypeError = require("./errors.js").TypeError;
+ var inherits = require("./util.js").inherits;
+ var PromiseInspection = Promise.PromiseInspection;
+
+ function inspectionMapper(inspections) {
+ var len = inspections.length;
+ for (var i = 0; i < len; ++i) {
+ var inspection = inspections[i];
+ if (inspection.isRejected()) {
+ return Promise.reject(inspection.error());
+ }
+ inspections[i] = inspection._settledValue;
+ }
+ return inspections;
+ }
+
+ function thrower(e) {
+ setTimeout(function(){throw e;}, 0);
+ }
+
+ function castPreservingDisposable(thenable) {
+ var maybePromise = tryConvertToPromise(thenable);
+ if (maybePromise !== thenable &&
+ typeof thenable._isDisposable === "function" &&
+ typeof thenable._getDisposer === "function" &&
+ thenable._isDisposable()) {
+ maybePromise._setDisposable(thenable._getDisposer());
+ }
+ return maybePromise;
+ }
+ function dispose(resources, inspection) {
+ var i = 0;
+ var len = resources.length;
+ var ret = Promise.defer();
+ function iterator() {
+ if (i >= len) return ret.resolve();
+ var maybePromise = castPreservingDisposable(resources[i++]);
+ if (maybePromise instanceof Promise &&
+ maybePromise._isDisposable()) {
+ try {
+ maybePromise = tryConvertToPromise(
+ maybePromise._getDisposer().tryDispose(inspection),
+ resources.promise);
+ } catch (e) {
+ return thrower(e);
+ }
+ if (maybePromise instanceof Promise) {
+ return maybePromise._then(iterator, thrower,
+ null, null, null);
+ }
+ }
+ iterator();
+ }
+ iterator();
+ return ret.promise;
+ }
+
+ function disposerSuccess(value) {
+ var inspection = new PromiseInspection();
+ inspection._settledValue = value;
+ inspection._bitField = 268435456;
+ return dispose(this, inspection).thenReturn(value);
+ }
+
+ function disposerFail(reason) {
+ var inspection = new PromiseInspection();
+ inspection._settledValue = reason;
+ inspection._bitField = 134217728;
+ return dispose(this, inspection).thenThrow(reason);
+ }
+
+ function Disposer(data, promise, context) {
+ this._data = data;
+ this._promise = promise;
+ this._context = context;
+ }
+
+ Disposer.prototype.data = function () {
+ return this._data;
+ };
+
+ Disposer.prototype.promise = function () {
+ return this._promise;
+ };
+
+ Disposer.prototype.resource = function () {
+ if (this.promise().isFulfilled()) {
+ return this.promise().value();
+ }
+ return null;
+ };
+
+ Disposer.prototype.tryDispose = function(inspection) {
+ var resource = this.resource();
+ var context = this._context;
+ if (context !== undefined) context._pushContext();
+ var ret = resource !== null
+ ? this.doDispose(resource, inspection) : null;
+ if (context !== undefined) context._popContext();
+ this._promise._unsetDisposable();
+ this._data = null;
+ return ret;
+ };
+
+ Disposer.isDisposer = function (d) {
+ return (d != null &&
+ typeof d.resource === "function" &&
+ typeof d.tryDispose === "function");
+ };
+
+ function FunctionDisposer(fn, promise, context) {
+ this.constructor$(fn, promise, context);
+ }
+ inherits(FunctionDisposer, Disposer);
+
+ FunctionDisposer.prototype.doDispose = function (resource, inspection) {
+ var fn = this.data();
+ return fn.call(resource, resource, inspection);
+ };
+
+ function maybeUnwrapDisposer(value) {
+ if (Disposer.isDisposer(value)) {
+ this.resources[this.index]._setDisposable(value);
+ return value.promise();
+ }
+ return value;
+ }
+
+ Promise.using = function () {
+ var len = arguments.length;
+ if (len < 2) return apiRejection(
+ "you must pass at least 2 arguments to Promise.using");
+ var fn = arguments[len - 1];
+ if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
+
+ var input;
+ var spreadArgs = true;
+ if (len === 2 && Array.isArray(arguments[0])) {
+ input = arguments[0];
+ len = input.length;
+ spreadArgs = false;
+ } else {
+ input = arguments;
+ len--;
+ }
+ var resources = new Array(len);
+ for (var i = 0; i < len; ++i) {
+ var resource = input[i];
+ if (Disposer.isDisposer(resource)) {
+ var disposer = resource;
+ resource = resource.promise();
+ resource._setDisposable(disposer);
+ } else {
+ var maybePromise = tryConvertToPromise(resource);
+ if (maybePromise instanceof Promise) {
+ resource =
+ maybePromise._then(maybeUnwrapDisposer, null, null, {
+ resources: resources,
+ index: i
+ }, undefined);
+ }
+ }
+ resources[i] = resource;
+ }
+
+ var promise = Promise.settle(resources)
+ .then(inspectionMapper)
+ .then(function(vals) {
+ promise._pushContext();
+ var ret;
+ try {
+ ret = spreadArgs
+ ? fn.apply(undefined, vals) : fn.call(undefined, vals);
+ } finally {
+ promise._popContext();
+ }
+ return ret;
+ })
+ ._then(
+ disposerSuccess, disposerFail, undefined, resources, undefined);
+ resources.promise = promise;
+ return promise;
+ };
+
+ Promise.prototype._setDisposable = function (disposer) {
+ this._bitField = this._bitField | 262144;
+ this._disposer = disposer;
+ };
+
+ Promise.prototype._isDisposable = function () {
+ return (this._bitField & 262144) > 0;
+ };
+
+ Promise.prototype._getDisposer = function () {
+ return this._disposer;
+ };
+
+ Promise.prototype._unsetDisposable = function () {
+ this._bitField = this._bitField & (~262144);
+ this._disposer = undefined;
+ };
+
+ Promise.prototype.disposer = function (fn) {
+ if (typeof fn === "function") {
+ return new FunctionDisposer(fn, this, createContext());
+ }
+ throw new TypeError();
+ };
+
+};
diff --git a/Nodejs/node_modules/bluebird/js/main/util.js b/Nodejs/node_modules/bluebird/js/main/util.js
new file mode 100644
index 0000000..ea39344
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/js/main/util.js
@@ -0,0 +1,321 @@
+"use strict";
+var es5 = require("./es5.js");
+var canEvaluate = typeof navigator == "undefined";
+var haveGetters = (function(){
+ try {
+ var o = {};
+ es5.defineProperty(o, "f", {
+ get: function () {
+ return 3;
+ }
+ });
+ return o.f === 3;
+ }
+ catch (e) {
+ return false;
+ }
+
+})();
+
+var errorObj = {e: {}};
+var tryCatchTarget;
+function tryCatcher() {
+ try {
+ var target = tryCatchTarget;
+ tryCatchTarget = null;
+ return target.apply(this, arguments);
+ } catch (e) {
+ errorObj.e = e;
+ return errorObj;
+ }
+}
+function tryCatch(fn) {
+ tryCatchTarget = fn;
+ return tryCatcher;
+}
+
+var inherits = function(Child, Parent) {
+ var hasProp = {}.hasOwnProperty;
+
+ function T() {
+ this.constructor = Child;
+ this.constructor$ = Parent;
+ for (var propertyName in Parent.prototype) {
+ if (hasProp.call(Parent.prototype, propertyName) &&
+ propertyName.charAt(propertyName.length-1) !== "$"
+ ) {
+ this[propertyName + "$"] = Parent.prototype[propertyName];
+ }
+ }
+ }
+ T.prototype = Parent.prototype;
+ Child.prototype = new T();
+ return Child.prototype;
+};
+
+
+function isPrimitive(val) {
+ return val == null || val === true || val === false ||
+ typeof val === "string" || typeof val === "number";
+
+}
+
+function isObject(value) {
+ return !isPrimitive(value);
+}
+
+function maybeWrapAsError(maybeError) {
+ if (!isPrimitive(maybeError)) return maybeError;
+
+ return new Error(safeToString(maybeError));
+}
+
+function withAppended(target, appendee) {
+ var len = target.length;
+ var ret = new Array(len + 1);
+ var i;
+ for (i = 0; i < len; ++i) {
+ ret[i] = target[i];
+ }
+ ret[i] = appendee;
+ return ret;
+}
+
+function getDataPropertyOrDefault(obj, key, defaultValue) {
+ if (es5.isES5) {
+ var desc = Object.getOwnPropertyDescriptor(obj, key);
+
+ if (desc != null) {
+ return desc.get == null && desc.set == null
+ ? desc.value
+ : defaultValue;
+ }
+ } else {
+ return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;
+ }
+}
+
+function notEnumerableProp(obj, name, value) {
+ if (isPrimitive(obj)) return obj;
+ var descriptor = {
+ value: value,
+ configurable: true,
+ enumerable: false,
+ writable: true
+ };
+ es5.defineProperty(obj, name, descriptor);
+ return obj;
+}
+
+function thrower(r) {
+ throw r;
+}
+
+var inheritedDataKeys = (function() {
+ var excludedPrototypes = [
+ Array.prototype,
+ Object.prototype,
+ Function.prototype
+ ];
+
+ var isExcludedProto = function(val) {
+ for (var i = 0; i < excludedPrototypes.length; ++i) {
+ if (excludedPrototypes[i] === val) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ if (es5.isES5) {
+ var getKeys = Object.getOwnPropertyNames;
+ return function(obj) {
+ var ret = [];
+ var visitedKeys = Object.create(null);
+ while (obj != null && !isExcludedProto(obj)) {
+ var keys;
+ try {
+ keys = getKeys(obj);
+ } catch (e) {
+ return ret;
+ }
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ if (visitedKeys[key]) continue;
+ visitedKeys[key] = true;
+ var desc = Object.getOwnPropertyDescriptor(obj, key);
+ if (desc != null && desc.get == null && desc.set == null) {
+ ret.push(key);
+ }
+ }
+ obj = es5.getPrototypeOf(obj);
+ }
+ return ret;
+ };
+ } else {
+ var hasProp = {}.hasOwnProperty;
+ return function(obj) {
+ if (isExcludedProto(obj)) return [];
+ var ret = [];
+
+ /*jshint forin:false */
+ enumeration: for (var key in obj) {
+ if (hasProp.call(obj, key)) {
+ ret.push(key);
+ } else {
+ for (var i = 0; i < excludedPrototypes.length; ++i) {
+ if (hasProp.call(excludedPrototypes[i], key)) {
+ continue enumeration;
+ }
+ }
+ ret.push(key);
+ }
+ }
+ return ret;
+ };
+ }
+
+})();
+
+var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/;
+function isClass(fn) {
+ try {
+ if (typeof fn === "function") {
+ var keys = es5.names(fn.prototype);
+
+ var hasMethods = es5.isES5 && keys.length > 1;
+ var hasMethodsOtherThanConstructor = keys.length > 0 &&
+ !(keys.length === 1 && keys[0] === "constructor");
+ var hasThisAssignmentAndStaticMethods =
+ thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;
+
+ if (hasMethods || hasMethodsOtherThanConstructor ||
+ hasThisAssignmentAndStaticMethods) {
+ return true;
+ }
+ }
+ return false;
+ } catch (e) {
+ return false;
+ }
+}
+
+function toFastProperties(obj) {
+ /*jshint -W027,-W055,-W031*/
+ function f() {}
+ f.prototype = obj;
+ var l = 8;
+ while (l--) new f();
+ return obj;
+ eval(obj);
+}
+
+var rident = /^[a-z$_][a-z$_0-9]*$/i;
+function isIdentifier(str) {
+ return rident.test(str);
+}
+
+function filledRange(count, prefix, suffix) {
+ var ret = new Array(count);
+ for(var i = 0; i < count; ++i) {
+ ret[i] = prefix + i + suffix;
+ }
+ return ret;
+}
+
+function safeToString(obj) {
+ try {
+ return obj + "";
+ } catch (e) {
+ return "[no string representation]";
+ }
+}
+
+function markAsOriginatingFromRejection(e) {
+ try {
+ notEnumerableProp(e, "isOperational", true);
+ }
+ catch(ignore) {}
+}
+
+function originatesFromRejection(e) {
+ if (e == null) return false;
+ return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) ||
+ e["isOperational"] === true);
+}
+
+function canAttachTrace(obj) {
+ return obj instanceof Error && es5.propertyIsWritable(obj, "stack");
+}
+
+var ensureErrorObject = (function() {
+ if (!("stack" in new Error())) {
+ return function(value) {
+ if (canAttachTrace(value)) return value;
+ try {throw new Error(safeToString(value));}
+ catch(err) {return err;}
+ };
+ } else {
+ return function(value) {
+ if (canAttachTrace(value)) return value;
+ return new Error(safeToString(value));
+ };
+ }
+})();
+
+function classString(obj) {
+ return {}.toString.call(obj);
+}
+
+function copyDescriptors(from, to, filter) {
+ var keys = es5.names(from);
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ if (filter(key)) {
+ try {
+ es5.defineProperty(to, key, es5.getDescriptor(from, key));
+ } catch (ignore) {}
+ }
+ }
+}
+
+var ret = {
+ isClass: isClass,
+ isIdentifier: isIdentifier,
+ inheritedDataKeys: inheritedDataKeys,
+ getDataPropertyOrDefault: getDataPropertyOrDefault,
+ thrower: thrower,
+ isArray: es5.isArray,
+ haveGetters: haveGetters,
+ notEnumerableProp: notEnumerableProp,
+ isPrimitive: isPrimitive,
+ isObject: isObject,
+ canEvaluate: canEvaluate,
+ errorObj: errorObj,
+ tryCatch: tryCatch,
+ inherits: inherits,
+ withAppended: withAppended,
+ maybeWrapAsError: maybeWrapAsError,
+ toFastProperties: toFastProperties,
+ filledRange: filledRange,
+ toString: safeToString,
+ canAttachTrace: canAttachTrace,
+ ensureErrorObject: ensureErrorObject,
+ originatesFromRejection: originatesFromRejection,
+ markAsOriginatingFromRejection: markAsOriginatingFromRejection,
+ classString: classString,
+ copyDescriptors: copyDescriptors,
+ hasDevTools: typeof chrome !== "undefined" && chrome &&
+ typeof chrome.loadTimes === "function",
+ isNode: typeof process !== "undefined" &&
+ classString(process).toLowerCase() === "[object process]"
+};
+ret.isRecentNode = ret.isNode && (function() {
+ var version = process.versions.node.split(".").map(Number);
+ return (version[0] === 0 && version[1] > 10) || (version[0] > 0);
+})();
+
+if (ret.isNode) ret.toFastProperties(process);
+
+try {throw new Error(); } catch (e) {ret.lastLineError = e;}
+module.exports = ret;
diff --git a/Nodejs/node_modules/bluebird/package.json b/Nodejs/node_modules/bluebird/package.json
new file mode 100644
index 0000000..6f78663
--- /dev/null
+++ b/Nodejs/node_modules/bluebird/package.json
@@ -0,0 +1,103 @@
+{
+ "_from": "bluebird@^2.9.27",
+ "_id": "bluebird@2.11.0",
+ "_inBundle": false,
+ "_integrity": "sha1-U0uQM8AiyVecVro7Plpcqvu2UOE=",
+ "_location": "/bluebird",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "bluebird@^2.9.27",
+ "name": "bluebird",
+ "escapedName": "bluebird",
+ "rawSpec": "^2.9.27",
+ "saveSpec": null,
+ "fetchSpec": "^2.9.27"
+ },
+ "_requiredBy": [
+ "/facebook-chat-api"
+ ],
+ "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.11.0.tgz",
+ "_shasum": "534b9033c022c9579c56ba3b3e5a5caafbb650e1",
+ "_spec": "bluebird@^2.9.27",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/facebook-chat-api",
+ "author": {
+ "name": "Petka Antonov",
+ "email": "petka_antonov@hotmail.com",
+ "url": "http://github.com/petkaantonov/"
+ },
+ "browser": "./js/browser/bluebird.js",
+ "bugs": {
+ "url": "http://github.com/petkaantonov/bluebird/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Full featured Promises/A+ implementation with exceptionally good performance",
+ "devDependencies": {
+ "acorn": "~0.6.0",
+ "baconjs": "^0.7.43",
+ "bluebird": "^2.9.2",
+ "body-parser": "^1.10.2",
+ "browserify": "^8.1.1",
+ "cli-table": "~0.3.1",
+ "co": "^4.2.0",
+ "cross-spawn": "^0.2.3",
+ "glob": "^4.3.2",
+ "grunt-saucelabs": "~8.4.1",
+ "highland": "^2.3.0",
+ "istanbul": "^0.3.5",
+ "jshint": "^2.6.0",
+ "jshint-stylish": "~0.2.0",
+ "kefir": "^2.4.1",
+ "mkdirp": "~0.5.0",
+ "mocha": "~2.1",
+ "open": "~0.0.5",
+ "optimist": "~0.6.1",
+ "rimraf": "~2.2.6",
+ "rx": "^2.3.25",
+ "serve-static": "^1.7.1",
+ "sinon": "~1.7.3",
+ "uglify-js": "~2.4.16"
+ },
+ "files": [
+ "js/browser",
+ "js/main",
+ "js/zalgo",
+ "zalgo.js"
+ ],
+ "homepage": "https://github.com/petkaantonov/bluebird",
+ "keywords": [
+ "promise",
+ "performance",
+ "promises",
+ "promises-a",
+ "promises-aplus",
+ "async",
+ "await",
+ "deferred",
+ "deferreds",
+ "future",
+ "flow control",
+ "dsl",
+ "fluent interface",
+ "parallel",
+ "thread",
+ "concurrency"
+ ],
+ "license": "MIT",
+ "main": "./js/main/bluebird.js",
+ "name": "bluebird",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/petkaantonov/bluebird.git"
+ },
+ "scripts": {
+ "generate-browser-core": "node tools/build.js --features=core --no-debug --main --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js",
+ "istanbul": "istanbul",
+ "lint": "node scripts/jshint.js",
+ "prepublish": "node tools/build.js --no-debug --main --zalgo --browser --minify",
+ "test": "node tools/test.js"
+ },
+ "version": "2.11.0"
+}
diff --git a/Nodejs/node_modules/boolbase/README.md b/Nodejs/node_modules/boolbase/README.md
new file mode 100644
index 0000000..85eefa5
--- /dev/null
+++ b/Nodejs/node_modules/boolbase/README.md
@@ -0,0 +1,10 @@
+#boolbase
+This very simple module provides two basic functions, one that always returns true (`trueFunc`) and one that always returns false (`falseFunc`).
+
+###WTF?
+
+By having only a single instance of these functions around, it's possible to do some nice optimizations. Eg. [`CSSselect`](https://github.com/fb55/CSSselect) uses these functions to determine whether a selector won't match any elements. If that's the case, the DOM doesn't even have to be touched.
+
+###And why is this a separate module?
+
+I'm trying to modularize `CSSselect` and most modules depend on these functions. IMHO, having a separate module is the easiest solution to this problem.
\ No newline at end of file
diff --git a/Nodejs/node_modules/boolbase/index.js b/Nodejs/node_modules/boolbase/index.js
new file mode 100644
index 0000000..8799fd9
--- /dev/null
+++ b/Nodejs/node_modules/boolbase/index.js
@@ -0,0 +1,8 @@
+module.exports = {
+ trueFunc: function trueFunc(){
+ return true;
+ },
+ falseFunc: function falseFunc(){
+ return false;
+ }
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/boolbase/package.json b/Nodejs/node_modules/boolbase/package.json
new file mode 100644
index 0000000..1158938
--- /dev/null
+++ b/Nodejs/node_modules/boolbase/package.json
@@ -0,0 +1,52 @@
+{
+ "_from": "boolbase@~1.0.0",
+ "_id": "boolbase@1.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=",
+ "_location": "/boolbase",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "boolbase@~1.0.0",
+ "name": "boolbase",
+ "escapedName": "boolbase",
+ "rawSpec": "~1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "~1.0.0"
+ },
+ "_requiredBy": [
+ "/css-select",
+ "/nth-check"
+ ],
+ "_resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
+ "_shasum": "68dff5fbe60c51eb37725ea9e3ed310dcc1e776e",
+ "_spec": "boolbase@~1.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/css-select",
+ "author": {
+ "name": "Felix Boehm",
+ "email": "me@feedic.com"
+ },
+ "bugs": {
+ "url": "https://github.com/fb55/boolbase/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "two functions: One that returns true, one that returns false",
+ "homepage": "https://github.com/fb55/boolbase",
+ "keywords": [
+ "boolean",
+ "function"
+ ],
+ "license": "ISC",
+ "main": "index.js",
+ "name": "boolbase",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/fb55/boolbase.git"
+ },
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "version": "1.0.0"
+}
diff --git a/Nodejs/node_modules/brace-expansion/LICENSE b/Nodejs/node_modules/brace-expansion/LICENSE
new file mode 100644
index 0000000..de32266
--- /dev/null
+++ b/Nodejs/node_modules/brace-expansion/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2013 Julian Gruber
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Nodejs/node_modules/brace-expansion/README.md b/Nodejs/node_modules/brace-expansion/README.md
new file mode 100644
index 0000000..6b4e0e1
--- /dev/null
+++ b/Nodejs/node_modules/brace-expansion/README.md
@@ -0,0 +1,129 @@
+# brace-expansion
+
+[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
+as known from sh/bash, in JavaScript.
+
+[](http://travis-ci.org/juliangruber/brace-expansion)
+[](https://www.npmjs.org/package/brace-expansion)
+[](https://greenkeeper.io/)
+
+[](https://ci.testling.com/juliangruber/brace-expansion)
+
+## Example
+
+```js
+var expand = require('brace-expansion');
+
+expand('file-{a,b,c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('-v{,,}')
+// => ['-v', '-v', '-v']
+
+expand('file{0..2}.jpg')
+// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
+
+expand('file-{a..c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('file{2..0}.jpg')
+// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
+
+expand('file{0..4..2}.jpg')
+// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
+
+expand('file-{a..e..2}.jpg')
+// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
+
+expand('file{00..10..5}.jpg')
+// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
+
+expand('{{A..C},{a..c}}')
+// => ['A', 'B', 'C', 'a', 'b', 'c']
+
+expand('ppp{,config,oe{,conf}}')
+// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
+```
+
+## API
+
+```js
+var expand = require('brace-expansion');
+```
+
+### var expanded = expand(str)
+
+Return an array of all possible and valid expansions of `str`. If none are
+found, `[str]` is returned.
+
+Valid expansions are:
+
+```js
+/^(.*,)+(.+)?$/
+// {a,b,...}
+```
+
+A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+A numeric sequence from `x` to `y` inclusive, with optional increment.
+If `x` or `y` start with a leading `0`, all the numbers will be padded
+to have equal length. Negative numbers and backwards iteration work too.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+An alphabetic sequence from `x` to `y` inclusive, with optional increment.
+`x` and `y` must be exactly one character, and if given, `incr` must be a
+number.
+
+For compatibility reasons, the string `${` is not eligible for brace expansion.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install brace-expansion
+```
+
+## Contributors
+
+- [Julian Gruber](https://github.com/juliangruber)
+- [Isaac Z. Schlueter](https://github.com/isaacs)
+
+## Sponsors
+
+This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
+
+Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Nodejs/node_modules/brace-expansion/index.js b/Nodejs/node_modules/brace-expansion/index.js
new file mode 100644
index 0000000..0478be8
--- /dev/null
+++ b/Nodejs/node_modules/brace-expansion/index.js
@@ -0,0 +1,201 @@
+var concatMap = require('concat-map');
+var balanced = require('balanced-match');
+
+module.exports = expandTop;
+
+var escSlash = '\0SLASH'+Math.random()+'\0';
+var escOpen = '\0OPEN'+Math.random()+'\0';
+var escClose = '\0CLOSE'+Math.random()+'\0';
+var escComma = '\0COMMA'+Math.random()+'\0';
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
+
+function numeric(str) {
+ return parseInt(str, 10) == str
+ ? parseInt(str, 10)
+ : str.charCodeAt(0);
+}
+
+function escapeBraces(str) {
+ return str.split('\\\\').join(escSlash)
+ .split('\\{').join(escOpen)
+ .split('\\}').join(escClose)
+ .split('\\,').join(escComma)
+ .split('\\.').join(escPeriod);
+}
+
+function unescapeBraces(str) {
+ return str.split(escSlash).join('\\')
+ .split(escOpen).join('{')
+ .split(escClose).join('}')
+ .split(escComma).join(',')
+ .split(escPeriod).join('.');
+}
+
+
+// Basically just str.split(","), but handling cases
+// where we have nested braced sections, which should be
+// treated as individual members, like {a,{b,c},d}
+function parseCommaParts(str) {
+ if (!str)
+ return [''];
+
+ var parts = [];
+ var m = balanced('{', '}', str);
+
+ if (!m)
+ return str.split(',');
+
+ var pre = m.pre;
+ var body = m.body;
+ var post = m.post;
+ var p = pre.split(',');
+
+ p[p.length-1] += '{' + body + '}';
+ var postParts = parseCommaParts(post);
+ if (post.length) {
+ p[p.length-1] += postParts.shift();
+ p.push.apply(p, postParts);
+ }
+
+ parts.push.apply(parts, p);
+
+ return parts;
+}
+
+function expandTop(str) {
+ if (!str)
+ return [];
+
+ // I don't know why Bash 4.3 does this, but it does.
+ // Anything starting with {} will have the first two bytes preserved
+ // but *only* at the top level, so {},a}b will not expand to anything,
+ // but a{},b}c will be expanded to [a}c,abc].
+ // One could argue that this is a bug in Bash, but since the goal of
+ // this module is to match Bash's rules, we escape a leading {}
+ if (str.substr(0, 2) === '{}') {
+ str = '\\{\\}' + str.substr(2);
+ }
+
+ return expand(escapeBraces(str), true).map(unescapeBraces);
+}
+
+function identity(e) {
+ return e;
+}
+
+function embrace(str) {
+ return '{' + str + '}';
+}
+function isPadded(el) {
+ return /^-?0\d/.test(el);
+}
+
+function lte(i, y) {
+ return i <= y;
+}
+function gte(i, y) {
+ return i >= y;
+}
+
+function expand(str, isTop) {
+ var expansions = [];
+
+ var m = balanced('{', '}', str);
+ if (!m || /\$$/.test(m.pre)) return [str];
+
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+ var isSequence = isNumericSequence || isAlphaSequence;
+ var isOptions = m.body.indexOf(',') >= 0;
+ if (!isSequence && !isOptions) {
+ // {a},b}
+ if (m.post.match(/,.*\}/)) {
+ str = m.pre + '{' + m.body + escClose + m.post;
+ return expand(str);
+ }
+ return [str];
+ }
+
+ var n;
+ if (isSequence) {
+ n = m.body.split(/\.\./);
+ } else {
+ n = parseCommaParts(m.body);
+ if (n.length === 1) {
+ // x{{a,b}}y ==> x{a}y x{b}y
+ n = expand(n[0], false).map(embrace);
+ if (n.length === 1) {
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+ return post.map(function(p) {
+ return m.pre + n[0] + p;
+ });
+ }
+ }
+ }
+
+ // at this point, n is the parts, and we know it's not a comma set
+ // with a single entry.
+
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
+ var pre = m.pre;
+ var post = m.post.length
+ ? expand(m.post, false)
+ : [''];
+
+ var N;
+
+ if (isSequence) {
+ var x = numeric(n[0]);
+ var y = numeric(n[1]);
+ var width = Math.max(n[0].length, n[1].length)
+ var incr = n.length == 3
+ ? Math.abs(numeric(n[2]))
+ : 1;
+ var test = lte;
+ var reverse = y < x;
+ if (reverse) {
+ incr *= -1;
+ test = gte;
+ }
+ var pad = n.some(isPadded);
+
+ N = [];
+
+ for (var i = x; test(i, y); i += incr) {
+ var c;
+ if (isAlphaSequence) {
+ c = String.fromCharCode(i);
+ if (c === '\\')
+ c = '';
+ } else {
+ c = String(i);
+ if (pad) {
+ var need = width - c.length;
+ if (need > 0) {
+ var z = new Array(need + 1).join('0');
+ if (i < 0)
+ c = '-' + z + c.slice(1);
+ else
+ c = z + c;
+ }
+ }
+ }
+ N.push(c);
+ }
+ } else {
+ N = concatMap(n, function(el) { return expand(el, false) });
+ }
+
+ for (var j = 0; j < N.length; j++) {
+ for (var k = 0; k < post.length; k++) {
+ var expansion = pre + N[j] + post[k];
+ if (!isTop || isSequence || expansion)
+ expansions.push(expansion);
+ }
+ }
+
+ return expansions;
+}
+
diff --git a/Nodejs/node_modules/brace-expansion/package.json b/Nodejs/node_modules/brace-expansion/package.json
new file mode 100644
index 0000000..e7973bf
--- /dev/null
+++ b/Nodejs/node_modules/brace-expansion/package.json
@@ -0,0 +1,75 @@
+{
+ "_from": "brace-expansion@^1.1.7",
+ "_id": "brace-expansion@1.1.11",
+ "_inBundle": false,
+ "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "_location": "/brace-expansion",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "brace-expansion@^1.1.7",
+ "name": "brace-expansion",
+ "escapedName": "brace-expansion",
+ "rawSpec": "^1.1.7",
+ "saveSpec": null,
+ "fetchSpec": "^1.1.7"
+ },
+ "_requiredBy": [
+ "/minimatch"
+ ],
+ "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
+ "_spec": "brace-expansion@^1.1.7",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/minimatch",
+ "author": {
+ "name": "Julian Gruber",
+ "email": "mail@juliangruber.com",
+ "url": "http://juliangruber.com"
+ },
+ "bugs": {
+ "url": "https://github.com/juliangruber/brace-expansion/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ },
+ "deprecated": false,
+ "description": "Brace expansion as known from sh/bash",
+ "devDependencies": {
+ "matcha": "^0.7.0",
+ "tape": "^4.6.0"
+ },
+ "homepage": "https://github.com/juliangruber/brace-expansion",
+ "keywords": [],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "brace-expansion",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/juliangruber/brace-expansion.git"
+ },
+ "scripts": {
+ "bench": "matcha test/perf/bench.js",
+ "gentest": "bash test/generate.sh",
+ "test": "tape test/*.js"
+ },
+ "testling": {
+ "files": "test/*.js",
+ "browsers": [
+ "ie/8..latest",
+ "firefox/20..latest",
+ "firefox/nightly",
+ "chrome/25..latest",
+ "chrome/canary",
+ "opera/12..latest",
+ "opera/next",
+ "safari/5.1..latest",
+ "ipad/6.0..latest",
+ "iphone/6.0..latest",
+ "android-browser/4.2..latest"
+ ]
+ },
+ "version": "1.1.11"
+}
diff --git a/Nodejs/node_modules/braces/CHANGELOG.md b/Nodejs/node_modules/braces/CHANGELOG.md
new file mode 100644
index 0000000..36f798b
--- /dev/null
+++ b/Nodejs/node_modules/braces/CHANGELOG.md
@@ -0,0 +1,184 @@
+# Release history
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+
+
+ Guiding Principles
+
+- Changelogs are for humans, not machines.
+- There should be an entry for every single version.
+- The same types of changes should be grouped.
+- Versions and sections should be linkable.
+- The latest version comes first.
+- The release date of each versions is displayed.
+- Mention whether you follow Semantic Versioning.
+
+
+
+
+ Types of changes
+
+Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
+
+- `Added` for new features.
+- `Changed` for changes in existing functionality.
+- `Deprecated` for soon-to-be removed features.
+- `Removed` for now removed features.
+- `Fixed` for any bug fixes.
+- `Security` in case of vulnerabilities.
+
+
+
+## [3.0.0] - 2018-04-08
+
+v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler.
+
+**Breaking Changes**
+
+- The undocumented `.makeRe` method was removed
+
+**Non-breaking changes**
+
+- Caching was removed
+
+## [2.3.2] - 2018-04-08
+
+- start refactoring
+- cover sets
+- better range handling
+
+## [2.3.1] - 2018-02-17
+
+- Remove unnecessary escape in Regex. (#14)
+
+## [2.3.0] - 2017-10-19
+
+- minor code reorganization
+- optimize regex
+- expose `maxLength` option
+
+## [2.2.1] - 2017-05-30
+
+- don't condense when braces contain extglobs
+
+## [2.2.0] - 2017-05-28
+
+- ensure word boundaries are preserved
+- fixes edge case where extglob characters precede a brace pattern
+
+## [2.1.1] - 2017-04-27
+
+- use snapdragon-node
+- handle edge case
+- optimizations, lint
+
+## [2.0.4] - 2017-04-11
+
+- pass opts to compiler
+- minor optimization in create method
+- re-write parser handlers to remove negation regex
+
+## [2.0.3] - 2016-12-10
+
+- use split-string
+- clear queue at the end
+- adds sequences example
+- add unit tests
+
+## [2.0.2] - 2016-10-21
+
+- fix comma handling in nested extglobs
+
+## [2.0.1] - 2016-10-20
+
+- add comments
+- more tests, ensure quotes are stripped
+
+## [2.0.0] - 2016-10-19
+
+- don't expand braces inside character classes
+- add quantifier pattern
+
+## [1.8.5] - 2016-05-21
+
+- Refactor (#10)
+
+## [1.8.4] - 2016-04-20
+
+- fixes https://github.com/jonschlinkert/micromatch/issues/66
+
+## [1.8.0] - 2015-03-18
+
+- adds exponent examples, tests
+- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38
+
+## [1.6.0] - 2015-01-30
+
+- optimizations, `bash` mode:
+- improve path escaping
+
+## [1.5.0] - 2015-01-28
+
+- Merge pull request #5 from eush77/lib-files
+
+## [1.4.0] - 2015-01-24
+
+- add extglob tests
+- externalize exponent function
+- better whitespace handling
+
+## [1.3.0] - 2015-01-24
+
+- make regex patterns explicity
+
+## [1.1.0] - 2015-01-11
+
+- don't create a match group with `makeRe`
+
+## [1.0.0] - 2014-12-23
+
+- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e'
+- support empty brace syntax
+- better bash coverage
+- better support for regex strings
+
+## [0.1.4] - 2014-11-14
+
+- improve recognition of bad args, recognize mismatched argument types
+- support escaping
+- remove pathname-expansion
+- support whitespace in patterns
+
+## [0.1.0]
+
+- first commit
+
+[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2
+[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1
+[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0
+[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1
+[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0
+[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1
+[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0
+[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4
+[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3
+[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2
+[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1
+[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0
+[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5
+[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4
+[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0
+[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0
+[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0
+[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0
+[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0
+[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0
+[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0
+[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0
+[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4
+
+[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD
+[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
\ No newline at end of file
diff --git a/Nodejs/node_modules/braces/LICENSE b/Nodejs/node_modules/braces/LICENSE
new file mode 100644
index 0000000..d32ab44
--- /dev/null
+++ b/Nodejs/node_modules/braces/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2018, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/braces/README.md b/Nodejs/node_modules/braces/README.md
new file mode 100644
index 0000000..cba2f60
--- /dev/null
+++ b/Nodejs/node_modules/braces/README.md
@@ -0,0 +1,593 @@
+# braces [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [](https://www.npmjs.com/package/braces) [](https://npmjs.org/package/braces) [](https://npmjs.org/package/braces) [](https://travis-ci.org/micromatch/braces)
+
+> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.
+
+Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save braces
+```
+
+## v3.0.0 Released!!
+
+See the [changelog](CHANGELOG.md) for details.
+
+## Why use braces?
+
+Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters.
+
+* **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
+* **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
+* **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up.
+* **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written).
+* **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)).
+* [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
+* [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']`
+* [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']`
+* [Supports escaping](#escaping) - To prevent evaluation of special characters.
+
+## Usage
+
+The main export is a function that takes one or more brace `patterns` and `options`.
+
+```js
+const braces = require('braces');
+// braces(patterns[, options]);
+
+console.log(braces(['{01..05}', '{a..e}']));
+//=> ['(0[1-5])', '([a-e])']
+
+console.log(braces(['{01..05}', '{a..e}'], { expand: true }));
+//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e']
+```
+
+### Brace Expansion vs. Compilation
+
+By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching.
+
+**Compiled**
+
+```js
+console.log(braces('a/{x,y,z}/b'));
+//=> ['a/(x|y|z)/b']
+console.log(braces(['a/{01..20}/b', 'a/{1..5}/b']));
+//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ]
+```
+
+**Expanded**
+
+Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)):
+
+```js
+console.log(braces('a/{x,y,z}/b', { expand: true }));
+//=> ['a/x/b', 'a/y/b', 'a/z/b']
+
+console.log(braces.expand('{01..10}'));
+//=> ['01','02','03','04','05','06','07','08','09','10']
+```
+
+### Lists
+
+Expand lists (like Bash "sets"):
+
+```js
+console.log(braces('a/{foo,bar,baz}/*.js'));
+//=> ['a/(foo|bar|baz)/*.js']
+
+console.log(braces.expand('a/{foo,bar,baz}/*.js'));
+//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js']
+```
+
+### Sequences
+
+Expand ranges of characters (like Bash "sequences"):
+
+```js
+console.log(braces.expand('{1..3}')); // ['1', '2', '3']
+console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b']
+console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c']
+console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c']
+
+// supports zero-padded ranges
+console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b']
+console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b']
+```
+
+See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options.
+
+### Steppped ranges
+
+Steps, or increments, may be used with ranges:
+
+```js
+console.log(braces.expand('{2..10..2}'));
+//=> ['2', '4', '6', '8', '10']
+
+console.log(braces('{2..10..2}'));
+//=> ['(2|4|6|8|10)']
+```
+
+When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion.
+
+### Nesting
+
+Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved.
+
+**"Expanded" braces**
+
+```js
+console.log(braces.expand('a{b,c,/{x,y}}/e'));
+//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e']
+
+console.log(braces.expand('a/{x,{1..5},y}/c'));
+//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c']
+```
+
+**"Optimized" braces**
+
+```js
+console.log(braces('a{b,c,/{x,y}}/e'));
+//=> ['a(b|c|/(x|y))/e']
+
+console.log(braces('a/{x,{1..5},y}/c'));
+//=> ['a/(x|([1-5])|y)/c']
+```
+
+### Escaping
+
+**Escaping braces**
+
+A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_:
+
+```js
+console.log(braces.expand('a\\{d,c,b}e'));
+//=> ['a{d,c,b}e']
+
+console.log(braces.expand('a{d,c,b\\}e'));
+//=> ['a{d,c,b}e']
+```
+
+**Escaping commas**
+
+Commas inside braces may also be escaped:
+
+```js
+console.log(braces.expand('a{b\\,c}d'));
+//=> ['a{b,c}d']
+
+console.log(braces.expand('a{d\\,c,b}e'));
+//=> ['ad,ce', 'abe']
+```
+
+**Single items**
+
+Following bash conventions, a brace pattern is also not expanded when it contains a single character:
+
+```js
+console.log(braces.expand('a{b}c'));
+//=> ['a{b}c']
+```
+
+## Options
+
+### options.maxLength
+
+**Type**: `Number`
+
+**Default**: `65,536`
+
+**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera.
+
+```js
+console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error
+```
+
+### options.expand
+
+**Type**: `Boolean`
+
+**Default**: `undefined`
+
+**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing).
+
+```js
+console.log(braces('a/{b,c}/d', { expand: true }));
+//=> [ 'a/b/d', 'a/c/d' ]
+```
+
+### options.nodupes
+
+**Type**: `Boolean`
+
+**Default**: `undefined`
+
+**Description**: Remove duplicates from the returned array.
+
+### options.rangeLimit
+
+**Type**: `Number`
+
+**Default**: `1000`
+
+**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`.
+
+You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether.
+
+**Examples**
+
+```js
+// pattern exceeds the "rangeLimit", so it's optimized automatically
+console.log(braces.expand('{1..1000}'));
+//=> ['([1-9]|[1-9][0-9]{1,2}|1000)']
+
+// pattern does not exceed "rangeLimit", so it's NOT optimized
+console.log(braces.expand('{1..100}'));
+//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100']
+```
+
+### options.transform
+
+**Type**: `Function`
+
+**Default**: `undefined`
+
+**Description**: Customize range expansion.
+
+**Example: Transforming non-numeric values**
+
+```js
+const alpha = braces.expand('x/{a..e}/y', {
+ transform(value, index) {
+ // When non-numeric values are passed, "value" is a character code.
+ return 'foo/' + String.fromCharCode(value) + '-' + index;
+ }
+});
+console.log(alpha);
+//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ]
+```
+
+**Example: Transforming numeric values**
+
+```js
+const numeric = braces.expand('{1..5}', {
+ transform(value) {
+ // when numeric values are passed, "value" is a number
+ return 'foo/' + value * 2;
+ }
+});
+console.log(numeric);
+//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ]
+```
+
+### options.quantifiers
+
+**Type**: `Boolean`
+
+**Default**: `undefined`
+
+**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times.
+
+Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists)
+
+The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists.
+
+**Examples**
+
+```js
+const braces = require('braces');
+console.log(braces('a/b{1,3}/{x,y,z}'));
+//=> [ 'a/b(1|3)/(x|y|z)' ]
+console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true}));
+//=> [ 'a/b{1,3}/(x|y|z)' ]
+console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true}));
+//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ]
+```
+
+### options.unescape
+
+**Type**: `Boolean`
+
+**Default**: `undefined`
+
+**Description**: Strip backslashes that were used for escaping from the result.
+
+## What is "brace expansion"?
+
+Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs).
+
+In addition to "expansion", braces are also used for matching. In other words:
+
+* [brace expansion](#brace-expansion) is for generating new lists
+* [brace matching](#brace-matching) is for filtering existing lists
+
+
+More about brace expansion (click to expand)
+
+There are two main types of brace expansion:
+
+1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}`
+2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges".
+
+Here are some example brace patterns to illustrate how they work:
+
+**Sets**
+
+```
+{a,b,c} => a b c
+{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2
+```
+
+**Sequences**
+
+```
+{1..9} => 1 2 3 4 5 6 7 8 9
+{4..-4} => 4 3 2 1 0 -1 -2 -3 -4
+{1..20..3} => 1 4 7 10 13 16 19
+{a..j} => a b c d e f g h i j
+{j..a} => j i h g f e d c b a
+{a..z..3} => a d g j m p s v y
+```
+
+**Combination**
+
+Sets and sequences can be mixed together or used along with any other strings.
+
+```
+{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3
+foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar
+```
+
+The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases.
+
+## Brace matching
+
+In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching.
+
+For example, the pattern `foo/{1..3}/bar` would match any of following strings:
+
+```
+foo/1/bar
+foo/2/bar
+foo/3/bar
+```
+
+But not:
+
+```
+baz/1/qux
+baz/2/qux
+baz/3/qux
+```
+
+Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings:
+
+```
+foo/1/bar
+foo/2/bar
+foo/3/bar
+baz/1/qux
+baz/2/qux
+baz/3/qux
+```
+
+## Brace matching pitfalls
+
+Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of.
+
+### tldr
+
+**"brace bombs"**
+
+* brace expansion can eat up a huge amount of processing resources
+* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
+* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
+
+For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section.
+
+### The solution
+
+Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries.
+
+### Geometric complexity
+
+At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`.
+
+For example, the following sets demonstrate quadratic (`O(n^2)`) complexity:
+
+```
+{1,2}{3,4} => (2X2) => 13 14 23 24
+{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246
+```
+
+But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity:
+
+```
+{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248
+ 249 257 258 259 267 268 269 347 348 349 357
+ 358 359 367 368 369
+```
+
+Now, imagine how this complexity grows given that each element is a n-tuple:
+
+```
+{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB)
+{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB)
+```
+
+Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control.
+
+**More information**
+
+Interested in learning more about brace expansion?
+
+* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
+* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
+* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
+
+
+
+## Performance
+
+Braces is not only screaming fast, it's also more accurate the other brace expansion libraries.
+
+### Better algorithms
+
+Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_.
+
+Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently.
+
+**The proof is in the numbers**
+
+Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively.
+
+| **Pattern** | **braces** | **[minimatch][]** |
+| --- | --- | --- |
+| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs)| N/A (freezes) |
+| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) |
+| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) |
+| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) |
+| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) |
+| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) |
+| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) |
+| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) |
+| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) |
+| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) |
+| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) |
+| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) |
+| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) |
+| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) |
+| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) |
+| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) |
+| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) |
+
+### Faster algorithms
+
+When you need expansion, braces is still much faster.
+
+_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_
+
+| **Pattern** | **braces** | **[minimatch][]** |
+| --- | --- | --- |
+| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) |
+| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) |
+| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) |
+| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) |
+| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) |
+| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) |
+| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) |
+| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) |
+
+If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js).
+
+## Benchmarks
+
+### Running benchmarks
+
+Install dev dependencies:
+
+```bash
+npm i -d && npm benchmark
+```
+
+### Latest results
+
+Braces is more accurate, without sacrificing performance.
+
+```bash
+# range (expanded)
+ braces x 29,040 ops/sec ±3.69% (91 runs sampled))
+ minimatch x 4,735 ops/sec ±1.28% (90 runs sampled)
+
+# range (optimized for regex)
+ braces x 382,878 ops/sec ±0.56% (94 runs sampled)
+ minimatch x 1,040 ops/sec ±0.44% (93 runs sampled)
+
+# nested ranges (expanded)
+ braces x 19,744 ops/sec ±2.27% (92 runs sampled))
+ minimatch x 4,579 ops/sec ±0.50% (93 runs sampled)
+
+# nested ranges (optimized for regex)
+ braces x 246,019 ops/sec ±2.02% (93 runs sampled)
+ minimatch x 1,028 ops/sec ±0.39% (94 runs sampled)
+
+# set (expanded)
+ braces x 138,641 ops/sec ±0.53% (95 runs sampled)
+ minimatch x 219,582 ops/sec ±0.98% (94 runs sampled)
+
+# set (optimized for regex)
+ braces x 388,408 ops/sec ±0.41% (95 runs sampled)
+ minimatch x 44,724 ops/sec ±0.91% (89 runs sampled)
+
+# nested sets (expanded)
+ braces x 84,966 ops/sec ±0.48% (94 runs sampled)
+ minimatch x 140,720 ops/sec ±0.37% (95 runs sampled)
+
+# nested sets (optimized for regex)
+ braces x 263,340 ops/sec ±2.06% (92 runs sampled)
+ minimatch x 28,714 ops/sec ±0.40% (90 runs sampled)
+```
+
+## About
+
+
+Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+
+
+
+Running Tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+$ npm install && npm test
+```
+
+
+
+
+Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+
+
+### Contributors
+
+| **Commits** | **Contributor** |
+| --- | --- |
+| 197 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 4 | [doowb](https://github.com/doowb) |
+| 1 | [es128](https://github.com/es128) |
+| 1 | [eush77](https://github.com/eush77) |
+| 1 | [hemanth](https://github.com/hemanth) |
+| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
+
+### Author
+
+**Jon Schlinkert**
+
+* [GitHub Profile](https://github.com/jonschlinkert)
+* [Twitter Profile](https://twitter.com/jonschlinkert)
+* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
+
+### License
+
+Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
\ No newline at end of file
diff --git a/Nodejs/node_modules/braces/index.js b/Nodejs/node_modules/braces/index.js
new file mode 100644
index 0000000..0eee0f5
--- /dev/null
+++ b/Nodejs/node_modules/braces/index.js
@@ -0,0 +1,170 @@
+'use strict';
+
+const stringify = require('./lib/stringify');
+const compile = require('./lib/compile');
+const expand = require('./lib/expand');
+const parse = require('./lib/parse');
+
+/**
+ * Expand the given pattern or create a regex-compatible string.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
+ * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
+ * ```
+ * @param {String} `str`
+ * @param {Object} `options`
+ * @return {String}
+ * @api public
+ */
+
+const braces = (input, options = {}) => {
+ let output = [];
+
+ if (Array.isArray(input)) {
+ for (let pattern of input) {
+ let result = braces.create(pattern, options);
+ if (Array.isArray(result)) {
+ output.push(...result);
+ } else {
+ output.push(result);
+ }
+ }
+ } else {
+ output = [].concat(braces.create(input, options));
+ }
+
+ if (options && options.expand === true && options.nodupes === true) {
+ output = [...new Set(output)];
+ }
+ return output;
+};
+
+/**
+ * Parse the given `str` with the given `options`.
+ *
+ * ```js
+ * // braces.parse(pattern, [, options]);
+ * const ast = braces.parse('a/{b,c}/d');
+ * console.log(ast);
+ * ```
+ * @param {String} pattern Brace pattern to parse
+ * @param {Object} options
+ * @return {Object} Returns an AST
+ * @api public
+ */
+
+braces.parse = (input, options = {}) => parse(input, options);
+
+/**
+ * Creates a braces string from an AST, or an AST node.
+ *
+ * ```js
+ * const braces = require('braces');
+ * let ast = braces.parse('foo/{a,b}/bar');
+ * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
+ * ```
+ * @param {String} `input` Brace pattern or AST.
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces.stringify = (input, options = {}) => {
+ if (typeof input === 'string') {
+ return stringify(braces.parse(input, options), options);
+ }
+ return stringify(input, options);
+};
+
+/**
+ * Compiles a brace pattern into a regex-compatible, optimized string.
+ * This method is called by the main [braces](#braces) function by default.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces.compile('a/{b,c}/d'));
+ * //=> ['a/(b|c)/d']
+ * ```
+ * @param {String} `input` Brace pattern or AST.
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces.compile = (input, options = {}) => {
+ if (typeof input === 'string') {
+ input = braces.parse(input, options);
+ }
+ return compile(input, options);
+};
+
+/**
+ * Expands a brace pattern into an array. This method is called by the
+ * main [braces](#braces) function when `options.expand` is true. Before
+ * using this method it's recommended that you read the [performance notes](#performance))
+ * and advantages of using [.compile](#compile) instead.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces.expand('a/{b,c}/d'));
+ * //=> ['a/b/d', 'a/c/d'];
+ * ```
+ * @param {String} `pattern` Brace pattern
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces.expand = (input, options = {}) => {
+ if (typeof input === 'string') {
+ input = braces.parse(input, options);
+ }
+
+ let result = expand(input, options);
+
+ // filter out empty strings if specified
+ if (options.noempty === true) {
+ result = result.filter(Boolean);
+ }
+
+ // filter out duplicates if specified
+ if (options.nodupes === true) {
+ result = [...new Set(result)];
+ }
+
+ return result;
+};
+
+/**
+ * Processes a brace pattern and returns either an expanded array
+ * (if `options.expand` is true), a highly optimized regex-compatible string.
+ * This method is called by the main [braces](#braces) function.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
+ * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
+ * ```
+ * @param {String} `pattern` Brace pattern
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces.create = (input, options = {}) => {
+ if (input === '' || input.length < 3) {
+ return [input];
+ }
+
+ return options.expand !== true
+ ? braces.compile(input, options)
+ : braces.expand(input, options);
+};
+
+/**
+ * Expose "braces"
+ */
+
+module.exports = braces;
diff --git a/Nodejs/node_modules/braces/lib/compile.js b/Nodejs/node_modules/braces/lib/compile.js
new file mode 100644
index 0000000..3e984a4
--- /dev/null
+++ b/Nodejs/node_modules/braces/lib/compile.js
@@ -0,0 +1,57 @@
+'use strict';
+
+const fill = require('fill-range');
+const utils = require('./utils');
+
+const compile = (ast, options = {}) => {
+ let walk = (node, parent = {}) => {
+ let invalidBlock = utils.isInvalidBrace(parent);
+ let invalidNode = node.invalid === true && options.escapeInvalid === true;
+ let invalid = invalidBlock === true || invalidNode === true;
+ let prefix = options.escapeInvalid === true ? '\\' : '';
+ let output = '';
+
+ if (node.isOpen === true) {
+ return prefix + node.value;
+ }
+ if (node.isClose === true) {
+ return prefix + node.value;
+ }
+
+ if (node.type === 'open') {
+ return invalid ? (prefix + node.value) : '(';
+ }
+
+ if (node.type === 'close') {
+ return invalid ? (prefix + node.value) : ')';
+ }
+
+ if (node.type === 'comma') {
+ return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
+ }
+
+ if (node.value) {
+ return node.value;
+ }
+
+ if (node.nodes && node.ranges > 0) {
+ let args = utils.reduce(node.nodes);
+ let range = fill(...args, { ...options, wrap: false, toRegex: true });
+
+ if (range.length !== 0) {
+ return args.length > 1 && range.length > 1 ? `(${range})` : range;
+ }
+ }
+
+ if (node.nodes) {
+ for (let child of node.nodes) {
+ output += walk(child, node);
+ }
+ }
+ return output;
+ };
+
+ return walk(ast);
+};
+
+module.exports = compile;
diff --git a/Nodejs/node_modules/braces/lib/constants.js b/Nodejs/node_modules/braces/lib/constants.js
new file mode 100644
index 0000000..a937943
--- /dev/null
+++ b/Nodejs/node_modules/braces/lib/constants.js
@@ -0,0 +1,57 @@
+'use strict';
+
+module.exports = {
+ MAX_LENGTH: 1024 * 64,
+
+ // Digits
+ CHAR_0: '0', /* 0 */
+ CHAR_9: '9', /* 9 */
+
+ // Alphabet chars.
+ CHAR_UPPERCASE_A: 'A', /* A */
+ CHAR_LOWERCASE_A: 'a', /* a */
+ CHAR_UPPERCASE_Z: 'Z', /* Z */
+ CHAR_LOWERCASE_Z: 'z', /* z */
+
+ CHAR_LEFT_PARENTHESES: '(', /* ( */
+ CHAR_RIGHT_PARENTHESES: ')', /* ) */
+
+ CHAR_ASTERISK: '*', /* * */
+
+ // Non-alphabetic chars.
+ CHAR_AMPERSAND: '&', /* & */
+ CHAR_AT: '@', /* @ */
+ CHAR_BACKSLASH: '\\', /* \ */
+ CHAR_BACKTICK: '`', /* ` */
+ CHAR_CARRIAGE_RETURN: '\r', /* \r */
+ CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */
+ CHAR_COLON: ':', /* : */
+ CHAR_COMMA: ',', /* , */
+ CHAR_DOLLAR: '$', /* . */
+ CHAR_DOT: '.', /* . */
+ CHAR_DOUBLE_QUOTE: '"', /* " */
+ CHAR_EQUAL: '=', /* = */
+ CHAR_EXCLAMATION_MARK: '!', /* ! */
+ CHAR_FORM_FEED: '\f', /* \f */
+ CHAR_FORWARD_SLASH: '/', /* / */
+ CHAR_HASH: '#', /* # */
+ CHAR_HYPHEN_MINUS: '-', /* - */
+ CHAR_LEFT_ANGLE_BRACKET: '<', /* < */
+ CHAR_LEFT_CURLY_BRACE: '{', /* { */
+ CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */
+ CHAR_LINE_FEED: '\n', /* \n */
+ CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */
+ CHAR_PERCENT: '%', /* % */
+ CHAR_PLUS: '+', /* + */
+ CHAR_QUESTION_MARK: '?', /* ? */
+ CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */
+ CHAR_RIGHT_CURLY_BRACE: '}', /* } */
+ CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */
+ CHAR_SEMICOLON: ';', /* ; */
+ CHAR_SINGLE_QUOTE: '\'', /* ' */
+ CHAR_SPACE: ' ', /* */
+ CHAR_TAB: '\t', /* \t */
+ CHAR_UNDERSCORE: '_', /* _ */
+ CHAR_VERTICAL_LINE: '|', /* | */
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */
+};
diff --git a/Nodejs/node_modules/braces/lib/expand.js b/Nodejs/node_modules/braces/lib/expand.js
new file mode 100644
index 0000000..376c748
--- /dev/null
+++ b/Nodejs/node_modules/braces/lib/expand.js
@@ -0,0 +1,113 @@
+'use strict';
+
+const fill = require('fill-range');
+const stringify = require('./stringify');
+const utils = require('./utils');
+
+const append = (queue = '', stash = '', enclose = false) => {
+ let result = [];
+
+ queue = [].concat(queue);
+ stash = [].concat(stash);
+
+ if (!stash.length) return queue;
+ if (!queue.length) {
+ return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
+ }
+
+ for (let item of queue) {
+ if (Array.isArray(item)) {
+ for (let value of item) {
+ result.push(append(value, stash, enclose));
+ }
+ } else {
+ for (let ele of stash) {
+ if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
+ result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
+ }
+ }
+ }
+ return utils.flatten(result);
+};
+
+const expand = (ast, options = {}) => {
+ let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
+
+ let walk = (node, parent = {}) => {
+ node.queue = [];
+
+ let p = parent;
+ let q = parent.queue;
+
+ while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
+ p = p.parent;
+ q = p.queue;
+ }
+
+ if (node.invalid || node.dollar) {
+ q.push(append(q.pop(), stringify(node, options)));
+ return;
+ }
+
+ if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
+ q.push(append(q.pop(), ['{}']));
+ return;
+ }
+
+ if (node.nodes && node.ranges > 0) {
+ let args = utils.reduce(node.nodes);
+
+ if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
+ throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
+ }
+
+ let range = fill(...args, options);
+ if (range.length === 0) {
+ range = stringify(node, options);
+ }
+
+ q.push(append(q.pop(), range));
+ node.nodes = [];
+ return;
+ }
+
+ let enclose = utils.encloseBrace(node);
+ let queue = node.queue;
+ let block = node;
+
+ while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
+ block = block.parent;
+ queue = block.queue;
+ }
+
+ for (let i = 0; i < node.nodes.length; i++) {
+ let child = node.nodes[i];
+
+ if (child.type === 'comma' && node.type === 'brace') {
+ if (i === 1) queue.push('');
+ queue.push('');
+ continue;
+ }
+
+ if (child.type === 'close') {
+ q.push(append(q.pop(), queue, enclose));
+ continue;
+ }
+
+ if (child.value && child.type !== 'open') {
+ queue.push(append(queue.pop(), child.value));
+ continue;
+ }
+
+ if (child.nodes) {
+ walk(child, node);
+ }
+ }
+
+ return queue;
+ };
+
+ return utils.flatten(walk(ast));
+};
+
+module.exports = expand;
diff --git a/Nodejs/node_modules/braces/lib/parse.js b/Nodejs/node_modules/braces/lib/parse.js
new file mode 100644
index 0000000..145ea26
--- /dev/null
+++ b/Nodejs/node_modules/braces/lib/parse.js
@@ -0,0 +1,333 @@
+'use strict';
+
+const stringify = require('./stringify');
+
+/**
+ * Constants
+ */
+
+const {
+ MAX_LENGTH,
+ CHAR_BACKSLASH, /* \ */
+ CHAR_BACKTICK, /* ` */
+ CHAR_COMMA, /* , */
+ CHAR_DOT, /* . */
+ CHAR_LEFT_PARENTHESES, /* ( */
+ CHAR_RIGHT_PARENTHESES, /* ) */
+ CHAR_LEFT_CURLY_BRACE, /* { */
+ CHAR_RIGHT_CURLY_BRACE, /* } */
+ CHAR_LEFT_SQUARE_BRACKET, /* [ */
+ CHAR_RIGHT_SQUARE_BRACKET, /* ] */
+ CHAR_DOUBLE_QUOTE, /* " */
+ CHAR_SINGLE_QUOTE, /* ' */
+ CHAR_NO_BREAK_SPACE,
+ CHAR_ZERO_WIDTH_NOBREAK_SPACE
+} = require('./constants');
+
+/**
+ * parse
+ */
+
+const parse = (input, options = {}) => {
+ if (typeof input !== 'string') {
+ throw new TypeError('Expected a string');
+ }
+
+ let opts = options || {};
+ let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+ if (input.length > max) {
+ throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
+ }
+
+ let ast = { type: 'root', input, nodes: [] };
+ let stack = [ast];
+ let block = ast;
+ let prev = ast;
+ let brackets = 0;
+ let length = input.length;
+ let index = 0;
+ let depth = 0;
+ let value;
+ let memo = {};
+
+ /**
+ * Helpers
+ */
+
+ const advance = () => input[index++];
+ const push = node => {
+ if (node.type === 'text' && prev.type === 'dot') {
+ prev.type = 'text';
+ }
+
+ if (prev && prev.type === 'text' && node.type === 'text') {
+ prev.value += node.value;
+ return;
+ }
+
+ block.nodes.push(node);
+ node.parent = block;
+ node.prev = prev;
+ prev = node;
+ return node;
+ };
+
+ push({ type: 'bos' });
+
+ while (index < length) {
+ block = stack[stack.length - 1];
+ value = advance();
+
+ /**
+ * Invalid chars
+ */
+
+ if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
+ continue;
+ }
+
+ /**
+ * Escaped chars
+ */
+
+ if (value === CHAR_BACKSLASH) {
+ push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() });
+ continue;
+ }
+
+ /**
+ * Right square bracket (literal): ']'
+ */
+
+ if (value === CHAR_RIGHT_SQUARE_BRACKET) {
+ push({ type: 'text', value: '\\' + value });
+ continue;
+ }
+
+ /**
+ * Left square bracket: '['
+ */
+
+ if (value === CHAR_LEFT_SQUARE_BRACKET) {
+ brackets++;
+
+ let closed = true;
+ let next;
+
+ while (index < length && (next = advance())) {
+ value += next;
+
+ if (next === CHAR_LEFT_SQUARE_BRACKET) {
+ brackets++;
+ continue;
+ }
+
+ if (next === CHAR_BACKSLASH) {
+ value += advance();
+ continue;
+ }
+
+ if (next === CHAR_RIGHT_SQUARE_BRACKET) {
+ brackets--;
+
+ if (brackets === 0) {
+ break;
+ }
+ }
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Parentheses
+ */
+
+ if (value === CHAR_LEFT_PARENTHESES) {
+ block = push({ type: 'paren', nodes: [] });
+ stack.push(block);
+ push({ type: 'text', value });
+ continue;
+ }
+
+ if (value === CHAR_RIGHT_PARENTHESES) {
+ if (block.type !== 'paren') {
+ push({ type: 'text', value });
+ continue;
+ }
+ block = stack.pop();
+ push({ type: 'text', value });
+ block = stack[stack.length - 1];
+ continue;
+ }
+
+ /**
+ * Quotes: '|"|`
+ */
+
+ if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
+ let open = value;
+ let next;
+
+ if (options.keepQuotes !== true) {
+ value = '';
+ }
+
+ while (index < length && (next = advance())) {
+ if (next === CHAR_BACKSLASH) {
+ value += next + advance();
+ continue;
+ }
+
+ if (next === open) {
+ if (options.keepQuotes === true) value += next;
+ break;
+ }
+
+ value += next;
+ }
+
+ push({ type: 'text', value });
+ continue;
+ }
+
+ /**
+ * Left curly brace: '{'
+ */
+
+ if (value === CHAR_LEFT_CURLY_BRACE) {
+ depth++;
+
+ let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
+ let brace = {
+ type: 'brace',
+ open: true,
+ close: false,
+ dollar,
+ depth,
+ commas: 0,
+ ranges: 0,
+ nodes: []
+ };
+
+ block = push(brace);
+ stack.push(block);
+ push({ type: 'open', value });
+ continue;
+ }
+
+ /**
+ * Right curly brace: '}'
+ */
+
+ if (value === CHAR_RIGHT_CURLY_BRACE) {
+ if (block.type !== 'brace') {
+ push({ type: 'text', value });
+ continue;
+ }
+
+ let type = 'close';
+ block = stack.pop();
+ block.close = true;
+
+ push({ type, value });
+ depth--;
+
+ block = stack[stack.length - 1];
+ continue;
+ }
+
+ /**
+ * Comma: ','
+ */
+
+ if (value === CHAR_COMMA && depth > 0) {
+ if (block.ranges > 0) {
+ block.ranges = 0;
+ let open = block.nodes.shift();
+ block.nodes = [open, { type: 'text', value: stringify(block) }];
+ }
+
+ push({ type: 'comma', value });
+ block.commas++;
+ continue;
+ }
+
+ /**
+ * Dot: '.'
+ */
+
+ if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
+ let siblings = block.nodes;
+
+ if (depth === 0 || siblings.length === 0) {
+ push({ type: 'text', value });
+ continue;
+ }
+
+ if (prev.type === 'dot') {
+ block.range = [];
+ prev.value += value;
+ prev.type = 'range';
+
+ if (block.nodes.length !== 3 && block.nodes.length !== 5) {
+ block.invalid = true;
+ block.ranges = 0;
+ prev.type = 'text';
+ continue;
+ }
+
+ block.ranges++;
+ block.args = [];
+ continue;
+ }
+
+ if (prev.type === 'range') {
+ siblings.pop();
+
+ let before = siblings[siblings.length - 1];
+ before.value += prev.value + value;
+ prev = before;
+ block.ranges--;
+ continue;
+ }
+
+ push({ type: 'dot', value });
+ continue;
+ }
+
+ /**
+ * Text
+ */
+
+ push({ type: 'text', value });
+ }
+
+ // Mark imbalanced braces and brackets as invalid
+ do {
+ block = stack.pop();
+
+ if (block.type !== 'root') {
+ block.nodes.forEach(node => {
+ if (!node.nodes) {
+ if (node.type === 'open') node.isOpen = true;
+ if (node.type === 'close') node.isClose = true;
+ if (!node.nodes) node.type = 'text';
+ node.invalid = true;
+ }
+ });
+
+ // get the location of the block on parent.nodes (block's siblings)
+ let parent = stack[stack.length - 1];
+ let index = parent.nodes.indexOf(block);
+ // replace the (invalid) block with it's nodes
+ parent.nodes.splice(index, 1, ...block.nodes);
+ }
+ } while (stack.length > 0);
+
+ push({ type: 'eos' });
+ return ast;
+};
+
+module.exports = parse;
diff --git a/Nodejs/node_modules/braces/lib/stringify.js b/Nodejs/node_modules/braces/lib/stringify.js
new file mode 100644
index 0000000..414b7bc
--- /dev/null
+++ b/Nodejs/node_modules/braces/lib/stringify.js
@@ -0,0 +1,32 @@
+'use strict';
+
+const utils = require('./utils');
+
+module.exports = (ast, options = {}) => {
+ let stringify = (node, parent = {}) => {
+ let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
+ let invalidNode = node.invalid === true && options.escapeInvalid === true;
+ let output = '';
+
+ if (node.value) {
+ if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
+ return '\\' + node.value;
+ }
+ return node.value;
+ }
+
+ if (node.value) {
+ return node.value;
+ }
+
+ if (node.nodes) {
+ for (let child of node.nodes) {
+ output += stringify(child);
+ }
+ }
+ return output;
+ };
+
+ return stringify(ast);
+};
+
diff --git a/Nodejs/node_modules/braces/lib/utils.js b/Nodejs/node_modules/braces/lib/utils.js
new file mode 100644
index 0000000..e3551a6
--- /dev/null
+++ b/Nodejs/node_modules/braces/lib/utils.js
@@ -0,0 +1,112 @@
+'use strict';
+
+exports.isInteger = num => {
+ if (typeof num === 'number') {
+ return Number.isInteger(num);
+ }
+ if (typeof num === 'string' && num.trim() !== '') {
+ return Number.isInteger(Number(num));
+ }
+ return false;
+};
+
+/**
+ * Find a node of the given type
+ */
+
+exports.find = (node, type) => node.nodes.find(node => node.type === type);
+
+/**
+ * Find a node of the given type
+ */
+
+exports.exceedsLimit = (min, max, step = 1, limit) => {
+ if (limit === false) return false;
+ if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
+ return ((Number(max) - Number(min)) / Number(step)) >= limit;
+};
+
+/**
+ * Escape the given node with '\\' before node.value
+ */
+
+exports.escapeNode = (block, n = 0, type) => {
+ let node = block.nodes[n];
+ if (!node) return;
+
+ if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
+ if (node.escaped !== true) {
+ node.value = '\\' + node.value;
+ node.escaped = true;
+ }
+ }
+};
+
+/**
+ * Returns true if the given brace node should be enclosed in literal braces
+ */
+
+exports.encloseBrace = node => {
+ if (node.type !== 'brace') return false;
+ if ((node.commas >> 0 + node.ranges >> 0) === 0) {
+ node.invalid = true;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * Returns true if a brace node is invalid.
+ */
+
+exports.isInvalidBrace = block => {
+ if (block.type !== 'brace') return false;
+ if (block.invalid === true || block.dollar) return true;
+ if ((block.commas >> 0 + block.ranges >> 0) === 0) {
+ block.invalid = true;
+ return true;
+ }
+ if (block.open !== true || block.close !== true) {
+ block.invalid = true;
+ return true;
+ }
+ return false;
+};
+
+/**
+ * Returns true if a node is an open or close node
+ */
+
+exports.isOpenOrClose = node => {
+ if (node.type === 'open' || node.type === 'close') {
+ return true;
+ }
+ return node.open === true || node.close === true;
+};
+
+/**
+ * Reduce an array of text nodes.
+ */
+
+exports.reduce = nodes => nodes.reduce((acc, node) => {
+ if (node.type === 'text') acc.push(node.value);
+ if (node.type === 'range') node.type = 'text';
+ return acc;
+}, []);
+
+/**
+ * Flatten an array
+ */
+
+exports.flatten = (...args) => {
+ const result = [];
+ const flat = arr => {
+ for (let i = 0; i < arr.length; i++) {
+ let ele = arr[i];
+ Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
+ }
+ return result;
+ };
+ flat(args);
+ return result;
+};
diff --git a/Nodejs/node_modules/braces/package.json b/Nodejs/node_modules/braces/package.json
new file mode 100644
index 0000000..c9e8727
--- /dev/null
+++ b/Nodejs/node_modules/braces/package.json
@@ -0,0 +1,123 @@
+{
+ "_from": "braces@^3.0.1",
+ "_id": "braces@3.0.2",
+ "_inBundle": false,
+ "_integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "_location": "/braces",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "braces@^3.0.1",
+ "name": "braces",
+ "escapedName": "braces",
+ "rawSpec": "^3.0.1",
+ "saveSpec": null,
+ "fetchSpec": "^3.0.1"
+ },
+ "_requiredBy": [
+ "/micromatch"
+ ],
+ "_resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "_shasum": "3454e1a462ee8d599e236df336cd9ea4f8afe107",
+ "_spec": "braces@^3.0.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/micromatch",
+ "author": {
+ "name": "Jon Schlinkert",
+ "url": "https://github.com/jonschlinkert"
+ },
+ "bugs": {
+ "url": "https://github.com/micromatch/braces/issues"
+ },
+ "bundleDependencies": false,
+ "contributors": [
+ {
+ "name": "Brian Woodward",
+ "url": "https://twitter.com/doowb"
+ },
+ {
+ "name": "Elan Shanker",
+ "url": "https://github.com/es128"
+ },
+ {
+ "name": "Eugene Sharygin",
+ "url": "https://github.com/eush77"
+ },
+ {
+ "name": "hemanth.hm",
+ "url": "http://h3manth.com"
+ },
+ {
+ "name": "Jon Schlinkert",
+ "url": "http://twitter.com/jonschlinkert"
+ }
+ ],
+ "dependencies": {
+ "fill-range": "^7.0.1"
+ },
+ "deprecated": false,
+ "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.",
+ "devDependencies": {
+ "ansi-colors": "^3.2.4",
+ "bash-path": "^2.0.1",
+ "gulp-format-md": "^2.0.0",
+ "mocha": "^6.1.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "files": [
+ "index.js",
+ "lib"
+ ],
+ "homepage": "https://github.com/micromatch/braces",
+ "keywords": [
+ "alpha",
+ "alphabetical",
+ "bash",
+ "brace",
+ "braces",
+ "expand",
+ "expansion",
+ "filepath",
+ "fill",
+ "fs",
+ "glob",
+ "globbing",
+ "letter",
+ "match",
+ "matches",
+ "matching",
+ "number",
+ "numerical",
+ "path",
+ "range",
+ "ranges",
+ "sh"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "braces",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/micromatch/braces.git"
+ },
+ "scripts": {
+ "benchmark": "node benchmark",
+ "test": "mocha"
+ },
+ "verb": {
+ "toc": false,
+ "layout": "default",
+ "tasks": [
+ "readme"
+ ],
+ "lint": {
+ "reflinks": true
+ },
+ "plugins": [
+ "gulp-format-md"
+ ]
+ },
+ "version": "3.0.2"
+}
diff --git a/Nodejs/node_modules/buffer-from/LICENSE b/Nodejs/node_modules/buffer-from/LICENSE
new file mode 100644
index 0000000..e4bf1d6
--- /dev/null
+++ b/Nodejs/node_modules/buffer-from/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2016, 2018 Linus Unnebäck
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/Nodejs/node_modules/buffer-from/index.js b/Nodejs/node_modules/buffer-from/index.js
new file mode 100644
index 0000000..d92a83d
--- /dev/null
+++ b/Nodejs/node_modules/buffer-from/index.js
@@ -0,0 +1,69 @@
+var toString = Object.prototype.toString
+
+var isModern = (
+ typeof Buffer.alloc === 'function' &&
+ typeof Buffer.allocUnsafe === 'function' &&
+ typeof Buffer.from === 'function'
+)
+
+function isArrayBuffer (input) {
+ return toString.call(input).slice(8, -1) === 'ArrayBuffer'
+}
+
+function fromArrayBuffer (obj, byteOffset, length) {
+ byteOffset >>>= 0
+
+ var maxLength = obj.byteLength - byteOffset
+
+ if (maxLength < 0) {
+ throw new RangeError("'offset' is out of bounds")
+ }
+
+ if (length === undefined) {
+ length = maxLength
+ } else {
+ length >>>= 0
+
+ if (length > maxLength) {
+ throw new RangeError("'length' is out of bounds")
+ }
+ }
+
+ return isModern
+ ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
+ : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
+}
+
+function fromString (string, encoding) {
+ if (typeof encoding !== 'string' || encoding === '') {
+ encoding = 'utf8'
+ }
+
+ if (!Buffer.isEncoding(encoding)) {
+ throw new TypeError('"encoding" must be a valid string encoding')
+ }
+
+ return isModern
+ ? Buffer.from(string, encoding)
+ : new Buffer(string, encoding)
+}
+
+function bufferFrom (value, encodingOrOffset, length) {
+ if (typeof value === 'number') {
+ throw new TypeError('"value" argument must not be a number')
+ }
+
+ if (isArrayBuffer(value)) {
+ return fromArrayBuffer(value, encodingOrOffset, length)
+ }
+
+ if (typeof value === 'string') {
+ return fromString(value, encodingOrOffset)
+ }
+
+ return isModern
+ ? Buffer.from(value)
+ : new Buffer(value)
+}
+
+module.exports = bufferFrom
diff --git a/Nodejs/node_modules/buffer-from/package.json b/Nodejs/node_modules/buffer-from/package.json
new file mode 100644
index 0000000..e70654e
--- /dev/null
+++ b/Nodejs/node_modules/buffer-from/package.json
@@ -0,0 +1,52 @@
+{
+ "_from": "buffer-from@^1.0.0",
+ "_id": "buffer-from@1.1.1",
+ "_inBundle": false,
+ "_integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
+ "_location": "/buffer-from",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "buffer-from@^1.0.0",
+ "name": "buffer-from",
+ "escapedName": "buffer-from",
+ "rawSpec": "^1.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.0"
+ },
+ "_requiredBy": [
+ "/concat-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+ "_shasum": "32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
+ "_spec": "buffer-from@^1.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/concat-stream",
+ "bugs": {
+ "url": "https://github.com/LinusU/buffer-from/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.",
+ "devDependencies": {
+ "standard": "^7.1.2"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/LinusU/buffer-from#readme",
+ "keywords": [
+ "buffer",
+ "buffer from"
+ ],
+ "license": "MIT",
+ "name": "buffer-from",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/LinusU/buffer-from.git"
+ },
+ "scripts": {
+ "test": "standard && node test"
+ },
+ "version": "1.1.1"
+}
diff --git a/Nodejs/node_modules/buffer-from/readme.md b/Nodejs/node_modules/buffer-from/readme.md
new file mode 100644
index 0000000..9880a55
--- /dev/null
+++ b/Nodejs/node_modules/buffer-from/readme.md
@@ -0,0 +1,69 @@
+# Buffer From
+
+A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.
+
+## Installation
+
+```sh
+npm install --save buffer-from
+```
+
+## Usage
+
+```js
+const bufferFrom = require('buffer-from')
+
+console.log(bufferFrom([1, 2, 3, 4]))
+//=>
+
+const arr = new Uint8Array([1, 2, 3, 4])
+console.log(bufferFrom(arr.buffer, 1, 2))
+//=>
+
+console.log(bufferFrom('test', 'utf8'))
+//=>
+
+const buf = bufferFrom('test')
+console.log(bufferFrom(buf))
+//=>
+```
+
+## API
+
+### bufferFrom(array)
+
+- `array` <Array>
+
+Allocates a new `Buffer` using an `array` of octets.
+
+### bufferFrom(arrayBuffer[, byteOffset[, length]])
+
+- `arrayBuffer` <ArrayBuffer> The `.buffer` property of a TypedArray or ArrayBuffer
+- `byteOffset` <Integer> Where to start copying from `arrayBuffer`. **Default:** `0`
+- `length` <Integer> How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a TypedArray instance, the
+newly created `Buffer` will share the same allocated memory as the TypedArray.
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+### bufferFrom(buffer)
+
+- `buffer` <Buffer> An existing `Buffer` to copy data from
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+### bufferFrom(string[, encoding])
+
+- `string` <String> A string to encode.
+- `encoding` <String> The encoding of `string`. **Default:** `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `string`. If
+provided, the `encoding` parameter identifies the character encoding of
+`string`.
+
+## See also
+
+- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`
+- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe`
diff --git a/Nodejs/node_modules/byline/LICENSE b/Nodejs/node_modules/byline/LICENSE
new file mode 100644
index 0000000..68094b9
--- /dev/null
+++ b/Nodejs/node_modules/byline/LICENSE
@@ -0,0 +1,19 @@
+node-byline (C) 2011-2015 John Hewson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
\ No newline at end of file
diff --git a/Nodejs/node_modules/byline/README.md b/Nodejs/node_modules/byline/README.md
new file mode 100644
index 0000000..2de1a84
--- /dev/null
+++ b/Nodejs/node_modules/byline/README.md
@@ -0,0 +1,147 @@
+# byline — buffered stream for reading lines
+
+
+
+`byline` is a simple module providing a `LineStream`.
+
+- node v0.10 `streams2` (transform stream)
+- supports `pipe`
+- supports both UNIX and Windows line endings
+- supports [Unicode UTS #18 line boundaries](http://www.unicode.org/reports/tr18/#Line_Boundaries)
+- can wrap any readable stream
+- can be used as a readable-writable "through-stream" (transform stream)
+- super-simple: `stream = byline(stream);`
+
+## Install
+
+ npm install byline
+
+or from source:
+
+ git clone git://github.com/jahewson/node-byline.git
+ cd node-byline
+ npm link
+
+# Convenience API
+
+The `byline` module can be used as a function to quickly wrap a readable stream:
+
+```javascript
+var fs = require('fs'),
+ byline = require('byline');
+
+var stream = byline(fs.createReadStream('sample.txt', { encoding: 'utf8' }));
+```
+
+The `data` event then emits lines:
+
+```javascript
+stream.on('data', function(line) {
+ console.log(line);
+});
+```
+
+# Standard API
+
+You just need to add one line to wrap your readable `Stream` with a `LineStream`.
+
+```javascript
+var fs = require('fs'),
+ byline = require('byline');
+
+var stream = fs.createReadStream('sample.txt');
+stream = byline.createStream(stream);
+
+stream.on('data', function(line) {
+ console.log(line);
+});
+```
+
+# Piping
+
+`byline` supports `pipe` (though it strips the line endings, of course).
+
+```javascript
+var stream = fs.createReadStream('sample.txt');
+stream = byline.createStream(stream);
+stream.pipe(fs.createWriteStream('nolines.txt'));
+```
+
+Alternatively, you can create a readable/writable "through-stream" which doesn't wrap any specific
+stream:
+
+```javascript
+var stream = fs.createReadStream('sample.txt');
+stream = byline.createStream(stream);
+stream.pipe(fs.createWriteStream('nolines.txt'));
+
+var input = fs.createReadStream('LICENSE');
+var lineStream = byline.createStream();
+input.pipe(lineStream);
+
+var output = fs.createWriteStream('test.txt');
+lineStream.pipe(output);
+```
+
+# Streams2 API
+
+Node v0.10 added a new streams2 API. This allows the stream to be used in non-flowing mode and is
+preferred over the legacy pause() and resume() methods.
+
+```javascript
+var stream = fs.createReadStream('sample.txt');
+stream = byline.createStream(stream);
+
+stream.on('readable', function() {
+ var line;
+ while (null !== (line = stream.read())) {
+ console.log(line);
+ }
+});
+```
+
+# Transform Stream
+
+The `byline` transform stream can be directly manipulated like so:
+
+```javascript
+var LineStream = require('byline').LineStream;
+
+var input = fs.createReadStream('sample.txt');
+var output = fs.createWriteStream('nolines.txt');
+
+var lineStream = new LineStream();
+input.pipe(lineStream);
+lineStream.pipe(output);
+
+```
+
+# Empty Lines
+
+By default byline skips empty lines, if you want to keep them, pass the `keepEmptyLines` option in
+the call to `byline.createStream(stream, options)` or `byline(stream, options)`.
+
+# Tests
+
+ npm test
+
+# v0.8
+
+If you want to use `node-byline` with node v0.8 then you can use the 2.1.x series. Simply use the
+following in your `package.json`:
+
+```javascript
+ "dependencies": {
+ "byline": ">=2.1.0 <3.0.0"
+},
+```
+
+# Simple
+Unlike other modules (of which there are many), `byline` contains no:
+
+- monkeypatching
+- dependencies
+- non-standard 'line' events which break `pipe`
+- limitations to only file streams
+- CoffeeScript
+- unnecessary code
diff --git a/Nodejs/node_modules/byline/lib/byline.js b/Nodejs/node_modules/byline/lib/byline.js
new file mode 100644
index 0000000..21843cb
--- /dev/null
+++ b/Nodejs/node_modules/byline/lib/byline.js
@@ -0,0 +1,155 @@
+// Copyright (C) 2011-2015 John Hewson
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+
+var stream = require('stream'),
+ util = require('util'),
+ timers = require('timers');
+
+// convinience API
+module.exports = function(readStream, options) {
+ return module.exports.createStream(readStream, options);
+};
+
+// basic API
+module.exports.createStream = function(readStream, options) {
+ if (readStream) {
+ return createLineStream(readStream, options);
+ } else {
+ return new LineStream(options);
+ }
+};
+
+// deprecated API
+module.exports.createLineStream = function(readStream) {
+ console.log('WARNING: byline#createLineStream is deprecated and will be removed soon');
+ return createLineStream(readStream);
+};
+
+function createLineStream(readStream, options) {
+ if (!readStream) {
+ throw new Error('expected readStream');
+ }
+ if (!readStream.readable) {
+ throw new Error('readStream must be readable');
+ }
+ var ls = new LineStream(options);
+ readStream.pipe(ls);
+ return ls;
+}
+
+//
+// using the new node v0.10 "streams2" API
+//
+
+module.exports.LineStream = LineStream;
+
+function LineStream(options) {
+ stream.Transform.call(this, options);
+ options = options || {};
+
+ // use objectMode to stop the output from being buffered
+ // which re-concatanates the lines, just without newlines.
+ this._readableState.objectMode = true;
+ this._lineBuffer = [];
+ this._keepEmptyLines = options.keepEmptyLines || false;
+ this._lastChunkEndedWithCR = false;
+
+ // take the source's encoding if we don't have one
+ var self = this;
+ this.on('pipe', function(src) {
+ if (!self.encoding) {
+ // but we can't do this for old-style streams
+ if (src instanceof stream.Readable) {
+ self.encoding = src._readableState.encoding;
+ }
+ }
+ });
+}
+util.inherits(LineStream, stream.Transform);
+
+LineStream.prototype._transform = function(chunk, encoding, done) {
+ // decode binary chunks as UTF-8
+ encoding = encoding || 'utf8';
+
+ if (Buffer.isBuffer(chunk)) {
+ if (encoding == 'buffer') {
+ chunk = chunk.toString(); // utf8
+ encoding = 'utf8';
+ }
+ else {
+ chunk = chunk.toString(encoding);
+ }
+ }
+ this._chunkEncoding = encoding;
+
+ // see: http://www.unicode.org/reports/tr18/#Line_Boundaries
+ var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g);
+
+ // don't split CRLF which spans chunks
+ if (this._lastChunkEndedWithCR && chunk[0] == '\n') {
+ lines.shift();
+ }
+
+ if (this._lineBuffer.length > 0) {
+ this._lineBuffer[this._lineBuffer.length - 1] += lines[0];
+ lines.shift();
+ }
+
+ this._lastChunkEndedWithCR = chunk[chunk.length - 1] == '\r';
+ this._lineBuffer = this._lineBuffer.concat(lines);
+ this._pushBuffer(encoding, 1, done);
+};
+
+LineStream.prototype._pushBuffer = function(encoding, keep, done) {
+ // always buffer the last (possibly partial) line
+ while (this._lineBuffer.length > keep) {
+ var line = this._lineBuffer.shift();
+ // skip empty lines
+ if (this._keepEmptyLines || line.length > 0 ) {
+ if (!this.push(this._reencode(line, encoding))) {
+ // when the high-water mark is reached, defer pushes until the next tick
+ var self = this;
+ timers.setImmediate(function() {
+ self._pushBuffer(encoding, keep, done);
+ });
+ return;
+ }
+ }
+ }
+ done();
+};
+
+LineStream.prototype._flush = function(done) {
+ this._pushBuffer(this._chunkEncoding, 0, done);
+};
+
+// see Readable::push
+LineStream.prototype._reencode = function(line, chunkEncoding) {
+ if (this.encoding && this.encoding != chunkEncoding) {
+ return new Buffer(line, chunkEncoding).toString(this.encoding);
+ }
+ else if (this.encoding) {
+ // this should be the most common case, i.e. we're using an encoded source stream
+ return line;
+ }
+ else {
+ return new Buffer(line, chunkEncoding);
+ }
+};
diff --git a/Nodejs/node_modules/byline/package.json b/Nodejs/node_modules/byline/package.json
new file mode 100644
index 0000000..4a248ad
--- /dev/null
+++ b/Nodejs/node_modules/byline/package.json
@@ -0,0 +1,56 @@
+{
+ "_from": "byline@^5.0.0",
+ "_id": "byline@5.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE=",
+ "_location": "/byline",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "byline@^5.0.0",
+ "name": "byline",
+ "escapedName": "byline",
+ "rawSpec": "^5.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^5.0.0"
+ },
+ "_requiredBy": [
+ "/pkg-fetch"
+ ],
+ "_resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz",
+ "_shasum": "741c5216468eadc457b03410118ad77de8c1ddb1",
+ "_spec": "byline@^5.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/pkg-fetch",
+ "author": {
+ "name": "John Hewson"
+ },
+ "bugs": {
+ "url": "https://github.com/jahewson/node-byline/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "simple line-by-line stream reader",
+ "devDependencies": {
+ "mocha": "~2.1.0",
+ "request": "~2.27.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "lib"
+ ],
+ "homepage": "https://github.com/jahewson/node-byline",
+ "license": "MIT",
+ "main": "./lib/byline.js",
+ "name": "byline",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jahewson/node-byline.git"
+ },
+ "scripts": {
+ "test": "mocha -R spec --timeout 60000"
+ },
+ "version": "5.0.0"
+}
diff --git a/Nodejs/node_modules/callback-stream/.jshintrc b/Nodejs/node_modules/callback-stream/.jshintrc
new file mode 100644
index 0000000..3d1a1ed
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/.jshintrc
@@ -0,0 +1,60 @@
+{
+ "predef": [ ]
+ , "bitwise": false
+ , "camelcase": false
+ , "curly": false
+ , "eqeqeq": false
+ , "forin": false
+ , "immed": false
+ , "latedef": false
+ , "noarg": true
+ , "noempty": true
+ , "nonew": true
+ , "plusplus": false
+ , "quotmark": true
+ , "regexp": false
+ , "undef": true
+ , "unused": true
+ , "strict": false
+ , "trailing": true
+ , "maxlen": 120
+ , "asi": true
+ , "boss": true
+ , "debug": true
+ , "eqnull": true
+ , "es5": true
+ , "esnext": true
+ , "evil": true
+ , "expr": true
+ , "funcscope": false
+ , "globalstrict": false
+ , "iterator": false
+ , "lastsemic": true
+ , "laxbreak": true
+ , "laxcomma": true
+ , "loopfunc": true
+ , "multistr": false
+ , "onecase": false
+ , "proto": false
+ , "regexdash": false
+ , "scripturl": true
+ , "smarttabs": false
+ , "shadow": false
+ , "sub": true
+ , "supernew": false
+ , "validthis": true
+ , "browser": true
+ , "couch": false
+ , "devel": false
+ , "dojo": false
+ , "mootools": false
+ , "node": true
+ , "nonstandard": true
+ , "prototypejs": false
+ , "rhino": false
+ , "worker": true
+ , "wsh": false
+ , "nomen": false
+ , "onevar": true
+ , "passfail": false
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/.npmignore b/Nodejs/node_modules/callback-stream/.npmignore
new file mode 100644
index 0000000..73734ed
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/.npmignore
@@ -0,0 +1,7 @@
+node_modules/
+build/
+libleveldb.so
+libleveldb.a
+test-data/
+_benchdb_*
+*.sw*
diff --git a/Nodejs/node_modules/callback-stream/.travis.yml b/Nodejs/node_modules/callback-stream/.travis.yml
new file mode 100644
index 0000000..dad2273
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.8
+ - "0.10"
diff --git a/Nodejs/node_modules/callback-stream/README.md b/Nodejs/node_modules/callback-stream/README.md
new file mode 100644
index 0000000..b570888
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/README.md
@@ -0,0 +1,86 @@
+CallbackStream
+=====
+
+[](https://travis-ci.org/mcollina/callback-stream)
+
+It is a safe variant of the
+[concat-stream](https://github.com/maxogden/node-concat-stream)
+package that _will always return an array_.
+
+It does everything callback-stream does, minus the concatenation.
+In fact, it just callbacks you with an array containing your
+good stuff.
+
+It is based on the Stream 2 API, but it also works on node v0.8.
+It also support Stream 3, which is bundled with node v0.12 and iojs.
+
+## Installation
+
+```
+npm install callback-stream --save
+```
+
+## Pipe usage
+
+```js
+var callback = require('callback-stream')
+var fs = require('fs')
+var read = fs.createReadStream('readme.md')
+var write = callback(function (err, data) {
+ console.log(err, data)
+})
+
+read.pipe(write)
+```
+
+## Object mode usage
+
+```
+var callback = require('callback-stream')
+var write = callback.obj(function (err, data) {
+ // this will print ['hello', 'world']
+ console.log(data)
+})
+
+write.write('hello')
+write.write('world')
+write.end()
+```
+
+## Contributing to CallbackStream
+
+* Check out the latest master to make sure the feature hasn't been
+ implemented or the bug hasn't been fixed yet
+* Check out the issue tracker to make sure someone already hasn't
+ requested it and/or contributed it
+* Fork the project
+* Start a feature/bugfix branch
+* Commit and push until you are happy with your contribution
+* Make sure to add tests for it. This is important so I don't break it
+ in a future version unintentionally.
+
+## LICENSE - "MIT License"
+
+Copyright (c) 2013-2015 Matteo Collina, http://matteocollina.com
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Nodejs/node_modules/callback-stream/index.js b/Nodejs/node_modules/callback-stream/index.js
new file mode 100644
index 0000000..0c3e15e
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/index.js
@@ -0,0 +1,51 @@
+'use strict'
+
+var Writable = require('readable-stream').Writable
+var inherits = require('inherits')
+
+function CallbackStream (options, callback) {
+ if (!(this instanceof CallbackStream)) {
+ return new CallbackStream(options, callback)
+ }
+
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ }
+
+ Writable.call(this, options)
+
+ this.results = []
+ this.callback = callback
+
+ this.on('finish', deliversCallback)
+ this.once('pipe', handlePipe)
+}
+
+function deliversCallback () {
+ this.callback(null, this.results)
+}
+
+function handlePipe (source) {
+ source.on('error', this.callback)
+}
+
+inherits(CallbackStream, Writable)
+
+CallbackStream.prototype._write = function (data, encoding, done) {
+ this.results.push(data)
+ done()
+}
+
+CallbackStream.obj = function (options, callback) {
+ if (typeof options === 'function') {
+ callback = options
+ options = {}
+ }
+
+ options.objectMode = true
+
+ return new CallbackStream(options, callback)
+}
+
+module.exports = CallbackStream
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/.travis.yml b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/.travis.yml
new file mode 100644
index 0000000..f62cdac
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/.travis.yml
@@ -0,0 +1,34 @@
+sudo: false
+language: node_js
+before_install:
+ - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ include:
+ - node_js: '0.8'
+ env: NPM_LEGACY=true
+ - node_js: '0.10'
+ env: NPM_LEGACY=true
+ - node_js: '0.11'
+ env: NPM_LEGACY=true
+ - node_js: '0.12'
+ env: NPM_LEGACY=true
+ - node_js: 1
+ env: NPM_LEGACY=true
+ - node_js: 2
+ env: NPM_LEGACY=true
+ - node_js: 3
+ env: NPM_LEGACY=true
+ - node_js: 4
+ - node_js: 5
+ - node_js: 6
+ - node_js: 7
+ - node_js: 8
+ - node_js: 9
+script: "npm run test"
+env:
+ global:
+ - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
+ - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/CONTRIBUTING.md b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/CONTRIBUTING.md
new file mode 100644
index 0000000..f478d58
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/CONTRIBUTING.md
@@ -0,0 +1,38 @@
+# Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+* (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+* (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+* (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+* (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
+
+## Moderation Policy
+
+The [Node.js Moderation Policy] applies to this WG.
+
+## Code of Conduct
+
+The [Node.js Code of Conduct][] applies to this WG.
+
+[Node.js Code of Conduct]:
+https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
+[Node.js Moderation Policy]:
+https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/GOVERNANCE.md b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/GOVERNANCE.md
new file mode 100644
index 0000000..16ffb93
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/GOVERNANCE.md
@@ -0,0 +1,136 @@
+### Streams Working Group
+
+The Node.js Streams is jointly governed by a Working Group
+(WG)
+that is responsible for high-level guidance of the project.
+
+The WG has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+* Conduct guidelines
+* Maintaining the list of additional Collaborators
+
+For the current list of WG members, see the project
+[README.md](./README.md#current-project-team-members).
+
+### Collaborators
+
+The readable-stream GitHub repository is
+maintained by the WG and additional Collaborators who are added by the
+WG on an ongoing basis.
+
+Individuals making significant and valuable contributions are made
+Collaborators and given commit-access to the project. These
+individuals are identified by the WG and their addition as
+Collaborators is discussed during the WG meeting.
+
+_Note:_ If you make a significant contribution and are not considered
+for commit-access log an issue or contact a WG member directly and it
+will be brought up in the next WG meeting.
+
+Modifications of the contents of the readable-stream repository are
+made on
+a collaborative basis. Anybody with a GitHub account may propose a
+modification via pull request and it will be considered by the project
+Collaborators. All pull requests must be reviewed and accepted by a
+Collaborator with sufficient expertise who is able to take full
+responsibility for the change. In the case of pull requests proposed
+by an existing Collaborator, an additional Collaborator is required
+for sign-off. Consensus should be sought if additional Collaborators
+participate and there is disagreement around a particular
+modification. See _Consensus Seeking Process_ below for further detail
+on the consensus model used for governance.
+
+Collaborators may opt to elevate significant or controversial
+modifications, or modifications that have not found consensus to the
+WG for discussion by assigning the ***WG-agenda*** tag to a pull
+request or issue. The WG should serve as the final arbiter where
+required.
+
+For the current list of Collaborators, see the project
+[README.md](./README.md#members).
+
+### WG Membership
+
+WG seats are not time-limited. There is no fixed size of the WG.
+However, the expected target is between 6 and 12, to ensure adequate
+coverage of important areas of expertise, balanced with the ability to
+make decisions efficiently.
+
+There is no specific set of requirements or qualifications for WG
+membership beyond these rules.
+
+The WG may add additional members to the WG by unanimous consensus.
+
+A WG member may be removed from the WG by voluntary resignation, or by
+unanimous consensus of all other WG members.
+
+Changes to WG membership should be posted in the agenda, and may be
+suggested as any other agenda item (see "WG Meetings" below).
+
+If an addition or removal is proposed during a meeting, and the full
+WG is not in attendance to participate, then the addition or removal
+is added to the agenda for the subsequent meeting. This is to ensure
+that all members are given the opportunity to participate in all
+membership decisions. If a WG member is unable to attend a meeting
+where a planned membership decision is being made, then their consent
+is assumed.
+
+No more than 1/3 of the WG members may be affiliated with the same
+employer. If removal or resignation of a WG member, or a change of
+employment by a WG member, creates a situation where more than 1/3 of
+the WG membership shares an employer, then the situation must be
+immediately remedied by the resignation or removal of one or more WG
+members affiliated with the over-represented employer(s).
+
+### WG Meetings
+
+The WG meets occasionally on a Google Hangout On Air. A designated moderator
+approved by the WG runs the meeting. Each meeting should be
+published to YouTube.
+
+Items are added to the WG agenda that are considered contentious or
+are modifications of governance, contribution policy, WG membership,
+or release process.
+
+The intention of the agenda is not to approve or review all patches;
+that should happen continuously on GitHub and be handled by the larger
+group of Collaborators.
+
+Any community member or contributor can ask that something be added to
+the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
+WG member or the moderator can add the item to the agenda by adding
+the ***WG-agenda*** tag to the issue.
+
+Prior to each WG meeting the moderator will share the Agenda with
+members of the WG. WG members can add any items they like to the
+agenda at the beginning of each meeting. The moderator and the WG
+cannot veto or remove items.
+
+The WG may invite persons or representatives from certain projects to
+participate in a non-voting capacity.
+
+The moderator is responsible for summarizing the discussion of each
+agenda item and sends it as a pull request after the meeting.
+
+### Consensus Seeking Process
+
+The WG follows a
+[Consensus
+Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
+decision-making model.
+
+When an agenda item has appeared to reach a consensus the moderator
+will ask "Does anyone object?" as a final call for dissent from the
+consensus.
+
+If an agenda item cannot reach a consensus a WG member can call for
+either a closing vote or a vote to table the issue to the next
+meeting. The call for a vote must be seconded by a majority of the WG
+or else the discussion will continue. Simple majority wins.
+
+Note that changes to WG membership require a majority consensus. See
+"WG Membership" above.
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/LICENSE b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/LICENSE
new file mode 100644
index 0000000..2873b3b
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/LICENSE
@@ -0,0 +1,47 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/README.md b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/README.md
new file mode 100644
index 0000000..23fe3f3
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/README.md
@@ -0,0 +1,58 @@
+# readable-stream
+
+***Node-core v8.11.1 streams for userland*** [](https://travis-ci.org/nodejs/readable-stream)
+
+
+[](https://nodei.co/npm/readable-stream/)
+[](https://nodei.co/npm/readable-stream/)
+
+
+[](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
+
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+# Streams Working Group
+
+`readable-stream` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+
+## Team Members
+
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>
+ - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>
+ - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>
+ - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>
+* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>
+ - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
+* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com>
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
new file mode 100644
index 0000000..83275f1
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
@@ -0,0 +1,60 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+ but, we lose the opportunity to change the model
+ may not be backwards incompatible (double check keys)
+
+ **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+ * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
+
+
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/duplex-browser.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/duplex-browser.js
new file mode 100644
index 0000000..f8b2db8
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/duplex-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_duplex.js');
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/duplex.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/duplex.js
new file mode 100644
index 0000000..46924cb
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/duplex.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Duplex
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_duplex.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000..57003c3
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,131 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+/**/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) {
+ keys.push(key);
+ }return keys;
+};
+/* */
+
+module.exports = Duplex;
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+{
+ // avoid scope creep, the keys array can then be collected
+ var keys = objectKeys(Writable.prototype);
+ for (var v = 0; v < keys.length; v++) {
+ var method = keys[v];
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
+ }
+}
+
+function Duplex(options) {
+ if (!(this instanceof Duplex)) return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false) this.readable = false;
+
+ if (options && options.writable === false) this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended) return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ pna.nextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+ self.end();
+}
+
+Object.defineProperty(Duplex.prototype, 'destroyed', {
+ get: function () {
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed && this._writableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ this._writableState.destroyed = value;
+ }
+});
+
+Duplex.prototype._destroy = function (err, cb) {
+ this.push(null);
+ this.end();
+
+ pna.nextTick(cb, err);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000..612edb4
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,47 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough)) return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+ cb(null, chunk);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_readable.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000..0f80764
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,1019 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+module.exports = Readable;
+
+/**/
+var isArray = require('isarray');
+/* */
+
+/**/
+var Duplex;
+/* */
+
+Readable.ReadableState = ReadableState;
+
+/**/
+var EE = require('events').EventEmitter;
+
+var EElistenerCount = function (emitter, type) {
+ return emitter.listeners(type).length;
+};
+/* */
+
+/**/
+var Stream = require('./internal/streams/stream');
+/* */
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/* */
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+/**/
+var debugUtil = require('util');
+var debug = void 0;
+if (debugUtil && debugUtil.debuglog) {
+ debug = debugUtil.debuglog('stream');
+} else {
+ debug = function () {};
+}
+/* */
+
+var BufferList = require('./internal/streams/BufferList');
+var destroyImpl = require('./internal/streams/destroy');
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
+
+function prependListener(emitter, event, fn) {
+ // Sadly this is not cacheable as some libraries bundle their own
+ // event emitter implementation with them.
+ if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
+
+ // This is a hack to make sure that our error handler is attached before any
+ // userland ones. NEVER DO THIS. This is here only because this code needs
+ // to continue to work with older versions of Node.js that do not include
+ // the prependListener() method. The goal is to eventually remove this hack.
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
+}
+
+function ReadableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ var isDuplex = stream instanceof Duplex;
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ var readableHwm = options.readableHighWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = Math.floor(this.highWaterMark);
+
+ // A linked list is used to store data chunks instead of an array because the
+ // linked list can remove elements from the beginning faster than
+ // array.shift()
+ this.buffer = new BufferList();
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = null;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // a flag to be able to tell if the event 'readable'/'data' is emitted
+ // immediately, or on a later tick. We set this to true at first, because
+ // any actions that shouldn't happen until "later" should generally also
+ // not happen before the first read call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+ this.resumeScheduled = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+
+function Readable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ if (!(this instanceof Readable)) return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ if (options) {
+ if (typeof options.read === 'function') this._read = options.read;
+
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+ }
+
+ Stream.call(this);
+}
+
+Object.defineProperty(Readable.prototype, 'destroyed', {
+ get: function () {
+ if (this._readableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._readableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ }
+});
+
+Readable.prototype.destroy = destroyImpl.destroy;
+Readable.prototype._undestroy = destroyImpl.undestroy;
+Readable.prototype._destroy = function (err, cb) {
+ this.push(null);
+ cb(err);
+};
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+ var state = this._readableState;
+ var skipChunkCheck;
+
+ if (!state.objectMode) {
+ if (typeof chunk === 'string') {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = Buffer.from(chunk, encoding);
+ encoding = '';
+ }
+ skipChunkCheck = true;
+ }
+ } else {
+ skipChunkCheck = true;
+ }
+
+ return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function (chunk) {
+ return readableAddChunk(this, chunk, null, true, false);
+};
+
+function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
+ var state = stream._readableState;
+ if (chunk === null) {
+ state.reading = false;
+ onEofChunk(stream, state);
+ } else {
+ var er;
+ if (!skipChunkCheck) er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+
+ if (addToFront) {
+ if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
+ } else if (state.ended) {
+ stream.emit('error', new Error('stream.push() after EOF'));
+ } else {
+ state.reading = false;
+ if (state.decoder && !encoding) {
+ chunk = state.decoder.write(chunk);
+ if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
+ } else {
+ addChunk(stream, state, chunk, false);
+ }
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ }
+ }
+
+ return needMoreData(state);
+}
+
+function addChunk(stream, state, chunk, addToFront) {
+ if (state.flowing && state.length === 0 && !state.sync) {
+ stream.emit('data', chunk);
+ stream.read(0);
+ } else {
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+
+ if (state.needReadable) emitReadable(stream);
+ }
+ maybeReadMore(stream, state);
+}
+
+function chunkInvalid(state, chunk) {
+ var er;
+ if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+}
+
+Readable.prototype.isPaused = function () {
+ return this._readableState.flowing === false;
+};
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+ this._readableState.encoding = enc;
+ return this;
+};
+
+// Don't raise the hwm > 8MB
+var MAX_HWM = 0x800000;
+function computeNewHighWaterMark(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2 to prevent increasing hwm excessively in
+ // tiny amounts
+ n--;
+ n |= n >>> 1;
+ n |= n >>> 2;
+ n |= n >>> 4;
+ n |= n >>> 8;
+ n |= n >>> 16;
+ n++;
+ }
+ return n;
+}
+
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function howMuchToRead(n, state) {
+ if (n <= 0 || state.length === 0 && state.ended) return 0;
+ if (state.objectMode) return 1;
+ if (n !== n) {
+ // Only flow one buffer at a time
+ if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
+ }
+ // If we're asking for more than the current hwm, then raise the hwm.
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
+ if (n <= state.length) return n;
+ // Don't have enough
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ }
+ return state.length;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function (n) {
+ debug('read', n);
+ n = parseInt(n, 10);
+ var state = this._readableState;
+ var nOrig = n;
+
+ if (n !== 0) state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
+ debug('read: emitReadable', state.length, state.ended);
+ if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0) endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+ debug('need readable', doRead);
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
+ doRead = true;
+ debug('length less than watermark', doRead);
+ }
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading) {
+ doRead = false;
+ debug('reading or ended', doRead);
+ } else if (doRead) {
+ debug('do read');
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0) state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (!state.reading) n = howMuchToRead(nOrig, state);
+ }
+
+ var ret;
+ if (n > 0) ret = fromList(n, state);else ret = null;
+
+ if (ret === null) {
+ state.needReadable = true;
+ n = 0;
+ } else {
+ state.length -= n;
+ }
+
+ if (state.length === 0) {
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (!state.ended) state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended) endReadable(this);
+ }
+
+ if (ret !== null) this.emit('data', ret);
+
+ return ret;
+};
+
+function onEofChunk(stream, state) {
+ if (state.ended) return;
+ if (state.decoder) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // emit 'readable' now to make sure it gets picked up.
+ emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ debug('emitReadable', state.flowing);
+ state.emittedReadable = true;
+ if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
+ }
+}
+
+function emitReadable_(stream) {
+ debug('emit readable');
+ stream.emit('readable');
+ flow(stream);
+}
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ pna.nextTick(maybeReadMore_, stream, state);
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
+ debug('maybeReadMore read 0');
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;else len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function (n) {
+ this.emit('error', new Error('_read() is not implemented'));
+};
+
+Readable.prototype.pipe = function (dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+
+ var endFn = doEnd ? onend : unpipe;
+ if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable, unpipeInfo) {
+ debug('onunpipe');
+ if (readable === src) {
+ if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
+ unpipeInfo.hasUnpiped = true;
+ cleanup();
+ }
+ }
+ }
+
+ function onend() {
+ debug('onend');
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ var cleanedUp = false;
+ function cleanup() {
+ debug('cleanup');
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', unpipe);
+ src.removeListener('data', ondata);
+
+ cleanedUp = true;
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+ }
+
+ // If the user pushes more data while we're writing to dest then we'll end up
+ // in ondata again. However, we only want to increase awaitDrain once because
+ // dest will only emit one 'drain' event for the multiple writes.
+ // => Introduce a guard on increasing awaitDrain.
+ var increasedAwaitDrain = false;
+ src.on('data', ondata);
+ function ondata(chunk) {
+ debug('ondata');
+ increasedAwaitDrain = false;
+ var ret = dest.write(chunk);
+ if (false === ret && !increasedAwaitDrain) {
+ // If the user unpiped during `dest.write()`, it is possible
+ // to get stuck in a permanently paused state if that write
+ // also returned false.
+ // => Check whether `dest` is still a piping destination.
+ if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
+ debug('false write response, pause', src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
+ increasedAwaitDrain = true;
+ }
+ src.pause();
+ }
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ debug('onerror', er);
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
+ }
+
+ // Make sure our error handler is attached before userland ones.
+ prependListener(dest, 'error', onerror);
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ debug('onfinish');
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ debug('unpipe');
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ debug('pipe resume');
+ src.resume();
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function () {
+ var state = src._readableState;
+ debug('pipeOnDrain', state.awaitDrain);
+ if (state.awaitDrain) state.awaitDrain--;
+ if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+ state.flowing = true;
+ flow(src);
+ }
+ };
+}
+
+Readable.prototype.unpipe = function (dest) {
+ var state = this._readableState;
+ var unpipeInfo = { hasUnpiped: false };
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0) return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes) return this;
+
+ if (!dest) dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ if (dest) dest.emit('unpipe', this, unpipeInfo);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+
+ for (var i = 0; i < len; i++) {
+ dests[i].emit('unpipe', this, unpipeInfo);
+ }return this;
+ }
+
+ // try to find the right one.
+ var index = indexOf(state.pipes, dest);
+ if (index === -1) return this;
+
+ state.pipes.splice(index, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this, unpipeInfo);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ if (ev === 'data') {
+ // Start flowing on next tick if stream isn't explicitly paused
+ if (this._readableState.flowing !== false) this.resume();
+ } else if (ev === 'readable') {
+ var state = this._readableState;
+ if (!state.endEmitted && !state.readableListening) {
+ state.readableListening = state.needReadable = true;
+ state.emittedReadable = false;
+ if (!state.reading) {
+ pna.nextTick(nReadingNextTick, this);
+ } else if (state.length) {
+ emitReadable(this);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+function nReadingNextTick(self) {
+ debug('readable nexttick read 0');
+ self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+ var state = this._readableState;
+ if (!state.flowing) {
+ debug('resume');
+ state.flowing = true;
+ resume(this, state);
+ }
+ return this;
+};
+
+function resume(stream, state) {
+ if (!state.resumeScheduled) {
+ state.resumeScheduled = true;
+ pna.nextTick(resume_, stream, state);
+ }
+}
+
+function resume_(stream, state) {
+ if (!state.reading) {
+ debug('resume read 0');
+ stream.read(0);
+ }
+
+ state.resumeScheduled = false;
+ state.awaitDrain = 0;
+ stream.emit('resume');
+ flow(stream);
+ if (state.flowing && !state.reading) stream.read(0);
+}
+
+Readable.prototype.pause = function () {
+ debug('call pause flowing=%j', this._readableState.flowing);
+ if (false !== this._readableState.flowing) {
+ debug('pause');
+ this._readableState.flowing = false;
+ this.emit('pause');
+ }
+ return this;
+};
+
+function flow(stream) {
+ var state = stream._readableState;
+ debug('flow', state.flowing);
+ while (state.flowing && stream.read() !== null) {}
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+ var _this = this;
+
+ var state = this._readableState;
+ var paused = false;
+
+ stream.on('end', function () {
+ debug('wrapped end');
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) _this.push(chunk);
+ }
+
+ _this.push(null);
+ });
+
+ stream.on('data', function (chunk) {
+ debug('wrapped data');
+ if (state.decoder) chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+
+ var ret = _this.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (this[i] === undefined && typeof stream[i] === 'function') {
+ this[i] = function (method) {
+ return function () {
+ return stream[method].apply(stream, arguments);
+ };
+ }(i);
+ }
+ }
+
+ // proxy certain important events.
+ for (var n = 0; n < kProxyEvents.length; n++) {
+ stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
+ }
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ this._read = function (n) {
+ debug('wrapped _read', n);
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+
+ return this;
+};
+
+Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._readableState.highWaterMark;
+ }
+});
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromList(n, state) {
+ // nothing buffered
+ if (state.length === 0) return null;
+
+ var ret;
+ if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
+ // read it all, truncate the list
+ if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
+ state.buffer.clear();
+ } else {
+ // read part of list
+ ret = fromListPartial(n, state.buffer, state.decoder);
+ }
+
+ return ret;
+}
+
+// Extracts only enough buffered data to satisfy the amount requested.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromListPartial(n, list, hasStrings) {
+ var ret;
+ if (n < list.head.data.length) {
+ // slice is the same for buffers and strings
+ ret = list.head.data.slice(0, n);
+ list.head.data = list.head.data.slice(n);
+ } else if (n === list.head.data.length) {
+ // first chunk is a perfect match
+ ret = list.shift();
+ } else {
+ // result spans more than one buffer
+ ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
+ }
+ return ret;
+}
+
+// Copies a specified amount of characters from the list of buffered data
+// chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBufferString(n, list) {
+ var p = list.head;
+ var c = 1;
+ var ret = p.data;
+ n -= ret.length;
+ while (p = p.next) {
+ var str = p.data;
+ var nb = n > str.length ? str.length : n;
+ if (nb === str.length) ret += str;else ret += str.slice(0, n);
+ n -= nb;
+ if (n === 0) {
+ if (nb === str.length) {
+ ++c;
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
+ } else {
+ list.head = p;
+ p.data = str.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ list.length -= c;
+ return ret;
+}
+
+// Copies a specified amount of bytes from the list of buffered data chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBuffer(n, list) {
+ var ret = Buffer.allocUnsafe(n);
+ var p = list.head;
+ var c = 1;
+ p.data.copy(ret);
+ n -= p.data.length;
+ while (p = p.next) {
+ var buf = p.data;
+ var nb = n > buf.length ? buf.length : n;
+ buf.copy(ret, ret.length - n, 0, nb);
+ n -= nb;
+ if (n === 0) {
+ if (nb === buf.length) {
+ ++c;
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
+ } else {
+ list.head = p;
+ p.data = buf.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ list.length -= c;
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
+
+ if (!state.endEmitted) {
+ state.ended = true;
+ pna.nextTick(endReadableNT, state, stream);
+ }
+}
+
+function endReadableNT(state, stream) {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+}
+
+function indexOf(xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_transform.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000..fcfc105
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,214 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+util.inherits(Transform, Duplex);
+
+function afterTransform(er, data) {
+ var ts = this._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb) {
+ return this.emit('error', new Error('write callback called multiple times'));
+ }
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (data != null) // single equals check for both `null` and `undefined`
+ this.push(data);
+
+ cb(er);
+
+ var rs = this._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ this._read(rs.highWaterMark);
+ }
+}
+
+function Transform(options) {
+ if (!(this instanceof Transform)) return new Transform(options);
+
+ Duplex.call(this, options);
+
+ this._transformState = {
+ afterTransform: afterTransform.bind(this),
+ needTransform: false,
+ transforming: false,
+ writecb: null,
+ writechunk: null,
+ writeencoding: null
+ };
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ if (options) {
+ if (typeof options.transform === 'function') this._transform = options.transform;
+
+ if (typeof options.flush === 'function') this._flush = options.flush;
+ }
+
+ // When the writable side finishes, then flush out anything remaining.
+ this.on('prefinish', prefinish);
+}
+
+function prefinish() {
+ var _this = this;
+
+ if (typeof this._flush === 'function') {
+ this._flush(function (er, data) {
+ done(_this, er, data);
+ });
+ } else {
+ done(this, null, null);
+ }
+}
+
+Transform.prototype.push = function (chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function (chunk, encoding, cb) {
+ throw new Error('_transform() is not implemented');
+};
+
+Transform.prototype._write = function (chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function (n) {
+ var ts = this._transformState;
+
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+Transform.prototype._destroy = function (err, cb) {
+ var _this2 = this;
+
+ Duplex.prototype._destroy.call(this, err, function (err2) {
+ cb(err2);
+ _this2.emit('close');
+ });
+};
+
+function done(stream, er, data) {
+ if (er) return stream.emit('error', er);
+
+ if (data != null) // single equals check for both `null` and `undefined`
+ stream.push(data);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
+
+ if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
+
+ return stream.push(null);
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_writable.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000..b0b0220
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,687 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+module.exports = Writable;
+
+/* */
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+ this.next = null;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+ var _this = this;
+
+ this.next = null;
+ this.entry = null;
+ this.finish = function () {
+ onCorkedFinish(_this, state);
+ };
+}
+/* */
+
+/**/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
+/* */
+
+/**/
+var Duplex;
+/* */
+
+Writable.WritableState = WritableState;
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+/**/
+var internalUtil = {
+ deprecate: require('util-deprecate')
+};
+/* */
+
+/**/
+var Stream = require('./internal/streams/stream');
+/* */
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/* */
+
+var destroyImpl = require('./internal/streams/destroy');
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WritableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ var isDuplex = stream instanceof Duplex;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var writableHwm = options.writableHighWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = Math.floor(this.highWaterMark);
+
+ // if _final has been called
+ this.finalCalled = false;
+
+ // drain event flag.
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function (er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+
+ // count buffered requests
+ this.bufferedRequestCount = 0;
+
+ // allocate the first CorkedRequest, there is always
+ // one allocated and free to use, and we maintain at most two
+ this.corkedRequestsFree = new CorkedRequest(this);
+}
+
+WritableState.prototype.getBuffer = function getBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+
+(function () {
+ try {
+ Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: internalUtil.deprecate(function () {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
+ });
+ } catch (_) {}
+})();
+
+// Test _writableState for inheritance to account for Duplex streams,
+// whose prototype chain only points to Readable.
+var realHasInstance;
+if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
+ realHasInstance = Function.prototype[Symbol.hasInstance];
+ Object.defineProperty(Writable, Symbol.hasInstance, {
+ value: function (object) {
+ if (realHasInstance.call(this, object)) return true;
+ if (this !== Writable) return false;
+
+ return object && object._writableState instanceof WritableState;
+ }
+ });
+} else {
+ realHasInstance = function (object) {
+ return object instanceof this;
+ };
+}
+
+function Writable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, too.
+ // `realHasInstance` is necessary because using plain `instanceof`
+ // would return false, as no `_writableState` property is attached.
+
+ // Trying to use the custom `instanceof` for Writable here will also break the
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
+ // `_writableState` that would lead to infinite recursion.
+ if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
+ return new Writable(options);
+ }
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ if (options) {
+ if (typeof options.write === 'function') this._write = options.write;
+
+ if (typeof options.writev === 'function') this._writev = options.writev;
+
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+
+ if (typeof options.final === 'function') this._final = options.final;
+ }
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+ this.emit('error', new Error('Cannot pipe, not readable'));
+};
+
+function writeAfterEnd(stream, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+}
+
+// Checks that a user-supplied chunk is valid, especially for the particular
+// mode the stream is in. Currently this means that `null` is never accepted
+// and undefined/non-string values are only allowed in object mode.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+ var er = false;
+
+ if (chunk === null) {
+ er = new TypeError('May not write null values to stream');
+ } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ if (er) {
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function (chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+ var isBuf = !state.objectMode && _isUint8Array(chunk);
+
+ if (isBuf && !Buffer.isBuffer(chunk)) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+
+ if (typeof cb !== 'function') cb = nop;
+
+ if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+ }
+
+ return ret;
+};
+
+Writable.prototype.cork = function () {
+ var state = this._writableState;
+
+ state.corked++;
+};
+
+Writable.prototype.uncork = function () {
+ var state = this._writableState;
+
+ if (state.corked) {
+ state.corked--;
+
+ if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
+ this._writableState.defaultEncoding = encoding;
+ return this;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+ chunk = Buffer.from(chunk, encoding);
+ }
+ return chunk;
+}
+
+Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
+ if (!isBuf) {
+ var newChunk = decodeChunk(state, chunk, encoding);
+ if (chunk !== newChunk) {
+ isBuf = true;
+ encoding = 'buffer';
+ chunk = newChunk;
+ }
+ }
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret) state.needDrain = true;
+
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = {
+ chunk: chunk,
+ encoding: encoding,
+ isBuf: isBuf,
+ callback: cb,
+ next: null
+ };
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ state.bufferedRequestCount += 1;
+ } else {
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
+
+ return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
+
+ if (sync) {
+ // defer the callback if we are being called synchronously
+ // to avoid piling up things on the stack
+ pna.nextTick(cb, er);
+ // this can emit finish, and it will always happen
+ // after error
+ pna.nextTick(finishMaybe, stream, state);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ } else {
+ // the caller expect this to happen before if
+ // it is async
+ cb(er);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ // this can emit finish, but finish must
+ // always follow error
+ finishMaybe(stream, state);
+ }
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er) onwriteError(stream, state, sync, er, cb);else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(state);
+
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+ clearBuffer(stream, state);
+ }
+
+ if (sync) {
+ /**/
+ asyncWrite(afterWrite, stream, state, finished, cb);
+ /* */
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished) onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
+
+ if (stream._writev && entry && entry.next) {
+ // Fast case, write everything using _writev()
+ var l = state.bufferedRequestCount;
+ var buffer = new Array(l);
+ var holder = state.corkedRequestsFree;
+ holder.entry = entry;
+
+ var count = 0;
+ var allBuffers = true;
+ while (entry) {
+ buffer[count] = entry;
+ if (!entry.isBuf) allBuffers = false;
+ entry = entry.next;
+ count += 1;
+ }
+ buffer.allBuffers = allBuffers;
+
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+ // doWrite is almost always async, defer these to save a bit of time
+ // as the hot path ends with doWrite
+ state.pendingcb++;
+ state.lastBufferedRequest = null;
+ if (holder.next) {
+ state.corkedRequestsFree = holder.next;
+ holder.next = null;
+ } else {
+ state.corkedRequestsFree = new CorkedRequest(state);
+ }
+ state.bufferedRequestCount = 0;
+ } else {
+ // Slow case, write chunks one-by-one
+ while (entry) {
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ entry = entry.next;
+ state.bufferedRequestCount--;
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ break;
+ }
+ }
+
+ if (entry === null) state.lastBufferedRequest = null;
+ }
+
+ state.bufferedRequest = entry;
+ state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function (chunk, encoding, cb) {
+ cb(new Error('_write() is not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function (chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+
+function needFinish(state) {
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+function callFinal(stream, state) {
+ stream._final(function (err) {
+ state.pendingcb--;
+ if (err) {
+ stream.emit('error', err);
+ }
+ state.prefinished = true;
+ stream.emit('prefinish');
+ finishMaybe(stream, state);
+ });
+}
+function prefinish(stream, state) {
+ if (!state.prefinished && !state.finalCalled) {
+ if (typeof stream._final === 'function') {
+ state.pendingcb++;
+ state.finalCalled = true;
+ pna.nextTick(callFinal, stream, state);
+ } else {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+ }
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(state);
+ if (need) {
+ prefinish(stream, state);
+ if (state.pendingcb === 0) {
+ state.finished = true;
+ stream.emit('finish');
+ }
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
+ }
+ state.ended = true;
+ stream.writable = false;
+}
+
+function onCorkedFinish(corkReq, state, err) {
+ var entry = corkReq.entry;
+ corkReq.entry = null;
+ while (entry) {
+ var cb = entry.callback;
+ state.pendingcb--;
+ cb(err);
+ entry = entry.next;
+ }
+ if (state.corkedRequestsFree) {
+ state.corkedRequestsFree.next = corkReq;
+ } else {
+ state.corkedRequestsFree = corkReq;
+ }
+}
+
+Object.defineProperty(Writable.prototype, 'destroyed', {
+ get: function () {
+ if (this._writableState === undefined) {
+ return false;
+ }
+ return this._writableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._writableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._writableState.destroyed = value;
+ }
+});
+
+Writable.prototype.destroy = destroyImpl.destroy;
+Writable.prototype._undestroy = destroyImpl.undestroy;
+Writable.prototype._destroy = function (err, cb) {
+ this.end();
+ cb(err);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js
new file mode 100644
index 0000000..aefc68b
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js
@@ -0,0 +1,79 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Buffer = require('safe-buffer').Buffer;
+var util = require('util');
+
+function copyBuffer(src, target, offset) {
+ src.copy(target, offset);
+}
+
+module.exports = function () {
+ function BufferList() {
+ _classCallCheck(this, BufferList);
+
+ this.head = null;
+ this.tail = null;
+ this.length = 0;
+ }
+
+ BufferList.prototype.push = function push(v) {
+ var entry = { data: v, next: null };
+ if (this.length > 0) this.tail.next = entry;else this.head = entry;
+ this.tail = entry;
+ ++this.length;
+ };
+
+ BufferList.prototype.unshift = function unshift(v) {
+ var entry = { data: v, next: this.head };
+ if (this.length === 0) this.tail = entry;
+ this.head = entry;
+ ++this.length;
+ };
+
+ BufferList.prototype.shift = function shift() {
+ if (this.length === 0) return;
+ var ret = this.head.data;
+ if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
+ --this.length;
+ return ret;
+ };
+
+ BufferList.prototype.clear = function clear() {
+ this.head = this.tail = null;
+ this.length = 0;
+ };
+
+ BufferList.prototype.join = function join(s) {
+ if (this.length === 0) return '';
+ var p = this.head;
+ var ret = '' + p.data;
+ while (p = p.next) {
+ ret += s + p.data;
+ }return ret;
+ };
+
+ BufferList.prototype.concat = function concat(n) {
+ if (this.length === 0) return Buffer.alloc(0);
+ if (this.length === 1) return this.head.data;
+ var ret = Buffer.allocUnsafe(n >>> 0);
+ var p = this.head;
+ var i = 0;
+ while (p) {
+ copyBuffer(p.data, ret, i);
+ i += p.data.length;
+ p = p.next;
+ }
+ return ret;
+ };
+
+ return BufferList;
+}();
+
+if (util && util.inspect && util.inspect.custom) {
+ module.exports.prototype[util.inspect.custom] = function () {
+ var obj = util.inspect({ length: this.length });
+ return this.constructor.name + ' ' + obj;
+ };
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/destroy.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/destroy.js
new file mode 100644
index 0000000..5a0a0d8
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/destroy.js
@@ -0,0 +1,74 @@
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+// undocumented cb() API, needed for core, not for public API
+function destroy(err, cb) {
+ var _this = this;
+
+ var readableDestroyed = this._readableState && this._readableState.destroyed;
+ var writableDestroyed = this._writableState && this._writableState.destroyed;
+
+ if (readableDestroyed || writableDestroyed) {
+ if (cb) {
+ cb(err);
+ } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
+ pna.nextTick(emitErrorNT, this, err);
+ }
+ return this;
+ }
+
+ // we set destroyed to true before firing error callbacks in order
+ // to make it re-entrance safe in case destroy() is called within callbacks
+
+ if (this._readableState) {
+ this._readableState.destroyed = true;
+ }
+
+ // if this is a duplex stream mark the writable part as destroyed as well
+ if (this._writableState) {
+ this._writableState.destroyed = true;
+ }
+
+ this._destroy(err || null, function (err) {
+ if (!cb && err) {
+ pna.nextTick(emitErrorNT, _this, err);
+ if (_this._writableState) {
+ _this._writableState.errorEmitted = true;
+ }
+ } else if (cb) {
+ cb(err);
+ }
+ });
+
+ return this;
+}
+
+function undestroy() {
+ if (this._readableState) {
+ this._readableState.destroyed = false;
+ this._readableState.reading = false;
+ this._readableState.ended = false;
+ this._readableState.endEmitted = false;
+ }
+
+ if (this._writableState) {
+ this._writableState.destroyed = false;
+ this._writableState.ended = false;
+ this._writableState.ending = false;
+ this._writableState.finished = false;
+ this._writableState.errorEmitted = false;
+ }
+}
+
+function emitErrorNT(self, err) {
+ self.emit('error', err);
+}
+
+module.exports = {
+ destroy: destroy,
+ undestroy: undestroy
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js
new file mode 100644
index 0000000..9332a3f
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js
@@ -0,0 +1 @@
+module.exports = require('events').EventEmitter;
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/stream.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/stream.js
new file mode 100644
index 0000000..ce2ad5b
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/lib/internal/streams/stream.js
@@ -0,0 +1 @@
+module.exports = require('stream');
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/package.json b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/package.json
new file mode 100644
index 0000000..47f42d2
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/package.json
@@ -0,0 +1,81 @@
+{
+ "_from": "readable-stream@> 1.0.0 < 3.0.0",
+ "_id": "readable-stream@2.3.7",
+ "_inBundle": false,
+ "_integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "_location": "/callback-stream/readable-stream",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "readable-stream@> 1.0.0 < 3.0.0",
+ "name": "readable-stream",
+ "escapedName": "readable-stream",
+ "rawSpec": "> 1.0.0 < 3.0.0",
+ "saveSpec": null,
+ "fetchSpec": "> 1.0.0 < 3.0.0"
+ },
+ "_requiredBy": [
+ "/callback-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "_shasum": "1eca1cf711aef814c04f62252a36a62f6cb23b57",
+ "_spec": "readable-stream@> 1.0.0 < 3.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/callback-stream",
+ "browser": {
+ "util": false,
+ "./readable.js": "./readable-browser.js",
+ "./writable.js": "./writable-browser.js",
+ "./duplex.js": "./duplex-browser.js",
+ "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
+ },
+ "bugs": {
+ "url": "https://github.com/nodejs/readable-stream/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ },
+ "deprecated": false,
+ "description": "Streams3, a user-land copy of the stream library from Node.js",
+ "devDependencies": {
+ "assert": "^1.4.0",
+ "babel-polyfill": "^6.9.1",
+ "buffer": "^4.9.0",
+ "lolex": "^2.3.2",
+ "nyc": "^6.4.0",
+ "tap": "^0.7.0",
+ "tape": "^4.8.0"
+ },
+ "homepage": "https://github.com/nodejs/readable-stream#readme",
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "license": "MIT",
+ "main": "readable.js",
+ "name": "readable-stream",
+ "nyc": {
+ "include": [
+ "lib/**.js"
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/readable-stream.git"
+ },
+ "scripts": {
+ "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+ "cover": "nyc npm test",
+ "report": "nyc report --reporter=lcov",
+ "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js"
+ },
+ "version": "2.3.7"
+}
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/passthrough.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/passthrough.js
new file mode 100644
index 0000000..ffd791d
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/passthrough.js
@@ -0,0 +1 @@
+module.exports = require('./readable').PassThrough
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/readable-browser.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/readable-browser.js
new file mode 100644
index 0000000..e503725
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/readable-browser.js
@@ -0,0 +1,7 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/readable.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/readable.js
new file mode 100644
index 0000000..ec89ec5
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/readable.js
@@ -0,0 +1,19 @@
+var Stream = require('stream');
+if (process.env.READABLE_STREAM === 'disable' && Stream) {
+ module.exports = Stream;
+ exports = module.exports = Stream.Readable;
+ exports.Readable = Stream.Readable;
+ exports.Writable = Stream.Writable;
+ exports.Duplex = Stream.Duplex;
+ exports.Transform = Stream.Transform;
+ exports.PassThrough = Stream.PassThrough;
+ exports.Stream = Stream;
+} else {
+ exports = module.exports = require('./lib/_stream_readable.js');
+ exports.Stream = Stream || exports;
+ exports.Readable = exports;
+ exports.Writable = require('./lib/_stream_writable.js');
+ exports.Duplex = require('./lib/_stream_duplex.js');
+ exports.Transform = require('./lib/_stream_transform.js');
+ exports.PassThrough = require('./lib/_stream_passthrough.js');
+}
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/transform.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/transform.js
new file mode 100644
index 0000000..b1baba2
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/transform.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Transform
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/writable-browser.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/writable-browser.js
new file mode 100644
index 0000000..ebdde6a
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/writable-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_writable.js');
diff --git a/Nodejs/node_modules/callback-stream/node_modules/readable-stream/writable.js b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/writable.js
new file mode 100644
index 0000000..3211a6f
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/readable-stream/writable.js
@@ -0,0 +1,8 @@
+var Stream = require("stream")
+var Writable = require("./lib/_stream_writable.js")
+
+if (process.env.READABLE_STREAM === 'disable') {
+ module.exports = Stream && Stream.Writable || Writable
+} else {
+ module.exports = Writable
+}
diff --git a/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/LICENSE b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/LICENSE
new file mode 100644
index 0000000..0c068ce
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/README.md b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/README.md
new file mode 100644
index 0000000..e9a81af
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/README.md
@@ -0,0 +1,584 @@
+# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/safe-buffer
+[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
+[npm-url]: https://npmjs.org/package/safe-buffer
+[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
+[downloads-url]: https://npmjs.org/package/safe-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### Safer Node.js Buffer API
+
+**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
+`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
+
+**Uses the built-in implementation when available.**
+
+## install
+
+```
+npm install safe-buffer
+```
+
+## usage
+
+The goal of this package is to provide a safe replacement for the node.js `Buffer`.
+
+It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
+the top of your node.js modules:
+
+```js
+var Buffer = require('safe-buffer').Buffer
+
+// Existing buffer code will continue to work without issues:
+
+new Buffer('hey', 'utf8')
+new Buffer([1, 2, 3], 'utf8')
+new Buffer(obj)
+new Buffer(16) // create an uninitialized buffer (potentially unsafe)
+
+// But you can use these new explicit APIs to make clear what you want:
+
+Buffer.from('hey', 'utf8') // convert from many types to a Buffer
+Buffer.alloc(16) // create a zero-filled buffer (safe)
+Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
+```
+
+## api
+
+### Class Method: Buffer.from(array)
+
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+ // creates a new Buffer containing ASCII bytes
+ // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+ a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+ // Prints:
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+ // Prints:
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+ // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+ // 'auffer'
+console.log(buf2.toString());
+ // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+ // prints: this is a tést
+console.log(buf1.toString('ascii'));
+ // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+ // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+ //
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+ //
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+ //
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+ //
+ // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+ //
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+ const data = socket.read();
+ // allocate for retained data
+ const sb = Buffer.allocUnsafeSlow(10);
+ // copy the data into the new allocation
+ data.copy(sb, 0, 0, 10);
+ store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+ return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+ var data = ''
+ req.setEncoding('utf8')
+ req.on('data', function (chunk) {
+ data += chunk
+ })
+ req.on('end', function () {
+ var body = JSON.parse(data)
+ res.end(new Buffer(body.str).toString('hex'))
+ })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+ "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+ socket.on('message', function (message) {
+ message = JSON.parse(message)
+ if (message.type === 'echo') {
+ socket.send(message.data) // send back the user's message
+ }
+ })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/index.d.ts b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/index.d.ts
new file mode 100644
index 0000000..e9fed80
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/index.d.ts
@@ -0,0 +1,187 @@
+declare module "safe-buffer" {
+ export class Buffer {
+ length: number
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ constructor (str: string, encoding?: string);
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ constructor (size: number);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: Uint8Array);
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ constructor (arrayBuffer: ArrayBuffer);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: any[]);
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ constructor (buffer: Buffer);
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ static from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ static from(buffer: Buffer): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ static from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ static isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ static isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ static byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ static concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ static compare(buf1: Buffer, buf2: Buffer): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initalizing
+ */
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafeSlow(size: number): Buffer;
+ }
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/index.js b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/index.js
new file mode 100644
index 0000000..22438da
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/index.js
@@ -0,0 +1,62 @@
+/* eslint-disable node/no-deprecated-api */
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+// alternative to using Object.keys for old browsers
+function copyProps (src, dst) {
+ for (var key in src) {
+ dst[key] = src[key]
+ }
+}
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+ module.exports = buffer
+} else {
+ // Copy properties from require('buffer')
+ copyProps(buffer, exports)
+ exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+// Copy static methods from Buffer
+copyProps(Buffer, SafeBuffer)
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+ if (typeof arg === 'number') {
+ throw new TypeError('Argument must not be a number')
+ }
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ var buf = Buffer(size)
+ if (fill !== undefined) {
+ if (typeof encoding === 'string') {
+ buf.fill(fill, encoding)
+ } else {
+ buf.fill(fill)
+ }
+ } else {
+ buf.fill(0)
+ }
+ return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return buffer.SlowBuffer(size)
+}
diff --git a/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/package.json b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/package.json
new file mode 100644
index 0000000..424b4aa
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/safe-buffer/package.json
@@ -0,0 +1,63 @@
+{
+ "_from": "safe-buffer@~5.1.1",
+ "_id": "safe-buffer@5.1.2",
+ "_inBundle": false,
+ "_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "_location": "/callback-stream/safe-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "safe-buffer@~5.1.1",
+ "name": "safe-buffer",
+ "escapedName": "safe-buffer",
+ "rawSpec": "~5.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~5.1.1"
+ },
+ "_requiredBy": [
+ "/callback-stream/readable-stream",
+ "/callback-stream/string_decoder"
+ ],
+ "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "_shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d",
+ "_spec": "safe-buffer@~5.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/callback-stream/node_modules/readable-stream",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "http://feross.org"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/safe-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Safer Node.js Buffer API",
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^4.0.0"
+ },
+ "homepage": "https://github.com/feross/safe-buffer",
+ "keywords": [
+ "buffer",
+ "buffer allocate",
+ "node security",
+ "safe",
+ "safe-buffer",
+ "security",
+ "uninitialized"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "safe-buffer",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/safe-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && tape test/*.js"
+ },
+ "types": "index.d.ts",
+ "version": "5.1.2"
+}
diff --git a/Nodejs/node_modules/callback-stream/node_modules/string_decoder/.travis.yml b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/.travis.yml
new file mode 100644
index 0000000..3347a72
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/.travis.yml
@@ -0,0 +1,50 @@
+sudo: false
+language: node_js
+before_install:
+ - npm install -g npm@2
+ - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ include:
+ - node_js: '0.8'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.10'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.11'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.12'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 1
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 2
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 3
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 4
+ env: TASK=test
+ - node_js: 5
+ env: TASK=test
+ - node_js: 6
+ env: TASK=test
+ - node_js: 7
+ env: TASK=test
+ - node_js: 8
+ env: TASK=test
+ - node_js: 9
+ env: TASK=test
diff --git a/Nodejs/node_modules/callback-stream/node_modules/string_decoder/LICENSE b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/LICENSE
new file mode 100644
index 0000000..778edb2
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/LICENSE
@@ -0,0 +1,48 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
diff --git a/Nodejs/node_modules/callback-stream/node_modules/string_decoder/README.md b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/README.md
new file mode 100644
index 0000000..5fd5831
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/README.md
@@ -0,0 +1,47 @@
+# string_decoder
+
+***Node-core v8.9.4 string_decoder for userland***
+
+
+[](https://nodei.co/npm/string_decoder/)
+[](https://nodei.co/npm/string_decoder/)
+
+
+```bash
+npm install --save string_decoder
+```
+
+***Node-core string_decoder for userland***
+
+This package is a mirror of the string_decoder implementation in Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
+
+As of version 1.0.0 **string_decoder** uses semantic versioning.
+
+## Previous versions
+
+Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
+
+## Update
+
+The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
+
+## Streams Working Group
+
+`string_decoder` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+See [readable-stream](https://github.com/nodejs/readable-stream) for
+more details.
diff --git a/Nodejs/node_modules/callback-stream/node_modules/string_decoder/lib/string_decoder.js b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/lib/string_decoder.js
new file mode 100644
index 0000000..2e89e63
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/lib/string_decoder.js
@@ -0,0 +1,296 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+/* */
+
+var isEncoding = Buffer.isEncoding || function (encoding) {
+ encoding = '' + encoding;
+ switch (encoding && encoding.toLowerCase()) {
+ case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
+ return true;
+ default:
+ return false;
+ }
+};
+
+function _normalizeEncoding(enc) {
+ if (!enc) return 'utf8';
+ var retried;
+ while (true) {
+ switch (enc) {
+ case 'utf8':
+ case 'utf-8':
+ return 'utf8';
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return 'utf16le';
+ case 'latin1':
+ case 'binary':
+ return 'latin1';
+ case 'base64':
+ case 'ascii':
+ case 'hex':
+ return enc;
+ default:
+ if (retried) return; // undefined
+ enc = ('' + enc).toLowerCase();
+ retried = true;
+ }
+ }
+};
+
+// Do not cache `Buffer.isEncoding` when checking encoding names as some
+// modules monkey-patch it to support additional encodings
+function normalizeEncoding(enc) {
+ var nenc = _normalizeEncoding(enc);
+ if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
+ return nenc || enc;
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters.
+exports.StringDecoder = StringDecoder;
+function StringDecoder(encoding) {
+ this.encoding = normalizeEncoding(encoding);
+ var nb;
+ switch (this.encoding) {
+ case 'utf16le':
+ this.text = utf16Text;
+ this.end = utf16End;
+ nb = 4;
+ break;
+ case 'utf8':
+ this.fillLast = utf8FillLast;
+ nb = 4;
+ break;
+ case 'base64':
+ this.text = base64Text;
+ this.end = base64End;
+ nb = 3;
+ break;
+ default:
+ this.write = simpleWrite;
+ this.end = simpleEnd;
+ return;
+ }
+ this.lastNeed = 0;
+ this.lastTotal = 0;
+ this.lastChar = Buffer.allocUnsafe(nb);
+}
+
+StringDecoder.prototype.write = function (buf) {
+ if (buf.length === 0) return '';
+ var r;
+ var i;
+ if (this.lastNeed) {
+ r = this.fillLast(buf);
+ if (r === undefined) return '';
+ i = this.lastNeed;
+ this.lastNeed = 0;
+ } else {
+ i = 0;
+ }
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
+ return r || '';
+};
+
+StringDecoder.prototype.end = utf8End;
+
+// Returns only complete characters in a Buffer
+StringDecoder.prototype.text = utf8Text;
+
+// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
+StringDecoder.prototype.fillLast = function (buf) {
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
+ this.lastNeed -= buf.length;
+};
+
+// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
+// continuation byte. If an invalid byte is detected, -2 is returned.
+function utf8CheckByte(byte) {
+ if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
+ return byte >> 6 === 0x02 ? -1 : -2;
+}
+
+// Checks at most 3 bytes at the end of a Buffer in order to detect an
+// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
+// needed to complete the UTF-8 character (if applicable) are returned.
+function utf8CheckIncomplete(self, buf, i) {
+ var j = buf.length - 1;
+ if (j < i) return 0;
+ var nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 1;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 2;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) {
+ if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
+ }
+ return nb;
+ }
+ return 0;
+}
+
+// Validates as many continuation bytes for a multi-byte UTF-8 character as
+// needed or are available. If we see a non-continuation byte where we expect
+// one, we "replace" the validated continuation bytes we've seen so far with
+// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
+// behavior. The continuation byte check is included three times in the case
+// where all of the continuation bytes for a character exist in the same buffer.
+// It is also done this way as a slight performance increase instead of using a
+// loop.
+function utf8CheckExtraBytes(self, buf, p) {
+ if ((buf[0] & 0xC0) !== 0x80) {
+ self.lastNeed = 0;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 1 && buf.length > 1) {
+ if ((buf[1] & 0xC0) !== 0x80) {
+ self.lastNeed = 1;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 2 && buf.length > 2) {
+ if ((buf[2] & 0xC0) !== 0x80) {
+ self.lastNeed = 2;
+ return '\ufffd';
+ }
+ }
+ }
+}
+
+// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
+function utf8FillLast(buf) {
+ var p = this.lastTotal - this.lastNeed;
+ var r = utf8CheckExtraBytes(this, buf, p);
+ if (r !== undefined) return r;
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, p, 0, buf.length);
+ this.lastNeed -= buf.length;
+}
+
+// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
+// partial character, the character's bytes are buffered until the required
+// number of bytes are available.
+function utf8Text(buf, i) {
+ var total = utf8CheckIncomplete(this, buf, i);
+ if (!this.lastNeed) return buf.toString('utf8', i);
+ this.lastTotal = total;
+ var end = buf.length - (total - this.lastNeed);
+ buf.copy(this.lastChar, 0, end);
+ return buf.toString('utf8', i, end);
+}
+
+// For UTF-8, a replacement character is added when ending on a partial
+// character.
+function utf8End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + '\ufffd';
+ return r;
+}
+
+// UTF-16LE typically needs two bytes per character, but even if we have an even
+// number of bytes available, we need to check if we end on a leading/high
+// surrogate. In that case, we need to wait for the next two bytes in order to
+// decode the last character properly.
+function utf16Text(buf, i) {
+ if ((buf.length - i) % 2 === 0) {
+ var r = buf.toString('utf16le', i);
+ if (r) {
+ var c = r.charCodeAt(r.length - 1);
+ if (c >= 0xD800 && c <= 0xDBFF) {
+ this.lastNeed = 2;
+ this.lastTotal = 4;
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ return r.slice(0, -1);
+ }
+ }
+ return r;
+ }
+ this.lastNeed = 1;
+ this.lastTotal = 2;
+ this.lastChar[0] = buf[buf.length - 1];
+ return buf.toString('utf16le', i, buf.length - 1);
+}
+
+// For UTF-16LE we do not explicitly append special replacement characters if we
+// end on a partial character, we simply let v8 handle that.
+function utf16End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) {
+ var end = this.lastTotal - this.lastNeed;
+ return r + this.lastChar.toString('utf16le', 0, end);
+ }
+ return r;
+}
+
+function base64Text(buf, i) {
+ var n = (buf.length - i) % 3;
+ if (n === 0) return buf.toString('base64', i);
+ this.lastNeed = 3 - n;
+ this.lastTotal = 3;
+ if (n === 1) {
+ this.lastChar[0] = buf[buf.length - 1];
+ } else {
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ }
+ return buf.toString('base64', i, buf.length - n);
+}
+
+function base64End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
+ return r;
+}
+
+// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
+function simpleWrite(buf) {
+ return buf.toString(this.encoding);
+}
+
+function simpleEnd(buf) {
+ return buf && buf.length ? this.write(buf) : '';
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/callback-stream/node_modules/string_decoder/package.json b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/package.json
new file mode 100644
index 0000000..2d13a95
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/node_modules/string_decoder/package.json
@@ -0,0 +1,59 @@
+{
+ "_from": "string_decoder@~1.1.1",
+ "_id": "string_decoder@1.1.1",
+ "_inBundle": false,
+ "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "_location": "/callback-stream/string_decoder",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "string_decoder@~1.1.1",
+ "name": "string_decoder",
+ "escapedName": "string_decoder",
+ "rawSpec": "~1.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~1.1.1"
+ },
+ "_requiredBy": [
+ "/callback-stream/readable-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
+ "_spec": "string_decoder@~1.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/callback-stream/node_modules/readable-stream",
+ "bugs": {
+ "url": "https://github.com/nodejs/string_decoder/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ },
+ "deprecated": false,
+ "description": "The string_decoder module from Node core",
+ "devDependencies": {
+ "babel-polyfill": "^6.23.0",
+ "core-util-is": "^1.0.2",
+ "inherits": "^2.0.3",
+ "tap": "~0.4.8"
+ },
+ "homepage": "https://github.com/nodejs/string_decoder",
+ "keywords": [
+ "string",
+ "decoder",
+ "browser",
+ "browserify"
+ ],
+ "license": "MIT",
+ "main": "lib/string_decoder.js",
+ "name": "string_decoder",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/string_decoder.git"
+ },
+ "scripts": {
+ "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+ "test": "tap test/parallel/*.js && node test/verify-dependencies"
+ },
+ "version": "1.1.1"
+}
diff --git a/Nodejs/node_modules/callback-stream/package.json b/Nodejs/node_modules/callback-stream/package.json
new file mode 100644
index 0000000..fb4352f
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/package.json
@@ -0,0 +1,73 @@
+{
+ "_from": "callback-stream@^1.0.2",
+ "_id": "callback-stream@1.1.0",
+ "_inBundle": false,
+ "_integrity": "sha1-RwGlEmbwbgbqpx/BcjOCLYdfSQg=",
+ "_location": "/callback-stream",
+ "_phantomChildren": {
+ "core-util-is": "1.0.2",
+ "inherits": "2.0.4",
+ "isarray": "1.0.0",
+ "process-nextick-args": "2.0.1",
+ "util-deprecate": "1.0.2"
+ },
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "callback-stream@^1.0.2",
+ "name": "callback-stream",
+ "escapedName": "callback-stream",
+ "rawSpec": "^1.0.2",
+ "saveSpec": null,
+ "fetchSpec": "^1.0.2"
+ },
+ "_requiredBy": [
+ "/help-me"
+ ],
+ "_resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz",
+ "_shasum": "4701a51266f06e06eaa71fc17233822d875f4908",
+ "_spec": "callback-stream@^1.0.2",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/help-me",
+ "author": {
+ "name": "Matteo Collina",
+ "email": "hello@matteocollina.com"
+ },
+ "bugs": {
+ "url": "http://github.com/mcollina/callback-stream/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "inherits": "^2.0.1",
+ "readable-stream": "> 1.0.0 < 3.0.0"
+ },
+ "deprecated": false,
+ "description": "A pipeable stream that calls your callback",
+ "devDependencies": {
+ "pre-commit": "^1.1.1",
+ "standard": "^5.0.0",
+ "tap": "~0.4.2",
+ "tape": "^4.0.2"
+ },
+ "homepage": "https://github.com/mcollina/callback-stream#readme",
+ "keywords": [
+ "callback",
+ "stream"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "callback-stream",
+ "precommit": [
+ "lint",
+ "test"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/mcollina/callback-stream.git"
+ },
+ "scripts": {
+ "lint": "standard",
+ "test": "tap test.js"
+ },
+ "version": "1.1.0",
+ "website": "https://github.com/mcollina/callback-stream"
+}
diff --git a/Nodejs/node_modules/callback-stream/test.js b/Nodejs/node_modules/callback-stream/test.js
new file mode 100644
index 0000000..cc9aa98
--- /dev/null
+++ b/Nodejs/node_modules/callback-stream/test.js
@@ -0,0 +1,57 @@
+'use strict'
+
+var test = require('tap').test
+var callback = require('./')
+var fs = require('fs')
+
+test('call the callback after end with object mode', function (t) {
+ var opts = { objectMode: true }
+ var stream = callback(opts, function (err, results) {
+ t.deepEqual(results, ['hello'], 'should return the ending value')
+ t.end()
+ })
+
+ stream.end('hello')
+})
+
+test('support multiple writes with object mode', function (t) {
+ var opts = { objectMode: true }
+ var stream = callback(opts, function (err, results) {
+ t.deepEqual(results, ['hello', 'world'], 'should return the ending value')
+ t.end()
+ })
+
+ stream.write('hello')
+ stream.end('world')
+})
+
+test('works without object mode', function (t) {
+ var stream = callback(function (err, results) {
+ t.equal(results.length, 1, 'should contain only one value')
+ t.deepEqual(results[0].toString(), 'world', 'should return the ending value')
+ t.end()
+ })
+
+ stream.end('world')
+})
+
+test('is pipeable', function (t) {
+ var write = callback(function (err, results) {
+ var actual = Buffer.concat(results).toString()
+ var expected = fs.readFileSync('README.md').toString()
+ t.equal(actual, expected, 'should have the same content of the file')
+ t.end()
+ })
+ var read = fs.createReadStream('README.md')
+
+ read.pipe(write)
+})
+
+test('callback.obj shortcut for objectMode', function (t) {
+ var stream = callback.obj(function (err, results) {
+ t.deepEqual(results, ['hello'], 'should return the ending value')
+ t.end()
+ })
+
+ stream.end('hello')
+})
diff --git a/Nodejs/node_modules/caseless/LICENSE b/Nodejs/node_modules/caseless/LICENSE
new file mode 100644
index 0000000..61789f4
--- /dev/null
+++ b/Nodejs/node_modules/caseless/LICENSE
@@ -0,0 +1,28 @@
+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
\ No newline at end of file
diff --git a/Nodejs/node_modules/caseless/README.md b/Nodejs/node_modules/caseless/README.md
new file mode 100644
index 0000000..e5077a2
--- /dev/null
+++ b/Nodejs/node_modules/caseless/README.md
@@ -0,0 +1,45 @@
+## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing.
+
+This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set.
+
+## Usage
+
+```javascript
+var headers = {}
+ , c = caseless(headers)
+ ;
+c.set('a-Header', 'asdf')
+c.get('a-header') === 'asdf'
+```
+
+## has(key)
+
+Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with.
+
+```javascript
+c.has('a-header') === 'a-Header'
+```
+
+## set(key, value[, clobber=true])
+
+Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header.
+
+```javascript
+c.set('a-Header', 'fdas')
+c.set('a-HEADER', 'more', false)
+c.get('a-header') === 'fdsa,more'
+```
+
+## swap(key)
+
+Swaps the casing of a header with the new one that is passed in.
+
+```javascript
+var headers = {}
+ , c = caseless(headers)
+ ;
+c.set('a-Header', 'fdas')
+c.swap('a-HEADER')
+c.has('a-header') === 'a-HEADER'
+headers === {'a-HEADER': 'fdas'}
+```
diff --git a/Nodejs/node_modules/caseless/index.js b/Nodejs/node_modules/caseless/index.js
new file mode 100644
index 0000000..b194734
--- /dev/null
+++ b/Nodejs/node_modules/caseless/index.js
@@ -0,0 +1,67 @@
+function Caseless (dict) {
+ this.dict = dict || {}
+}
+Caseless.prototype.set = function (name, value, clobber) {
+ if (typeof name === 'object') {
+ for (var i in name) {
+ this.set(i, name[i], value)
+ }
+ } else {
+ if (typeof clobber === 'undefined') clobber = true
+ var has = this.has(name)
+
+ if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value
+ else this.dict[has || name] = value
+ return has
+ }
+}
+Caseless.prototype.has = function (name) {
+ var keys = Object.keys(this.dict)
+ , name = name.toLowerCase()
+ ;
+ for (var i=0;i 0.
+ Can be useful for things that are purely cosmetic.
+ */
+ readonly visible: Chalk;
+
+ readonly black: Chalk;
+ readonly red: Chalk;
+ readonly green: Chalk;
+ readonly yellow: Chalk;
+ readonly blue: Chalk;
+ readonly magenta: Chalk;
+ readonly cyan: Chalk;
+ readonly white: Chalk;
+
+ /*
+ Alias for `blackBright`.
+ */
+ readonly gray: Chalk;
+
+ /*
+ Alias for `blackBright`.
+ */
+ readonly grey: Chalk;
+
+ readonly blackBright: Chalk;
+ readonly redBright: Chalk;
+ readonly greenBright: Chalk;
+ readonly yellowBright: Chalk;
+ readonly blueBright: Chalk;
+ readonly magentaBright: Chalk;
+ readonly cyanBright: Chalk;
+ readonly whiteBright: Chalk;
+
+ readonly bgBlack: Chalk;
+ readonly bgRed: Chalk;
+ readonly bgGreen: Chalk;
+ readonly bgYellow: Chalk;
+ readonly bgBlue: Chalk;
+ readonly bgMagenta: Chalk;
+ readonly bgCyan: Chalk;
+ readonly bgWhite: Chalk;
+
+ /*
+ Alias for `bgBlackBright`.
+ */
+ readonly bgGray: Chalk;
+
+ /*
+ Alias for `bgBlackBright`.
+ */
+ readonly bgGrey: Chalk;
+
+ readonly bgBlackBright: Chalk;
+ readonly bgRedBright: Chalk;
+ readonly bgGreenBright: Chalk;
+ readonly bgYellowBright: Chalk;
+ readonly bgBlueBright: Chalk;
+ readonly bgMagentaBright: Chalk;
+ readonly bgCyanBright: Chalk;
+ readonly bgWhiteBright: Chalk;
+ }
+}
+
+/**
+Main Chalk object that allows to chain styles together.
+Call the last one as a method with a string argument.
+Order doesn't matter, and later styles take precedent in case of a conflict.
+This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
+*/
+declare const chalk: chalk.Chalk & chalk.ChalkFunction & {
+ supportsColor: chalk.ColorSupport | false;
+ Level: typeof LevelEnum;
+ Color: Color;
+ ForegroundColor: ForegroundColor;
+ BackgroundColor: BackgroundColor;
+ Modifiers: Modifiers;
+ stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false};
+};
+
+export = chalk;
diff --git a/Nodejs/node_modules/chalk/license b/Nodejs/node_modules/chalk/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/Nodejs/node_modules/chalk/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Nodejs/node_modules/chalk/package.json b/Nodejs/node_modules/chalk/package.json
new file mode 100644
index 0000000..a5b34cb
--- /dev/null
+++ b/Nodejs/node_modules/chalk/package.json
@@ -0,0 +1,96 @@
+{
+ "_from": "chalk@^3.0.0",
+ "_id": "chalk@3.0.0",
+ "_inBundle": false,
+ "_integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",
+ "_location": "/chalk",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "chalk@^3.0.0",
+ "name": "chalk",
+ "escapedName": "chalk",
+ "rawSpec": "^3.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^3.0.0"
+ },
+ "_requiredBy": [
+ "/pkg",
+ "/pkg-fetch"
+ ],
+ "_resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
+ "_shasum": "3f73c2bf526591f574cc492c51e2456349f844e4",
+ "_spec": "chalk@^3.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/pkg",
+ "bugs": {
+ "url": "https://github.com/chalk/chalk/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "deprecated": false,
+ "description": "Terminal string styling done right",
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "coveralls": "^3.0.7",
+ "execa": "^3.2.0",
+ "import-fresh": "^3.1.0",
+ "matcha": "^0.7.0",
+ "nyc": "^14.1.1",
+ "resolve-from": "^5.0.0",
+ "tsd": "^0.7.4",
+ "xo": "^0.25.3"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "files": [
+ "source",
+ "index.d.ts"
+ ],
+ "homepage": "https://github.com/chalk/chalk#readme",
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "str",
+ "ansi",
+ "style",
+ "styles",
+ "tty",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "license": "MIT",
+ "main": "source",
+ "name": "chalk",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/chalk/chalk.git"
+ },
+ "scripts": {
+ "bench": "matcha benchmark.js",
+ "test": "xo && nyc ava && tsd"
+ },
+ "version": "3.0.0",
+ "xo": {
+ "rules": {
+ "unicorn/prefer-string-slice": "off",
+ "unicorn/prefer-includes": "off"
+ }
+ }
+}
diff --git a/Nodejs/node_modules/chalk/readme.md b/Nodejs/node_modules/chalk/readme.md
new file mode 100644
index 0000000..877cb93
--- /dev/null
+++ b/Nodejs/node_modules/chalk/readme.md
@@ -0,0 +1,304 @@
+
+
+
+
+
+
+
+
+
+> Terminal string styling done right
+
+[](https://travis-ci.org/chalk/chalk) [](https://coveralls.io/github/chalk/chalk?branch=master) [](https://www.npmjs.com/package/chalk?activeTab=dependents) [](https://www.npmjs.com/package/chalk) [](https://www.youtube.com/watch?v=9auOCbH5Ns4) [](https://github.com/xojs/xo) 
+
+
+
+
+## Highlights
+
+- Expressive API
+- Highly performant
+- Ability to nest styles
+- [256/Truecolor color support](#256-and-truecolor-color-support)
+- Auto-detects color support
+- Doesn't extend `String.prototype`
+- Clean and focused
+- Actively maintained
+- [Used by ~46,000 packages](https://www.npmjs.com/browse/depended/chalk) as of October 1, 2019
+
+
+## Install
+
+```console
+$ npm install chalk
+```
+
+
+## Usage
+
+```js
+const chalk = require('chalk');
+
+console.log(chalk.blue('Hello world!'));
+```
+
+Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
+
+```js
+const chalk = require('chalk');
+const log = console.log;
+
+// Combine styled and normal strings
+log(chalk.blue('Hello') + ' World' + chalk.red('!'));
+
+// Compose multiple styles using the chainable API
+log(chalk.blue.bgRed.bold('Hello world!'));
+
+// Pass in multiple arguments
+log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
+
+// Nest styles
+log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
+
+// Nest styles of the same type even (color, underline, background)
+log(chalk.green(
+ 'I am a green line ' +
+ chalk.blue.underline.bold('with a blue substring') +
+ ' that becomes green again!'
+));
+
+// ES2015 template literal
+log(`
+CPU: ${chalk.red('90%')}
+RAM: ${chalk.green('40%')}
+DISK: ${chalk.yellow('70%')}
+`);
+
+// ES2015 tagged template literal
+log(chalk`
+CPU: {red ${cpu.totalPercent}%}
+RAM: {green ${ram.used / ram.total * 100}%}
+DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
+`);
+
+// Use RGB colors in terminal emulators that support it.
+log(chalk.keyword('orange')('Yay for orange colored text!'));
+log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
+log(chalk.hex('#DEADED').bold('Bold gray!'));
+```
+
+Easily define your own themes:
+
+```js
+const chalk = require('chalk');
+
+const error = chalk.bold.red;
+const warning = chalk.keyword('orange');
+
+console.log(error('Error!'));
+console.log(warning('Warning!'));
+```
+
+Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
+
+```js
+const name = 'Sindre';
+console.log(chalk.green('Hello %s'), name);
+//=> 'Hello Sindre'
+```
+
+
+## API
+
+### chalk.`",
+ "expected": [
+ {
+ "type": "style",
+ "name": "style",
+ "attribs": {
+ "type": "text/css"
+ },
+ "children": [
+ {
+ "data": "\n body > p\n\t{ font-weight: bold; }",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json b/Nodejs/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json
new file mode 100644
index 0000000..5c2492e
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json
@@ -0,0 +1,20 @@
+{
+ "name": "Extra spaces in tag",
+ "options": {},
+ "html": "the text\t\nfont\t \n>",
+ "expected": [
+ {
+ "type": "tag",
+ "name": "font",
+ "attribs": {
+ "size": "14"
+ },
+ "children": [
+ {
+ "data": "the text",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/09-unquoted_attrib.json b/Nodejs/node_modules/domhandler/test/cases/09-unquoted_attrib.json
new file mode 100644
index 0000000..543ccee
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/09-unquoted_attrib.json
@@ -0,0 +1,20 @@
+{
+ "name": "Unquoted attributes",
+ "options": {},
+ "html": "the text ",
+ "expected": [
+ {
+ "type": "tag",
+ "name": "font",
+ "attribs": {
+ "size": "14"
+ },
+ "children": [
+ {
+ "data": "the text",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/10-singular_attribute.json b/Nodejs/node_modules/domhandler/test/cases/10-singular_attribute.json
new file mode 100644
index 0000000..544636e
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/10-singular_attribute.json
@@ -0,0 +1,15 @@
+{
+ "name": "Singular attribute",
+ "options": {},
+ "html": "",
+ "expected": [
+ {
+ "type": "tag",
+ "name": "option",
+ "attribs": {
+ "value": "foo",
+ "selected": ""
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/11-text_outside_tags.json b/Nodejs/node_modules/domhandler/test/cases/11-text_outside_tags.json
new file mode 100644
index 0000000..d328572
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/11-text_outside_tags.json
@@ -0,0 +1,40 @@
+{
+ "name": "Text outside tags",
+ "options": {},
+ "html": "Line one\n \nline two",
+ "expected": [
+ {
+ "data": "Line one\n",
+ "type": "text",
+ "prev": null,
+ "next": {
+ "type": "tag",
+ "name": "br",
+ "attribs": {}
+ }
+ },
+ {
+ "type": "tag",
+ "name": "br",
+ "attribs": {},
+ "prev": {
+ "data": "Line one\n",
+ "type": "text"
+ },
+ "next": {
+ "data": "\nline two",
+ "type": "text"
+ }
+ },
+ {
+ "data": "\nline two",
+ "type": "text",
+ "prev": {
+ "type": "tag",
+ "name": "br",
+ "attribs": {}
+ },
+ "next": null
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/12-text_only.json b/Nodejs/node_modules/domhandler/test/cases/12-text_only.json
new file mode 100644
index 0000000..342dc45
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/12-text_only.json
@@ -0,0 +1,11 @@
+{
+ "name": "Only text",
+ "options": {},
+ "html": "this is the text",
+ "expected": [
+ {
+ "data": "this is the text",
+ "type": "text"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/13-comment_in_text.json b/Nodejs/node_modules/domhandler/test/cases/13-comment_in_text.json
new file mode 100644
index 0000000..672dbbe
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/13-comment_in_text.json
@@ -0,0 +1,19 @@
+{
+ "name": "Comment within text",
+ "options": {},
+ "html": "this is the text",
+ "expected": [
+ {
+ "data": "this is ",
+ "type": "text"
+ },
+ {
+ "data": " the comment ",
+ "type": "comment"
+ },
+ {
+ "data": " the text",
+ "type": "text"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json b/Nodejs/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json
new file mode 100644
index 0000000..b69d04b
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json
@@ -0,0 +1,18 @@
+{
+ "name": "Comment within text within script",
+ "options": {},
+ "html": "",
+ "expected": [
+ {
+ "type": "script",
+ "name": "script",
+ "attribs": {},
+ "children": [
+ {
+ "data": "this is the text",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/15-non-verbose.json b/Nodejs/node_modules/domhandler/test/cases/15-non-verbose.json
new file mode 100644
index 0000000..069db84
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/15-non-verbose.json
@@ -0,0 +1,22 @@
+{
+ "name": "Option 'verbose' set to 'false'",
+ "options": {
+ "verbose": false
+ },
+ "html": "the text\t\nfont\t \n>",
+ "expected": [
+ {
+ "type": "tag",
+ "name": "font",
+ "attribs": {
+ "size": "14"
+ },
+ "children": [
+ {
+ "data": "the text",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/16-normalize_whitespace.json b/Nodejs/node_modules/domhandler/test/cases/16-normalize_whitespace.json
new file mode 100644
index 0000000..d4490af
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/16-normalize_whitespace.json
@@ -0,0 +1,47 @@
+{
+ "name": "Normalize whitespace",
+ "options": {
+ "normalizeWhitespace": true
+ },
+ "html": "Line one\n \t \r\n\f \nline two x ",
+ "expected": [
+ {
+ "data": "Line one ",
+ "type": "text"
+ },
+ {
+ "type": "tag",
+ "name": "br",
+ "attribs": {}
+ },
+ {
+ "data": " ",
+ "type": "text"
+ },
+ {
+ "type": "tag",
+ "name": "br",
+ "attribs": {}
+ },
+ {
+ "data": " line two",
+ "type": "text"
+ },
+ {
+ "type": "tag",
+ "name": "font",
+ "attribs": {},
+ "children": [
+ {
+ "type": "tag",
+ "name": "br",
+ "attribs": {}
+ },
+ {
+ "data": " x ",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/17-xml_namespace.json b/Nodejs/node_modules/domhandler/test/cases/17-xml_namespace.json
new file mode 100644
index 0000000..2171c49
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/17-xml_namespace.json
@@ -0,0 +1,18 @@
+{
+ "name": "XML Namespace",
+ "options": {},
+ "html": "text ",
+ "expected": [
+ {
+ "type": "tag",
+ "name": "ns:tag",
+ "attribs": {},
+ "children": [
+ {
+ "data": "text",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/18-enforce_empty_tags.json b/Nodejs/node_modules/domhandler/test/cases/18-enforce_empty_tags.json
new file mode 100644
index 0000000..ce6c455
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/18-enforce_empty_tags.json
@@ -0,0 +1,16 @@
+{
+ "name": "Enforce empty tags",
+ "options": {},
+ "html": " text",
+ "expected": [
+ {
+ "type": "tag",
+ "name": "link",
+ "attribs": {}
+ },
+ {
+ "data": "text",
+ "type": "text"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/19-ignore_empty_tags.json b/Nodejs/node_modules/domhandler/test/cases/19-ignore_empty_tags.json
new file mode 100644
index 0000000..fe59cf9
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/19-ignore_empty_tags.json
@@ -0,0 +1,20 @@
+{
+ "name": "Ignore empty tags (xml mode)",
+ "options": {
+ "xmlMode": true
+ },
+ "html": " text",
+ "expected": [
+ {
+ "type": "tag",
+ "name": "link",
+ "attribs": {},
+ "children": [
+ {
+ "data": "text",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/20-template_script_tags.json b/Nodejs/node_modules/domhandler/test/cases/20-template_script_tags.json
new file mode 100644
index 0000000..dae5f1f
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/20-template_script_tags.json
@@ -0,0 +1,20 @@
+{
+ "name": "Template script tags",
+ "options": {},
+ "html": "",
+ "expected": [
+ {
+ "type": "script",
+ "name": "script",
+ "attribs": {
+ "type": "text/template"
+ },
+ "children": [
+ {
+ "data": "Heading1 ",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/21-conditional_comments.json b/Nodejs/node_modules/domhandler/test/cases/21-conditional_comments.json
new file mode 100644
index 0000000..c034acd
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/21-conditional_comments.json
@@ -0,0 +1,15 @@
+{
+ "name": "Conditional comments",
+ "options": {},
+ "html": "",
+ "expected": [
+ {
+ "data": "[if lt IE 7]> The Title Hello world",
+ "expected": [
+ {
+ "name": "!doctype",
+ "data": "!DOCTYPE html",
+ "type": "directive"
+ },
+ {
+ "type": "tag",
+ "name": "html",
+ "attribs": {},
+ "children": [
+ {
+ "type": "tag",
+ "name": "title",
+ "attribs": {},
+ "children": [
+ {
+ "data": "The Title",
+ "type": "text"
+ }
+ ]
+ },
+ {
+ "type": "tag",
+ "name": "body",
+ "attribs": {},
+ "children": [
+ {
+ "data": "Hello world",
+ "type": "text"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/23-dom-lvl1.json b/Nodejs/node_modules/domhandler/test/cases/23-dom-lvl1.json
new file mode 100644
index 0000000..ab25d88
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/23-dom-lvl1.json
@@ -0,0 +1,131 @@
+{
+ "name": "DOM level 1",
+ "options": { "withDomLvl1": true },
+ "html": "some stray text
Hello, world. more stray text",
+ "expected": [
+ {
+ "type": "tag",
+ "nodeType": 1,
+ "name": "div",
+ "tagName": "div",
+ "attribs": {},
+ "nodeValue": null,
+ "children": [
+ {
+ "type": "text",
+ "nodeType": 3,
+ "tagName": null,
+ "data": "some stray text",
+ "nodeValue": "some stray text",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null
+ },
+ {
+ "type": "tag",
+ "nodeType": 1,
+ "name": "h1",
+ "tagName": "h1",
+ "nodeValue": null,
+ "attribs": {},
+ "children": [
+ {
+ "type": "text",
+ "nodeType": 3,
+ "tagName": null,
+ "data": "Hello, world.",
+ "nodeValue": "Hello, world.",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null
+ }
+ ],
+ "firstChild": {
+ "type": "text",
+ "nodeType": 3,
+ "tagName": null,
+ "data": "Hello, world.",
+ "nodeValue": "Hello, world.",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null
+ },
+ "lastChild": {
+ "type": "text",
+ "nodeType": 3,
+ "tagName": null,
+ "data": "Hello, world.",
+ "nodeValue": "Hello, world.",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null
+ }
+ },
+ {
+ "type": "comment",
+ "nodeType": 8,
+ "tagName": null,
+ "data": " comment node ",
+ "nodeValue": " comment node ",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null,
+ "prev": {
+ "type": "tag",
+ "name": "h1",
+ "nodeValue": null,
+ "attribs": {}
+ },
+ "previousSibling": {
+ "type": "tag",
+ "name": "h1",
+ "nodeValue": null,
+ "attribs": {}
+ },
+ "next": {
+ "type": "text",
+ "tagName": null,
+ "data": "more stray text"
+ },
+ "nextSibling": {
+ "type": "text",
+ "tagName": null,
+ "data": "more stray text"
+ }
+ },
+ {
+ "type": "text",
+ "nodeType": 3,
+ "tagName": null,
+ "data": "more stray text",
+ "nodeValue": "more stray text",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null,
+ "next": null,
+ "nextSibling": null
+ }
+ ],
+ "firstChild": {
+ "type": "text",
+ "nodeType": 3,
+ "tagName": null,
+ "data": "some stray text",
+ "nodeValue": "some stray text",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null
+ },
+ "lastChild": {
+ "type": "text",
+ "nodeType": 3,
+ "tagName": null,
+ "data": "more stray text",
+ "nodeValue": "more stray text",
+ "childNodes": null,
+ "firstChild": null,
+ "lastChild": null
+ }
+ }
+ ]
+}
diff --git a/Nodejs/node_modules/domhandler/test/cases/24-with-start-indices.json b/Nodejs/node_modules/domhandler/test/cases/24-with-start-indices.json
new file mode 100644
index 0000000..02228f1
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/24-with-start-indices.json
@@ -0,0 +1,85 @@
+{
+ "name": "withStartIndices adds correct startIndex properties",
+ "options": {"withStartIndices": true},
+ "streaming": false,
+ "html": " The Title Hello world
",
+ "expected": [
+ {
+ "startIndex": 0,
+ "name": "!doctype",
+ "data": "!DOCTYPE html",
+ "type": "directive"
+ },
+ {
+ "type": "text",
+ "data": " "
+ },
+ {
+ "startIndex": 16,
+ "type": "tag",
+ "name": "html",
+ "attribs": {},
+ "parent": null,
+ "children": [
+ {
+ "startIndex": 22,
+ "type": "text",
+ "data": " "
+ },
+ {
+ "startIndex": 23,
+ "type": "tag",
+ "name": "title",
+ "attribs": {},
+ "children": [
+ {
+ "startIndex": 30,
+ "data": "The Title",
+ "type": "text"
+ }
+ ]
+ },
+ {
+ "startIndex": 47,
+ "type": "text",
+ "data": " "
+ },
+ {
+ "startIndex": 48,
+ "type": "tag",
+ "name": "body",
+ "attribs": {"class": "foo"},
+ "children": [
+ {
+ "startIndex": 66,
+ "data": "Hello world ",
+ "type": "text"
+ },
+ {
+ "startIndex": 78,
+ "type": "tag",
+ "name": "p",
+ "attribs": {},
+ "children": []
+ }
+ ]
+ },
+ {
+ "startIndex": 92,
+ "type": "text",
+ "data": " "
+ },
+ {
+ "startIndex": 93,
+ "type": "comment",
+ "data": " the comment "
+ },
+ {
+ "startIndex": 113,
+ "type": "text",
+ "data": " "
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/cases/25-with-end-indices.json b/Nodejs/node_modules/domhandler/test/cases/25-with-end-indices.json
new file mode 100644
index 0000000..efd62f4
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/cases/25-with-end-indices.json
@@ -0,0 +1,86 @@
+{
+ "name": "withEndIndices adds correct endIndex properties",
+ "options": {"withStartIndices": true,"withEndIndices": true},
+ "streaming": false,
+ "html": " The Title Hello world
",
+ "expected": [
+ {
+ "endIndex": null,
+ "name": "!doctype",
+ "data": "!DOCTYPE html",
+ "type": "directive"
+ },
+ {
+ "type": "text",
+ "data": " ",
+ "endIndex": 15
+ },
+ {
+ "endIndex": 120,
+ "type": "tag",
+ "name": "html",
+ "attribs": {},
+ "parent": null,
+ "children": [
+ {
+ "endIndex": 22,
+ "type": "text",
+ "data": " "
+ },
+ {
+ "endIndex": 46,
+ "type": "tag",
+ "name": "title",
+ "attribs": {},
+ "children": [
+ {
+ "endIndex": 38,
+ "data": "The Title",
+ "type": "text"
+ }
+ ]
+ },
+ {
+ "endIndex": 47,
+ "type": "text",
+ "data": " "
+ },
+ {
+ "endIndex": 91,
+ "type": "tag",
+ "name": "body",
+ "attribs": {"class": "foo"},
+ "children": [
+ {
+ "endIndex": 77,
+ "data": "Hello world ",
+ "type": "text"
+ },
+ {
+ "endIndex": 84,
+ "type": "tag",
+ "name": "p",
+ "attribs": {},
+ "children": []
+ }
+ ]
+ },
+ {
+ "endIndex": 92,
+ "type": "text",
+ "data": " "
+ },
+ {
+ "endIndex": 112,
+ "type": "comment",
+ "data": " the comment "
+ },
+ {
+ "endIndex": 113,
+ "type": "text",
+ "data": " "
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domhandler/test/tests.js b/Nodejs/node_modules/domhandler/test/tests.js
new file mode 100644
index 0000000..6dc96a2
--- /dev/null
+++ b/Nodejs/node_modules/domhandler/test/tests.js
@@ -0,0 +1,60 @@
+var fs = require("fs"),
+ path = require("path"),
+ assert = require("assert"),
+ util = require("util"),
+ Parser = require("htmlparser2").Parser,
+ Handler = require("../");
+
+var basePath = path.resolve(__dirname, "cases"),
+ inspectOpts = { showHidden: true, depth: null };
+
+fs
+.readdirSync(basePath)
+.filter(RegExp.prototype.test, /\.json$/) //only allow .json files
+.map(function(name){
+ return path.resolve(basePath, name);
+})
+.map(require)
+.forEach(function(test){
+ it(test.name, function(){
+ var expected = test.expected;
+
+ var handler = new Handler(function(err, actual){
+ assert.ifError(err);
+ try {
+ compare(expected, actual);
+ } catch(e){
+ e.expected = util.inspect(expected, inspectOpts);
+ e.actual = util.inspect(actual, inspectOpts);
+ throw e;
+ }
+ }, test.options);
+
+ var data = test.html;
+
+ var parser = new Parser(handler, test.options);
+
+ //first, try to run the test via chunks
+ if (test.streaming || test.streaming === undefined){
+ for(var i = 0; i < data.length; i++){
+ parser.write(data.charAt(i));
+ }
+ parser.done();
+ }
+
+ //then parse everything
+ parser.parseComplete(data);
+ });
+});
+
+function compare(expected, result){
+ assert.equal(typeof expected, typeof result, "types didn't match");
+ if(typeof expected !== "object" || expected === null){
+ assert.strictEqual(expected, result, "result doesn't equal expected");
+ } else {
+ for(var prop in expected){
+ assert.ok(prop in result, "result didn't contain property " + prop);
+ compare(expected[prop], result[prop]);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/domutils/.npmignore b/Nodejs/node_modules/domutils/.npmignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/Nodejs/node_modules/domutils/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/Nodejs/node_modules/domutils/LICENSE b/Nodejs/node_modules/domutils/LICENSE
new file mode 100644
index 0000000..c464f86
--- /dev/null
+++ b/Nodejs/node_modules/domutils/LICENSE
@@ -0,0 +1,11 @@
+Copyright (c) Felix Böhm
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Nodejs/node_modules/domutils/index.js b/Nodejs/node_modules/domutils/index.js
new file mode 100644
index 0000000..13f3344
--- /dev/null
+++ b/Nodejs/node_modules/domutils/index.js
@@ -0,0 +1,14 @@
+var DomUtils = module.exports;
+
+[
+ require("./lib/stringify"),
+ require("./lib/traversal"),
+ require("./lib/manipulation"),
+ require("./lib/querying"),
+ require("./lib/legacy"),
+ require("./lib/helpers")
+].forEach(function(ext){
+ Object.keys(ext).forEach(function(key){
+ DomUtils[key] = ext[key].bind(DomUtils);
+ });
+});
diff --git a/Nodejs/node_modules/domutils/lib/helpers.js b/Nodejs/node_modules/domutils/lib/helpers.js
new file mode 100644
index 0000000..57056f6
--- /dev/null
+++ b/Nodejs/node_modules/domutils/lib/helpers.js
@@ -0,0 +1,141 @@
+// removeSubsets
+// Given an array of nodes, remove any member that is contained by another.
+exports.removeSubsets = function(nodes) {
+ var idx = nodes.length, node, ancestor, replace;
+
+ // Check if each node (or one of its ancestors) is already contained in the
+ // array.
+ while (--idx > -1) {
+ node = ancestor = nodes[idx];
+
+ // Temporarily remove the node under consideration
+ nodes[idx] = null;
+ replace = true;
+
+ while (ancestor) {
+ if (nodes.indexOf(ancestor) > -1) {
+ replace = false;
+ nodes.splice(idx, 1);
+ break;
+ }
+ ancestor = ancestor.parent;
+ }
+
+ // If the node has been found to be unique, re-insert it.
+ if (replace) {
+ nodes[idx] = node;
+ }
+ }
+
+ return nodes;
+};
+
+// Source: http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
+var POSITION = {
+ DISCONNECTED: 1,
+ PRECEDING: 2,
+ FOLLOWING: 4,
+ CONTAINS: 8,
+ CONTAINED_BY: 16
+};
+
+// Compare the position of one node against another node in any other document.
+// The return value is a bitmask with the following values:
+//
+// document order:
+// > There is an ordering, document order, defined on all the nodes in the
+// > document corresponding to the order in which the first character of the
+// > XML representation of each node occurs in the XML representation of the
+// > document after expansion of general entities. Thus, the document element
+// > node will be the first node. Element nodes occur before their children.
+// > Thus, document order orders element nodes in order of the occurrence of
+// > their start-tag in the XML (after expansion of entities). The attribute
+// > nodes of an element occur after the element and before its children. The
+// > relative order of attribute nodes is implementation-dependent./
+// Source:
+// http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order
+//
+// @argument {Node} nodaA The first node to use in the comparison
+// @argument {Node} nodeB The second node to use in the comparison
+//
+// @return {Number} A bitmask describing the input nodes' relative position.
+// See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for
+// a description of these values.
+var comparePos = exports.compareDocumentPosition = function(nodeA, nodeB) {
+ var aParents = [];
+ var bParents = [];
+ var current, sharedParent, siblings, aSibling, bSibling, idx;
+
+ if (nodeA === nodeB) {
+ return 0;
+ }
+
+ current = nodeA;
+ while (current) {
+ aParents.unshift(current);
+ current = current.parent;
+ }
+ current = nodeB;
+ while (current) {
+ bParents.unshift(current);
+ current = current.parent;
+ }
+
+ idx = 0;
+ while (aParents[idx] === bParents[idx]) {
+ idx++;
+ }
+
+ if (idx === 0) {
+ return POSITION.DISCONNECTED;
+ }
+
+ sharedParent = aParents[idx - 1];
+ siblings = sharedParent.children;
+ aSibling = aParents[idx];
+ bSibling = bParents[idx];
+
+ if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
+ if (sharedParent === nodeB) {
+ return POSITION.FOLLOWING | POSITION.CONTAINED_BY;
+ }
+ return POSITION.FOLLOWING;
+ } else {
+ if (sharedParent === nodeA) {
+ return POSITION.PRECEDING | POSITION.CONTAINS;
+ }
+ return POSITION.PRECEDING;
+ }
+};
+
+// Sort an array of nodes based on their relative position in the document and
+// remove any duplicate nodes. If the array contains nodes that do not belong
+// to the same document, sort order is unspecified.
+//
+// @argument {Array} nodes Array of DOM nodes
+//
+// @returns {Array} collection of unique nodes, sorted in document order
+exports.uniqueSort = function(nodes) {
+ var idx = nodes.length, node, position;
+
+ nodes = nodes.slice();
+
+ while (--idx > -1) {
+ node = nodes[idx];
+ position = nodes.indexOf(node);
+ if (position > -1 && position < idx) {
+ nodes.splice(idx, 1);
+ }
+ }
+ nodes.sort(function(a, b) {
+ var relative = comparePos(a, b);
+ if (relative & POSITION.PRECEDING) {
+ return -1;
+ } else if (relative & POSITION.FOLLOWING) {
+ return 1;
+ }
+ return 0;
+ });
+
+ return nodes;
+};
diff --git a/Nodejs/node_modules/domutils/lib/legacy.js b/Nodejs/node_modules/domutils/lib/legacy.js
new file mode 100644
index 0000000..43bd446
--- /dev/null
+++ b/Nodejs/node_modules/domutils/lib/legacy.js
@@ -0,0 +1,87 @@
+var ElementType = require("domelementtype");
+var isTag = exports.isTag = ElementType.isTag;
+
+exports.testElement = function(options, element){
+ for(var key in options){
+ if(!options.hasOwnProperty(key));
+ else if(key === "tag_name"){
+ if(!isTag(element) || !options.tag_name(element.name)){
+ return false;
+ }
+ } else if(key === "tag_type"){
+ if(!options.tag_type(element.type)) return false;
+ } else if(key === "tag_contains"){
+ if(isTag(element) || !options.tag_contains(element.data)){
+ return false;
+ }
+ } else if(!element.attribs || !options[key](element.attribs[key])){
+ return false;
+ }
+ }
+ return true;
+};
+
+var Checks = {
+ tag_name: function(name){
+ if(typeof name === "function"){
+ return function(elem){ return isTag(elem) && name(elem.name); };
+ } else if(name === "*"){
+ return isTag;
+ } else {
+ return function(elem){ return isTag(elem) && elem.name === name; };
+ }
+ },
+ tag_type: function(type){
+ if(typeof type === "function"){
+ return function(elem){ return type(elem.type); };
+ } else {
+ return function(elem){ return elem.type === type; };
+ }
+ },
+ tag_contains: function(data){
+ if(typeof data === "function"){
+ return function(elem){ return !isTag(elem) && data(elem.data); };
+ } else {
+ return function(elem){ return !isTag(elem) && elem.data === data; };
+ }
+ }
+};
+
+function getAttribCheck(attrib, value){
+ if(typeof value === "function"){
+ return function(elem){ return elem.attribs && value(elem.attribs[attrib]); };
+ } else {
+ return function(elem){ return elem.attribs && elem.attribs[attrib] === value; };
+ }
+}
+
+function combineFuncs(a, b){
+ return function(elem){
+ return a(elem) || b(elem);
+ };
+}
+
+exports.getElements = function(options, element, recurse, limit){
+ var funcs = Object.keys(options).map(function(key){
+ var value = options[key];
+ return key in Checks ? Checks[key](value) : getAttribCheck(key, value);
+ });
+
+ return funcs.length === 0 ? [] : this.filter(
+ funcs.reduce(combineFuncs),
+ element, recurse, limit
+ );
+};
+
+exports.getElementById = function(id, element, recurse){
+ if(!Array.isArray(element)) element = [element];
+ return this.findOne(getAttribCheck("id", id), element, recurse !== false);
+};
+
+exports.getElementsByTagName = function(name, element, recurse, limit){
+ return this.filter(Checks.tag_name(name), element, recurse, limit);
+};
+
+exports.getElementsByTagType = function(type, element, recurse, limit){
+ return this.filter(Checks.tag_type(type), element, recurse, limit);
+};
diff --git a/Nodejs/node_modules/domutils/lib/manipulation.js b/Nodejs/node_modules/domutils/lib/manipulation.js
new file mode 100644
index 0000000..6b44cbc
--- /dev/null
+++ b/Nodejs/node_modules/domutils/lib/manipulation.js
@@ -0,0 +1,77 @@
+exports.removeElement = function(elem){
+ if(elem.prev) elem.prev.next = elem.next;
+ if(elem.next) elem.next.prev = elem.prev;
+
+ if(elem.parent){
+ var childs = elem.parent.children;
+ childs.splice(childs.lastIndexOf(elem), 1);
+ }
+};
+
+exports.replaceElement = function(elem, replacement){
+ var prev = replacement.prev = elem.prev;
+ if(prev){
+ prev.next = replacement;
+ }
+
+ var next = replacement.next = elem.next;
+ if(next){
+ next.prev = replacement;
+ }
+
+ var parent = replacement.parent = elem.parent;
+ if(parent){
+ var childs = parent.children;
+ childs[childs.lastIndexOf(elem)] = replacement;
+ }
+};
+
+exports.appendChild = function(elem, child){
+ child.parent = elem;
+
+ if(elem.children.push(child) !== 1){
+ var sibling = elem.children[elem.children.length - 2];
+ sibling.next = child;
+ child.prev = sibling;
+ child.next = null;
+ }
+};
+
+exports.append = function(elem, next){
+ var parent = elem.parent,
+ currNext = elem.next;
+
+ next.next = currNext;
+ next.prev = elem;
+ elem.next = next;
+ next.parent = parent;
+
+ if(currNext){
+ currNext.prev = next;
+ if(parent){
+ var childs = parent.children;
+ childs.splice(childs.lastIndexOf(currNext), 0, next);
+ }
+ } else if(parent){
+ parent.children.push(next);
+ }
+};
+
+exports.prepend = function(elem, prev){
+ var parent = elem.parent;
+ if(parent){
+ var childs = parent.children;
+ childs.splice(childs.lastIndexOf(elem), 0, prev);
+ }
+
+ if(elem.prev){
+ elem.prev.next = prev;
+ }
+
+ prev.parent = parent;
+ prev.prev = elem.prev;
+ prev.next = elem;
+ elem.prev = prev;
+};
+
+
diff --git a/Nodejs/node_modules/domutils/lib/querying.js b/Nodejs/node_modules/domutils/lib/querying.js
new file mode 100644
index 0000000..17e3aa9
--- /dev/null
+++ b/Nodejs/node_modules/domutils/lib/querying.js
@@ -0,0 +1,94 @@
+var isTag = require("domelementtype").isTag;
+
+module.exports = {
+ filter: filter,
+ find: find,
+ findOneChild: findOneChild,
+ findOne: findOne,
+ existsOne: existsOne,
+ findAll: findAll
+};
+
+function filter(test, element, recurse, limit){
+ if(!Array.isArray(element)) element = [element];
+
+ if(typeof limit !== "number" || !isFinite(limit)){
+ limit = Infinity;
+ }
+ return find(test, element, recurse !== false, limit);
+}
+
+function find(test, elems, recurse, limit){
+ var result = [], childs;
+
+ for(var i = 0, j = elems.length; i < j; i++){
+ if(test(elems[i])){
+ result.push(elems[i]);
+ if(--limit <= 0) break;
+ }
+
+ childs = elems[i].children;
+ if(recurse && childs && childs.length > 0){
+ childs = find(test, childs, recurse, limit);
+ result = result.concat(childs);
+ limit -= childs.length;
+ if(limit <= 0) break;
+ }
+ }
+
+ return result;
+}
+
+function findOneChild(test, elems){
+ for(var i = 0, l = elems.length; i < l; i++){
+ if(test(elems[i])) return elems[i];
+ }
+
+ return null;
+}
+
+function findOne(test, elems){
+ var elem = null;
+
+ for(var i = 0, l = elems.length; i < l && !elem; i++){
+ if(!isTag(elems[i])){
+ continue;
+ } else if(test(elems[i])){
+ elem = elems[i];
+ } else if(elems[i].children.length > 0){
+ elem = findOne(test, elems[i].children);
+ }
+ }
+
+ return elem;
+}
+
+function existsOne(test, elems){
+ for(var i = 0, l = elems.length; i < l; i++){
+ if(
+ isTag(elems[i]) && (
+ test(elems[i]) || (
+ elems[i].children.length > 0 &&
+ existsOne(test, elems[i].children)
+ )
+ )
+ ){
+ return true;
+ }
+ }
+
+ return false;
+}
+
+function findAll(test, elems){
+ var result = [];
+ for(var i = 0, j = elems.length; i < j; i++){
+ if(!isTag(elems[i])) continue;
+ if(test(elems[i])) result.push(elems[i]);
+
+ if(elems[i].children.length > 0){
+ result = result.concat(findAll(test, elems[i].children));
+ }
+ }
+ return result;
+}
diff --git a/Nodejs/node_modules/domutils/lib/stringify.js b/Nodejs/node_modules/domutils/lib/stringify.js
new file mode 100644
index 0000000..e3f2f39
--- /dev/null
+++ b/Nodejs/node_modules/domutils/lib/stringify.js
@@ -0,0 +1,22 @@
+var ElementType = require("domelementtype"),
+ getOuterHTML = require("dom-serializer"),
+ isTag = ElementType.isTag;
+
+module.exports = {
+ getInnerHTML: getInnerHTML,
+ getOuterHTML: getOuterHTML,
+ getText: getText
+};
+
+function getInnerHTML(elem, opts){
+ return elem.children ? elem.children.map(function(elem){
+ return getOuterHTML(elem, opts);
+ }).join("") : "";
+}
+
+function getText(elem){
+ if(Array.isArray(elem)) return elem.map(getText).join("");
+ if(isTag(elem) || elem.type === ElementType.CDATA) return getText(elem.children);
+ if(elem.type === ElementType.Text) return elem.data;
+ return "";
+}
diff --git a/Nodejs/node_modules/domutils/lib/traversal.js b/Nodejs/node_modules/domutils/lib/traversal.js
new file mode 100644
index 0000000..ffdfeb6
--- /dev/null
+++ b/Nodejs/node_modules/domutils/lib/traversal.js
@@ -0,0 +1,24 @@
+var getChildren = exports.getChildren = function(elem){
+ return elem.children;
+};
+
+var getParent = exports.getParent = function(elem){
+ return elem.parent;
+};
+
+exports.getSiblings = function(elem){
+ var parent = getParent(elem);
+ return parent ? getChildren(parent) : [elem];
+};
+
+exports.getAttributeValue = function(elem, name){
+ return elem.attribs && elem.attribs[name];
+};
+
+exports.hasAttrib = function(elem, name){
+ return !!elem.attribs && hasOwnProperty.call(elem.attribs, name);
+};
+
+exports.getName = function(elem){
+ return elem.name;
+};
diff --git a/Nodejs/node_modules/domutils/package.json b/Nodejs/node_modules/domutils/package.json
new file mode 100644
index 0000000..5311fb8
--- /dev/null
+++ b/Nodejs/node_modules/domutils/package.json
@@ -0,0 +1,79 @@
+{
+ "_from": "domutils@1.5.1",
+ "_id": "domutils@1.5.1",
+ "_inBundle": false,
+ "_integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
+ "_location": "/domutils",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "domutils@1.5.1",
+ "name": "domutils",
+ "escapedName": "domutils",
+ "rawSpec": "1.5.1",
+ "saveSpec": null,
+ "fetchSpec": "1.5.1"
+ },
+ "_requiredBy": [
+ "/css-select",
+ "/htmlparser2"
+ ],
+ "_resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
+ "_shasum": "dcd8488a26f563d61079e48c9f7b7e32373682cf",
+ "_spec": "domutils@1.5.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/css-select",
+ "author": {
+ "name": "Felix Boehm",
+ "email": "me@feedic.com"
+ },
+ "bugs": {
+ "url": "https://github.com/FB55/domutils/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "dom-serializer": "0",
+ "domelementtype": "1"
+ },
+ "deprecated": false,
+ "description": "utilities for working with htmlparser2's dom",
+ "devDependencies": {
+ "domhandler": "2",
+ "htmlparser2": "~3.3.0",
+ "jshint": "~2.3.0",
+ "mocha": "~1.15.1"
+ },
+ "directories": {
+ "test": "tests"
+ },
+ "homepage": "https://github.com/FB55/domutils#readme",
+ "jshintConfig": {
+ "proto": true,
+ "unused": true,
+ "eqnull": true,
+ "undef": true,
+ "quotmark": "double",
+ "eqeqeq": true,
+ "trailing": true,
+ "node": true,
+ "globals": {
+ "describe": true,
+ "it": true,
+ "beforeEach": true
+ }
+ },
+ "keywords": [
+ "dom",
+ "htmlparser2"
+ ],
+ "main": "index.js",
+ "name": "domutils",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/FB55/domutils.git"
+ },
+ "scripts": {
+ "test": "mocha test/tests/**.js && jshint index.js test/**/*.js lib/*.js"
+ },
+ "version": "1.5.1"
+}
diff --git a/Nodejs/node_modules/domutils/readme.md b/Nodejs/node_modules/domutils/readme.md
new file mode 100644
index 0000000..9ccdda6
--- /dev/null
+++ b/Nodejs/node_modules/domutils/readme.md
@@ -0,0 +1 @@
+utilities for working with htmlparser2's dom
diff --git a/Nodejs/node_modules/domutils/test/fixture.js b/Nodejs/node_modules/domutils/test/fixture.js
new file mode 100644
index 0000000..9bd791b
--- /dev/null
+++ b/Nodejs/node_modules/domutils/test/fixture.js
@@ -0,0 +1,6 @@
+var makeDom = require("./utils").makeDom;
+var markup = Array(21).join(
+ " text "
+);
+
+module.exports = makeDom(markup);
diff --git a/Nodejs/node_modules/domutils/test/tests/helpers.js b/Nodejs/node_modules/domutils/test/tests/helpers.js
new file mode 100644
index 0000000..2e30afb
--- /dev/null
+++ b/Nodejs/node_modules/domutils/test/tests/helpers.js
@@ -0,0 +1,89 @@
+var makeDom = require("../utils").makeDom;
+var helpers = require("../..");
+var assert = require("assert");
+
+describe("helpers", function() {
+ describe("removeSubsets", function() {
+ var removeSubsets = helpers.removeSubsets;
+ var dom = makeDom("")[0];
+
+ it("removes identical trees", function() {
+ var matches = removeSubsets([dom, dom]);
+ assert.equal(matches.length, 1);
+ });
+
+ it("Removes subsets found first", function() {
+ var matches = removeSubsets([dom, dom.children[0].children[0]]);
+ assert.equal(matches.length, 1);
+ });
+
+ it("Removes subsets found last", function() {
+ var matches = removeSubsets([dom.children[0], dom]);
+ assert.equal(matches.length, 1);
+ });
+
+ it("Does not remove unique trees", function() {
+ var matches = removeSubsets([dom.children[0], dom.children[1]]);
+ assert.equal(matches.length, 2);
+ });
+ });
+
+ describe("compareDocumentPosition", function() {
+ var compareDocumentPosition = helpers.compareDocumentPosition;
+ var markup = "";
+ var dom = makeDom(markup)[0];
+ var p = dom.children[0];
+ var span = p.children[0];
+ var a = dom.children[1];
+
+ it("reports when the first node occurs before the second indirectly", function() {
+ assert.equal(compareDocumentPosition(span, a), 2);
+ });
+
+ it("reports when the first node contains the second", function() {
+ assert.equal(compareDocumentPosition(p, span), 10);
+ });
+
+ it("reports when the first node occurs after the second indirectly", function() {
+ assert.equal(compareDocumentPosition(a, span), 4);
+ });
+
+ it("reports when the first node is contained by the second", function() {
+ assert.equal(compareDocumentPosition(span, p), 20);
+ });
+
+ it("reports when the nodes belong to separate documents", function() {
+ var other = makeDom(markup)[0].children[0].children[0];
+
+ assert.equal(compareDocumentPosition(span, other), 1);
+ });
+
+ it("reports when the nodes are identical", function() {
+ assert.equal(compareDocumentPosition(span, span), 0);
+ });
+ });
+
+ describe("uniqueSort", function() {
+ var uniqueSort = helpers.uniqueSort;
+ var dom, p, span, a;
+
+ beforeEach(function() {
+ dom = makeDom("")[0];
+ p = dom.children[0];
+ span = p.children[0];
+ a = dom.children[1];
+ });
+
+ it("leaves unique elements untouched", function() {
+ assert.deepEqual(uniqueSort([p, a]), [p, a]);
+ });
+
+ it("removes duplicate elements", function() {
+ assert.deepEqual(uniqueSort([p, a, p]), [p, a]);
+ });
+
+ it("sorts nodes in document order", function() {
+ assert.deepEqual(uniqueSort([a, dom, span, p]), [dom, p, span, a]);
+ });
+ });
+});
diff --git a/Nodejs/node_modules/domutils/test/tests/legacy.js b/Nodejs/node_modules/domutils/test/tests/legacy.js
new file mode 100644
index 0000000..87fabfa
--- /dev/null
+++ b/Nodejs/node_modules/domutils/test/tests/legacy.js
@@ -0,0 +1,119 @@
+var DomUtils = require("../..");
+var fixture = require("../fixture");
+var assert = require("assert");
+
+// Set up expected structures
+var expected = {
+ idAsdf: fixture[1],
+ tag2: [],
+ typeScript: []
+};
+for (var idx = 0; idx < 20; ++idx) {
+ expected.tag2.push(fixture[idx*2 + 1].children[5]);
+ expected.typeScript.push(fixture[idx*2 + 1].children[1]);
+}
+
+describe("legacy", function() {
+ describe("getElements", function() {
+ var getElements = DomUtils.getElements;
+ it("returns the node with the specified ID", function() {
+ assert.deepEqual(
+ getElements({ id: "asdf" }, fixture, true, 1),
+ [expected.idAsdf]
+ );
+ });
+ it("returns empty array for unknown IDs", function() {
+ assert.deepEqual(getElements({ id: "asdfs" }, fixture, true), []);
+ });
+ it("returns the nodes with the specified tag name", function() {
+ assert.deepEqual(
+ getElements({ tag_name:"tag2" }, fixture, true),
+ expected.tag2
+ );
+ });
+ it("returns empty array for unknown tag names", function() {
+ assert.deepEqual(
+ getElements({ tag_name : "asdfs" }, fixture, true),
+ []
+ );
+ });
+ it("returns the nodes with the specified tag type", function() {
+ assert.deepEqual(
+ getElements({ tag_type: "script" }, fixture, true),
+ expected.typeScript
+ );
+ });
+ it("returns empty array for unknown tag types", function() {
+ assert.deepEqual(
+ getElements({ tag_type: "video" }, fixture, true),
+ []
+ );
+ });
+ });
+
+ describe("getElementById", function() {
+ var getElementById = DomUtils.getElementById;
+ it("returns the specified node", function() {
+ assert.equal(
+ expected.idAsdf,
+ getElementById("asdf", fixture, true)
+ );
+ });
+ it("returns `null` for unknown IDs", function() {
+ assert.equal(null, getElementById("asdfs", fixture, true));
+ });
+ });
+
+ describe("getElementsByTagName", function() {
+ var getElementsByTagName = DomUtils.getElementsByTagName;
+ it("returns the specified nodes", function() {
+ assert.deepEqual(
+ getElementsByTagName("tag2", fixture, true),
+ expected.tag2
+ );
+ });
+ it("returns empty array for unknown tag names", function() {
+ assert.deepEqual(
+ getElementsByTagName("tag23", fixture, true),
+ []
+ );
+ });
+ });
+
+ describe("getElementsByTagType", function() {
+ var getElementsByTagType = DomUtils.getElementsByTagType;
+ it("returns the specified nodes", function() {
+ assert.deepEqual(
+ getElementsByTagType("script", fixture, true),
+ expected.typeScript
+ );
+ });
+ it("returns empty array for unknown tag types", function() {
+ assert.deepEqual(
+ getElementsByTagType("video", fixture, true),
+ []
+ );
+ });
+ });
+
+ describe("getOuterHTML", function() {
+ var getOuterHTML = DomUtils.getOuterHTML;
+ it("Correctly renders the outer HTML", function() {
+ assert.equal(
+ getOuterHTML(fixture[1]),
+ " text "
+ );
+ });
+ });
+
+ describe("getInnerHTML", function() {
+ var getInnerHTML = DomUtils.getInnerHTML;
+ it("Correctly renders the inner HTML", function() {
+ assert.equal(
+ getInnerHTML(fixture[1]),
+ " text "
+ );
+ });
+ });
+
+});
diff --git a/Nodejs/node_modules/domutils/test/tests/traversal.js b/Nodejs/node_modules/domutils/test/tests/traversal.js
new file mode 100644
index 0000000..f500e08
--- /dev/null
+++ b/Nodejs/node_modules/domutils/test/tests/traversal.js
@@ -0,0 +1,17 @@
+var makeDom = require("../utils").makeDom;
+var traversal = require("../..");
+var assert = require("assert");
+
+describe("traversal", function() {
+ describe("hasAttrib", function() {
+ var hasAttrib = traversal.hasAttrib;
+
+ it("doesn't throw on text nodes", function() {
+ var dom = makeDom("textnode");
+ assert.doesNotThrow(function() {
+ hasAttrib(dom[0], "some-attrib");
+ });
+ });
+
+ });
+});
diff --git a/Nodejs/node_modules/domutils/test/utils.js b/Nodejs/node_modules/domutils/test/utils.js
new file mode 100644
index 0000000..676e8f6
--- /dev/null
+++ b/Nodejs/node_modules/domutils/test/utils.js
@@ -0,0 +1,9 @@
+var htmlparser = require("htmlparser2");
+
+exports.makeDom = function(markup) {
+ var handler = new htmlparser.DomHandler(),
+ parser = new htmlparser.Parser(handler);
+ parser.write(markup);
+ parser.done();
+ return handler.dom;
+};
diff --git a/Nodejs/node_modules/duplexify/.travis.yml b/Nodejs/node_modules/duplexify/.travis.yml
new file mode 100644
index 0000000..cb6e182
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+ - "4"
+ - "6"
+ - "8"
+ - "10"
diff --git a/Nodejs/node_modules/duplexify/LICENSE b/Nodejs/node_modules/duplexify/LICENSE
new file mode 100644
index 0000000..757562e
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/README.md b/Nodejs/node_modules/duplexify/README.md
new file mode 100644
index 0000000..8352900
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/README.md
@@ -0,0 +1,97 @@
+# duplexify
+
+Turn a writeable and readable stream into a single streams2 duplex stream.
+
+Similar to [duplexer2](https://github.com/deoxxa/duplexer2) except it supports both streams2 and streams1 as input
+and it allows you to set the readable and writable part asynchronously using `setReadable(stream)` and `setWritable(stream)`
+
+```
+npm install duplexify
+```
+
+[](http://travis-ci.org/mafintosh/duplexify)
+
+## Usage
+
+Use `duplexify(writable, readable, streamOptions)` (or `duplexify.obj(writable, readable)` to create an object stream)
+
+``` js
+var duplexify = require('duplexify')
+
+// turn writableStream and readableStream into a single duplex stream
+var dup = duplexify(writableStream, readableStream)
+
+dup.write('hello world') // will write to writableStream
+dup.on('data', function(data) {
+ // will read from readableStream
+})
+```
+
+You can also set the readable and writable parts asynchronously
+
+``` js
+var dup = duplexify()
+
+dup.write('hello world') // write will buffer until the writable
+ // part has been set
+
+// wait a bit ...
+dup.setReadable(readableStream)
+
+// maybe wait some more?
+dup.setWritable(writableStream)
+```
+
+If you call `setReadable` or `setWritable` multiple times it will unregister the previous readable/writable stream.
+To disable the readable or writable part call `setReadable` or `setWritable` with `null`.
+
+If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event.
+You can also explicitly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an
+error object as argument, in which case the error is emitted as part of the `error` event.
+
+``` js
+dup.on('error', function(err) {
+ console.log('readable or writable emitted an error - close will follow')
+})
+
+dup.on('close', function() {
+ console.log('the duplex stream is destroyed')
+})
+
+dup.destroy() // calls destroy on the readable and writable part (if present)
+```
+
+## HTTP request example
+
+Turn a node core http request into a duplex stream is as easy as
+
+``` js
+var duplexify = require('duplexify')
+var http = require('http')
+
+var request = function(opts) {
+ var req = http.request(opts)
+ var dup = duplexify(req)
+ req.on('response', function(res) {
+ dup.setReadable(res)
+ })
+ return dup
+}
+
+var req = request({
+ method: 'GET',
+ host: 'www.google.com',
+ port: 80
+})
+
+req.end()
+req.pipe(process.stdout)
+```
+
+## License
+
+MIT
+
+## Related
+
+`duplexify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
diff --git a/Nodejs/node_modules/duplexify/example.js b/Nodejs/node_modules/duplexify/example.js
new file mode 100644
index 0000000..5585c19
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/example.js
@@ -0,0 +1,21 @@
+var duplexify = require('duplexify')
+var http = require('http')
+
+var request = function(opts) {
+ var req = http.request(opts)
+ var dup = duplexify()
+ dup.setWritable(req)
+ req.on('response', function(res) {
+ dup.setReadable(res)
+ })
+ return dup
+}
+
+var req = request({
+ method: 'GET',
+ host: 'www.google.com',
+ port: 80
+})
+
+req.end()
+req.pipe(process.stdout)
diff --git a/Nodejs/node_modules/duplexify/index.js b/Nodejs/node_modules/duplexify/index.js
new file mode 100644
index 0000000..18634c2
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/index.js
@@ -0,0 +1,234 @@
+var stream = require('readable-stream')
+var eos = require('end-of-stream')
+var inherits = require('inherits')
+var shift = require('stream-shift')
+
+var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)
+ ? Buffer.from([0])
+ : new Buffer([0])
+
+var onuncork = function(self, fn) {
+ if (self._corked) self.once('uncork', fn)
+ else fn()
+}
+
+var autoDestroy = function (self, err) {
+ if (self._autoDestroy) self.destroy(err)
+}
+
+var destroyer = function(self, end) {
+ return function(err) {
+ if (err) autoDestroy(self, err.message === 'premature close' ? null : err)
+ else if (end && !self._ended) self.end()
+ }
+}
+
+var end = function(ws, fn) {
+ if (!ws) return fn()
+ if (ws._writableState && ws._writableState.finished) return fn()
+ if (ws._writableState) return ws.end(fn)
+ ws.end()
+ fn()
+}
+
+var toStreams2 = function(rs) {
+ return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)
+}
+
+var Duplexify = function(writable, readable, opts) {
+ if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts)
+ stream.Duplex.call(this, opts)
+
+ this._writable = null
+ this._readable = null
+ this._readable2 = null
+
+ this._autoDestroy = !opts || opts.autoDestroy !== false
+ this._forwardDestroy = !opts || opts.destroy !== false
+ this._forwardEnd = !opts || opts.end !== false
+ this._corked = 1 // start corked
+ this._ondrain = null
+ this._drained = false
+ this._forwarding = false
+ this._unwrite = null
+ this._unread = null
+ this._ended = false
+
+ this.destroyed = false
+
+ if (writable) this.setWritable(writable)
+ if (readable) this.setReadable(readable)
+}
+
+inherits(Duplexify, stream.Duplex)
+
+Duplexify.obj = function(writable, readable, opts) {
+ if (!opts) opts = {}
+ opts.objectMode = true
+ opts.highWaterMark = 16
+ return new Duplexify(writable, readable, opts)
+}
+
+Duplexify.prototype.cork = function() {
+ if (++this._corked === 1) this.emit('cork')
+}
+
+Duplexify.prototype.uncork = function() {
+ if (this._corked && --this._corked === 0) this.emit('uncork')
+}
+
+Duplexify.prototype.setWritable = function(writable) {
+ if (this._unwrite) this._unwrite()
+
+ if (this.destroyed) {
+ if (writable && writable.destroy) writable.destroy()
+ return
+ }
+
+ if (writable === null || writable === false) {
+ this.end()
+ return
+ }
+
+ var self = this
+ var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd))
+
+ var ondrain = function() {
+ var ondrain = self._ondrain
+ self._ondrain = null
+ if (ondrain) ondrain()
+ }
+
+ var clear = function() {
+ self._writable.removeListener('drain', ondrain)
+ unend()
+ }
+
+ if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks
+
+ this._writable = writable
+ this._writable.on('drain', ondrain)
+ this._unwrite = clear
+
+ this.uncork() // always uncork setWritable
+}
+
+Duplexify.prototype.setReadable = function(readable) {
+ if (this._unread) this._unread()
+
+ if (this.destroyed) {
+ if (readable && readable.destroy) readable.destroy()
+ return
+ }
+
+ if (readable === null || readable === false) {
+ this.push(null)
+ this.resume()
+ return
+ }
+
+ var self = this
+ var unend = eos(readable, {writable:false, readable:true}, destroyer(this))
+
+ var onreadable = function() {
+ self._forward()
+ }
+
+ var onend = function() {
+ self.push(null)
+ }
+
+ var clear = function() {
+ self._readable2.removeListener('readable', onreadable)
+ self._readable2.removeListener('end', onend)
+ unend()
+ }
+
+ this._drained = true
+ this._readable = readable
+ this._readable2 = readable._readableState ? readable : toStreams2(readable)
+ this._readable2.on('readable', onreadable)
+ this._readable2.on('end', onend)
+ this._unread = clear
+
+ this._forward()
+}
+
+Duplexify.prototype._read = function() {
+ this._drained = true
+ this._forward()
+}
+
+Duplexify.prototype._forward = function() {
+ if (this._forwarding || !this._readable2 || !this._drained) return
+ this._forwarding = true
+
+ var data
+
+ while (this._drained && (data = shift(this._readable2)) !== null) {
+ if (this.destroyed) continue
+ this._drained = this.push(data)
+ }
+
+ this._forwarding = false
+}
+
+Duplexify.prototype.destroy = function(err) {
+ if (this.destroyed) return
+ this.destroyed = true
+
+ var self = this
+ process.nextTick(function() {
+ self._destroy(err)
+ })
+}
+
+Duplexify.prototype._destroy = function(err) {
+ if (err) {
+ var ondrain = this._ondrain
+ this._ondrain = null
+ if (ondrain) ondrain(err)
+ else this.emit('error', err)
+ }
+
+ if (this._forwardDestroy) {
+ if (this._readable && this._readable.destroy) this._readable.destroy()
+ if (this._writable && this._writable.destroy) this._writable.destroy()
+ }
+
+ this.emit('close')
+}
+
+Duplexify.prototype._write = function(data, enc, cb) {
+ if (this.destroyed) return cb()
+ if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb))
+ if (data === SIGNAL_FLUSH) return this._finish(cb)
+ if (!this._writable) return cb()
+
+ if (this._writable.write(data) === false) this._ondrain = cb
+ else cb()
+}
+
+Duplexify.prototype._finish = function(cb) {
+ var self = this
+ this.emit('preend')
+ onuncork(this, function() {
+ end(self._forwardEnd && self._writable, function() {
+ // haxx to not emit prefinish twice
+ if (self._writableState.prefinished === false) self._writableState.prefinished = true
+ self.emit('prefinish')
+ onuncork(self, cb)
+ })
+ })
+}
+
+Duplexify.prototype.end = function(data, enc, cb) {
+ if (typeof data === 'function') return this.end(null, null, data)
+ if (typeof enc === 'function') return this.end(data, null, enc)
+ this._ended = true
+ if (data) this.write(data)
+ if (!this._writableState.ending) this.write(SIGNAL_FLUSH)
+ return stream.Writable.prototype.end.call(this, cb)
+}
+
+module.exports = Duplexify
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/.travis.yml b/Nodejs/node_modules/duplexify/node_modules/readable-stream/.travis.yml
new file mode 100644
index 0000000..f62cdac
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/.travis.yml
@@ -0,0 +1,34 @@
+sudo: false
+language: node_js
+before_install:
+ - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ include:
+ - node_js: '0.8'
+ env: NPM_LEGACY=true
+ - node_js: '0.10'
+ env: NPM_LEGACY=true
+ - node_js: '0.11'
+ env: NPM_LEGACY=true
+ - node_js: '0.12'
+ env: NPM_LEGACY=true
+ - node_js: 1
+ env: NPM_LEGACY=true
+ - node_js: 2
+ env: NPM_LEGACY=true
+ - node_js: 3
+ env: NPM_LEGACY=true
+ - node_js: 4
+ - node_js: 5
+ - node_js: 6
+ - node_js: 7
+ - node_js: 8
+ - node_js: 9
+script: "npm run test"
+env:
+ global:
+ - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
+ - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/CONTRIBUTING.md b/Nodejs/node_modules/duplexify/node_modules/readable-stream/CONTRIBUTING.md
new file mode 100644
index 0000000..f478d58
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/CONTRIBUTING.md
@@ -0,0 +1,38 @@
+# Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+* (a) The contribution was created in whole or in part by me and I
+ have the right to submit it under the open source license
+ indicated in the file; or
+
+* (b) The contribution is based upon previous work that, to the best
+ of my knowledge, is covered under an appropriate open source
+ license and I have the right under that license to submit that
+ work with modifications, whether created in whole or in part
+ by me, under the same open source license (unless I am
+ permitted to submit under a different license), as indicated
+ in the file; or
+
+* (c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+* (d) I understand and agree that this project and the contribution
+ are public and that a record of the contribution (including all
+ personal information I submit with it, including my sign-off) is
+ maintained indefinitely and may be redistributed consistent with
+ this project or the open source license(s) involved.
+
+## Moderation Policy
+
+The [Node.js Moderation Policy] applies to this WG.
+
+## Code of Conduct
+
+The [Node.js Code of Conduct][] applies to this WG.
+
+[Node.js Code of Conduct]:
+https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
+[Node.js Moderation Policy]:
+https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md b/Nodejs/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md
new file mode 100644
index 0000000..16ffb93
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/GOVERNANCE.md
@@ -0,0 +1,136 @@
+### Streams Working Group
+
+The Node.js Streams is jointly governed by a Working Group
+(WG)
+that is responsible for high-level guidance of the project.
+
+The WG has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+* Conduct guidelines
+* Maintaining the list of additional Collaborators
+
+For the current list of WG members, see the project
+[README.md](./README.md#current-project-team-members).
+
+### Collaborators
+
+The readable-stream GitHub repository is
+maintained by the WG and additional Collaborators who are added by the
+WG on an ongoing basis.
+
+Individuals making significant and valuable contributions are made
+Collaborators and given commit-access to the project. These
+individuals are identified by the WG and their addition as
+Collaborators is discussed during the WG meeting.
+
+_Note:_ If you make a significant contribution and are not considered
+for commit-access log an issue or contact a WG member directly and it
+will be brought up in the next WG meeting.
+
+Modifications of the contents of the readable-stream repository are
+made on
+a collaborative basis. Anybody with a GitHub account may propose a
+modification via pull request and it will be considered by the project
+Collaborators. All pull requests must be reviewed and accepted by a
+Collaborator with sufficient expertise who is able to take full
+responsibility for the change. In the case of pull requests proposed
+by an existing Collaborator, an additional Collaborator is required
+for sign-off. Consensus should be sought if additional Collaborators
+participate and there is disagreement around a particular
+modification. See _Consensus Seeking Process_ below for further detail
+on the consensus model used for governance.
+
+Collaborators may opt to elevate significant or controversial
+modifications, or modifications that have not found consensus to the
+WG for discussion by assigning the ***WG-agenda*** tag to a pull
+request or issue. The WG should serve as the final arbiter where
+required.
+
+For the current list of Collaborators, see the project
+[README.md](./README.md#members).
+
+### WG Membership
+
+WG seats are not time-limited. There is no fixed size of the WG.
+However, the expected target is between 6 and 12, to ensure adequate
+coverage of important areas of expertise, balanced with the ability to
+make decisions efficiently.
+
+There is no specific set of requirements or qualifications for WG
+membership beyond these rules.
+
+The WG may add additional members to the WG by unanimous consensus.
+
+A WG member may be removed from the WG by voluntary resignation, or by
+unanimous consensus of all other WG members.
+
+Changes to WG membership should be posted in the agenda, and may be
+suggested as any other agenda item (see "WG Meetings" below).
+
+If an addition or removal is proposed during a meeting, and the full
+WG is not in attendance to participate, then the addition or removal
+is added to the agenda for the subsequent meeting. This is to ensure
+that all members are given the opportunity to participate in all
+membership decisions. If a WG member is unable to attend a meeting
+where a planned membership decision is being made, then their consent
+is assumed.
+
+No more than 1/3 of the WG members may be affiliated with the same
+employer. If removal or resignation of a WG member, or a change of
+employment by a WG member, creates a situation where more than 1/3 of
+the WG membership shares an employer, then the situation must be
+immediately remedied by the resignation or removal of one or more WG
+members affiliated with the over-represented employer(s).
+
+### WG Meetings
+
+The WG meets occasionally on a Google Hangout On Air. A designated moderator
+approved by the WG runs the meeting. Each meeting should be
+published to YouTube.
+
+Items are added to the WG agenda that are considered contentious or
+are modifications of governance, contribution policy, WG membership,
+or release process.
+
+The intention of the agenda is not to approve or review all patches;
+that should happen continuously on GitHub and be handled by the larger
+group of Collaborators.
+
+Any community member or contributor can ask that something be added to
+the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
+WG member or the moderator can add the item to the agenda by adding
+the ***WG-agenda*** tag to the issue.
+
+Prior to each WG meeting the moderator will share the Agenda with
+members of the WG. WG members can add any items they like to the
+agenda at the beginning of each meeting. The moderator and the WG
+cannot veto or remove items.
+
+The WG may invite persons or representatives from certain projects to
+participate in a non-voting capacity.
+
+The moderator is responsible for summarizing the discussion of each
+agenda item and sends it as a pull request after the meeting.
+
+### Consensus Seeking Process
+
+The WG follows a
+[Consensus
+Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
+decision-making model.
+
+When an agenda item has appeared to reach a consensus the moderator
+will ask "Does anyone object?" as a final call for dissent from the
+consensus.
+
+If an agenda item cannot reach a consensus a WG member can call for
+either a closing vote or a vote to table the issue to the next
+meeting. The call for a vote must be seconded by a majority of the WG
+or else the discussion will continue. Simple majority wins.
+
+Note that changes to WG membership require a majority consensus. See
+"WG Membership" above.
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/LICENSE b/Nodejs/node_modules/duplexify/node_modules/readable-stream/LICENSE
new file mode 100644
index 0000000..2873b3b
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/LICENSE
@@ -0,0 +1,47 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/README.md b/Nodejs/node_modules/duplexify/node_modules/readable-stream/README.md
new file mode 100644
index 0000000..23fe3f3
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/README.md
@@ -0,0 +1,58 @@
+# readable-stream
+
+***Node-core v8.11.1 streams for userland*** [](https://travis-ci.org/nodejs/readable-stream)
+
+
+[](https://nodei.co/npm/readable-stream/)
+[](https://nodei.co/npm/readable-stream/)
+
+
+[](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
+
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+# Streams Working Group
+
+`readable-stream` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+
+## Team Members
+
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>
+ - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>
+ - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>
+ - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>
+* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) <matteo.collina@gmail.com>
+ - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
+* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) <shestak.irina@gmail.com>
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/Nodejs/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
new file mode 100644
index 0000000..83275f1
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
@@ -0,0 +1,60 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+ but, we lose the opportunity to change the model
+ may not be backwards incompatible (double check keys)
+
+ **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+ * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
+
+
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js
new file mode 100644
index 0000000..f8b2db8
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/duplex-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_duplex.js');
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/duplex.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/duplex.js
new file mode 100644
index 0000000..46924cb
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/duplex.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Duplex
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000..57003c3
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,131 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+/**/
+var objectKeys = Object.keys || function (obj) {
+ var keys = [];
+ for (var key in obj) {
+ keys.push(key);
+ }return keys;
+};
+/* */
+
+module.exports = Duplex;
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+{
+ // avoid scope creep, the keys array can then be collected
+ var keys = objectKeys(Writable.prototype);
+ for (var v = 0; v < keys.length; v++) {
+ var method = keys[v];
+ if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
+ }
+}
+
+function Duplex(options) {
+ if (!(this instanceof Duplex)) return new Duplex(options);
+
+ Readable.call(this, options);
+ Writable.call(this, options);
+
+ if (options && options.readable === false) this.readable = false;
+
+ if (options && options.writable === false) this.writable = false;
+
+ this.allowHalfOpen = true;
+ if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
+
+ this.once('end', onend);
+}
+
+Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// the no-half-open enforcer
+function onend() {
+ // if we allow half-open state, or if the writable side ended,
+ // then we're ok.
+ if (this.allowHalfOpen || this._writableState.ended) return;
+
+ // no more data can be written.
+ // But allow more writes to happen in this tick.
+ pna.nextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+ self.end();
+}
+
+Object.defineProperty(Duplex.prototype, 'destroyed', {
+ get: function () {
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed && this._writableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (this._readableState === undefined || this._writableState === undefined) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ this._writableState.destroyed = value;
+ }
+});
+
+Duplex.prototype._destroy = function (err, cb) {
+ this.push(null);
+ this.end();
+
+ pna.nextTick(cb, err);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000..612edb4
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,47 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+ if (!(this instanceof PassThrough)) return new PassThrough(options);
+
+ Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+ cb(null, chunk);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000..0f80764
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,1019 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+module.exports = Readable;
+
+/**/
+var isArray = require('isarray');
+/* */
+
+/**/
+var Duplex;
+/* */
+
+Readable.ReadableState = ReadableState;
+
+/**/
+var EE = require('events').EventEmitter;
+
+var EElistenerCount = function (emitter, type) {
+ return emitter.listeners(type).length;
+};
+/* */
+
+/**/
+var Stream = require('./internal/streams/stream');
+/* */
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/* */
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+/**/
+var debugUtil = require('util');
+var debug = void 0;
+if (debugUtil && debugUtil.debuglog) {
+ debug = debugUtil.debuglog('stream');
+} else {
+ debug = function () {};
+}
+/* */
+
+var BufferList = require('./internal/streams/BufferList');
+var destroyImpl = require('./internal/streams/destroy');
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
+
+function prependListener(emitter, event, fn) {
+ // Sadly this is not cacheable as some libraries bundle their own
+ // event emitter implementation with them.
+ if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
+
+ // This is a hack to make sure that our error handler is attached before any
+ // userland ones. NEVER DO THIS. This is here only because this code needs
+ // to continue to work with older versions of Node.js that do not include
+ // the prependListener() method. The goal is to eventually remove this hack.
+ if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
+}
+
+function ReadableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ var isDuplex = stream instanceof Duplex;
+
+ // object stream flag. Used to make read(n) ignore n and to
+ // make all the buffer merging and length checks go away
+ this.objectMode = !!options.objectMode;
+
+ if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+ // the point at which it stops calling _read() to fill the buffer
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
+ var hwm = options.highWaterMark;
+ var readableHwm = options.readableHighWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = Math.floor(this.highWaterMark);
+
+ // A linked list is used to store data chunks instead of an array because the
+ // linked list can remove elements from the beginning faster than
+ // array.shift()
+ this.buffer = new BufferList();
+ this.length = 0;
+ this.pipes = null;
+ this.pipesCount = 0;
+ this.flowing = null;
+ this.ended = false;
+ this.endEmitted = false;
+ this.reading = false;
+
+ // a flag to be able to tell if the event 'readable'/'data' is emitted
+ // immediately, or on a later tick. We set this to true at first, because
+ // any actions that shouldn't happen until "later" should generally also
+ // not happen before the first read call.
+ this.sync = true;
+
+ // whenever we return null, then we set a flag to say
+ // that we're awaiting a 'readable' event emission.
+ this.needReadable = false;
+ this.emittedReadable = false;
+ this.readableListening = false;
+ this.resumeScheduled = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // the number of writers that are awaiting a drain event in .pipe()s
+ this.awaitDrain = 0;
+
+ // if true, a maybeReadMore has been scheduled
+ this.readingMore = false;
+
+ this.decoder = null;
+ this.encoding = null;
+ if (options.encoding) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this.decoder = new StringDecoder(options.encoding);
+ this.encoding = options.encoding;
+ }
+}
+
+function Readable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ if (!(this instanceof Readable)) return new Readable(options);
+
+ this._readableState = new ReadableState(options, this);
+
+ // legacy
+ this.readable = true;
+
+ if (options) {
+ if (typeof options.read === 'function') this._read = options.read;
+
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+ }
+
+ Stream.call(this);
+}
+
+Object.defineProperty(Readable.prototype, 'destroyed', {
+ get: function () {
+ if (this._readableState === undefined) {
+ return false;
+ }
+ return this._readableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._readableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._readableState.destroyed = value;
+ }
+});
+
+Readable.prototype.destroy = destroyImpl.destroy;
+Readable.prototype._undestroy = destroyImpl.undestroy;
+Readable.prototype._destroy = function (err, cb) {
+ this.push(null);
+ cb(err);
+};
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+ var state = this._readableState;
+ var skipChunkCheck;
+
+ if (!state.objectMode) {
+ if (typeof chunk === 'string') {
+ encoding = encoding || state.defaultEncoding;
+ if (encoding !== state.encoding) {
+ chunk = Buffer.from(chunk, encoding);
+ encoding = '';
+ }
+ skipChunkCheck = true;
+ }
+ } else {
+ skipChunkCheck = true;
+ }
+
+ return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function (chunk) {
+ return readableAddChunk(this, chunk, null, true, false);
+};
+
+function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
+ var state = stream._readableState;
+ if (chunk === null) {
+ state.reading = false;
+ onEofChunk(stream, state);
+ } else {
+ var er;
+ if (!skipChunkCheck) er = chunkInvalid(state, chunk);
+ if (er) {
+ stream.emit('error', er);
+ } else if (state.objectMode || chunk && chunk.length > 0) {
+ if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+
+ if (addToFront) {
+ if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
+ } else if (state.ended) {
+ stream.emit('error', new Error('stream.push() after EOF'));
+ } else {
+ state.reading = false;
+ if (state.decoder && !encoding) {
+ chunk = state.decoder.write(chunk);
+ if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
+ } else {
+ addChunk(stream, state, chunk, false);
+ }
+ }
+ } else if (!addToFront) {
+ state.reading = false;
+ }
+ }
+
+ return needMoreData(state);
+}
+
+function addChunk(stream, state, chunk, addToFront) {
+ if (state.flowing && state.length === 0 && !state.sync) {
+ stream.emit('data', chunk);
+ stream.read(0);
+ } else {
+ // update the buffer info.
+ state.length += state.objectMode ? 1 : chunk.length;
+ if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+
+ if (state.needReadable) emitReadable(stream);
+ }
+ maybeReadMore(stream, state);
+}
+
+function chunkInvalid(state, chunk) {
+ var er;
+ if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ return er;
+}
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes. This is to work around cases where hwm=0,
+// such as the repl. Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+ return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+}
+
+Readable.prototype.isPaused = function () {
+ return this._readableState.flowing === false;
+};
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+ if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+ this._readableState.decoder = new StringDecoder(enc);
+ this._readableState.encoding = enc;
+ return this;
+};
+
+// Don't raise the hwm > 8MB
+var MAX_HWM = 0x800000;
+function computeNewHighWaterMark(n) {
+ if (n >= MAX_HWM) {
+ n = MAX_HWM;
+ } else {
+ // Get the next highest power of 2 to prevent increasing hwm excessively in
+ // tiny amounts
+ n--;
+ n |= n >>> 1;
+ n |= n >>> 2;
+ n |= n >>> 4;
+ n |= n >>> 8;
+ n |= n >>> 16;
+ n++;
+ }
+ return n;
+}
+
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function howMuchToRead(n, state) {
+ if (n <= 0 || state.length === 0 && state.ended) return 0;
+ if (state.objectMode) return 1;
+ if (n !== n) {
+ // Only flow one buffer at a time
+ if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
+ }
+ // If we're asking for more than the current hwm, then raise the hwm.
+ if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
+ if (n <= state.length) return n;
+ // Don't have enough
+ if (!state.ended) {
+ state.needReadable = true;
+ return 0;
+ }
+ return state.length;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function (n) {
+ debug('read', n);
+ n = parseInt(n, 10);
+ var state = this._readableState;
+ var nOrig = n;
+
+ if (n !== 0) state.emittedReadable = false;
+
+ // if we're doing read(0) to trigger a readable event, but we
+ // already have a bunch of data in the buffer, then just trigger
+ // the 'readable' event and move on.
+ if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
+ debug('read: emitReadable', state.length, state.ended);
+ if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+ return null;
+ }
+
+ n = howMuchToRead(n, state);
+
+ // if we've ended, and we're now clear, then finish it up.
+ if (n === 0 && state.ended) {
+ if (state.length === 0) endReadable(this);
+ return null;
+ }
+
+ // All the actual chunk generation logic needs to be
+ // *below* the call to _read. The reason is that in certain
+ // synthetic stream cases, such as passthrough streams, _read
+ // may be a completely synchronous operation which may change
+ // the state of the read buffer, providing enough data when
+ // before there was *not* enough.
+ //
+ // So, the steps are:
+ // 1. Figure out what the state of things will be after we do
+ // a read from the buffer.
+ //
+ // 2. If that resulting state will trigger a _read, then call _read.
+ // Note that this may be asynchronous, or synchronous. Yes, it is
+ // deeply ugly to write APIs this way, but that still doesn't mean
+ // that the Readable class should behave improperly, as streams are
+ // designed to be sync/async agnostic.
+ // Take note if the _read call is sync or async (ie, if the read call
+ // has returned yet), so that we know whether or not it's safe to emit
+ // 'readable' etc.
+ //
+ // 3. Actually pull the requested chunks out of the buffer and return.
+
+ // if we need a readable event, then we need to do some reading.
+ var doRead = state.needReadable;
+ debug('need readable', doRead);
+
+ // if we currently have less than the highWaterMark, then also read some
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
+ doRead = true;
+ debug('length less than watermark', doRead);
+ }
+
+ // however, if we've ended, then there's no point, and if we're already
+ // reading, then it's unnecessary.
+ if (state.ended || state.reading) {
+ doRead = false;
+ debug('reading or ended', doRead);
+ } else if (doRead) {
+ debug('do read');
+ state.reading = true;
+ state.sync = true;
+ // if the length is currently zero, then we *need* a readable event.
+ if (state.length === 0) state.needReadable = true;
+ // call internal read method
+ this._read(state.highWaterMark);
+ state.sync = false;
+ // If _read pushed data synchronously, then `reading` will be false,
+ // and we need to re-evaluate how much data we can return to the user.
+ if (!state.reading) n = howMuchToRead(nOrig, state);
+ }
+
+ var ret;
+ if (n > 0) ret = fromList(n, state);else ret = null;
+
+ if (ret === null) {
+ state.needReadable = true;
+ n = 0;
+ } else {
+ state.length -= n;
+ }
+
+ if (state.length === 0) {
+ // If we have nothing in the buffer, then we want to know
+ // as soon as we *do* get something into the buffer.
+ if (!state.ended) state.needReadable = true;
+
+ // If we tried to read() past the EOF, then emit end on the next tick.
+ if (nOrig !== n && state.ended) endReadable(this);
+ }
+
+ if (ret !== null) this.emit('data', ret);
+
+ return ret;
+};
+
+function onEofChunk(stream, state) {
+ if (state.ended) return;
+ if (state.decoder) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) {
+ state.buffer.push(chunk);
+ state.length += state.objectMode ? 1 : chunk.length;
+ }
+ }
+ state.ended = true;
+
+ // emit 'readable' now to make sure it gets picked up.
+ emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow. This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+ var state = stream._readableState;
+ state.needReadable = false;
+ if (!state.emittedReadable) {
+ debug('emitReadable', state.flowing);
+ state.emittedReadable = true;
+ if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
+ }
+}
+
+function emitReadable_(stream) {
+ debug('emit readable');
+ stream.emit('readable');
+ flow(stream);
+}
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data. that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+ if (!state.readingMore) {
+ state.readingMore = true;
+ pna.nextTick(maybeReadMore_, stream, state);
+ }
+}
+
+function maybeReadMore_(stream, state) {
+ var len = state.length;
+ while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
+ debug('maybeReadMore read 0');
+ stream.read(0);
+ if (len === state.length)
+ // didn't get any data, stop spinning.
+ break;else len = state.length;
+ }
+ state.readingMore = false;
+}
+
+// abstract method. to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function (n) {
+ this.emit('error', new Error('_read() is not implemented'));
+};
+
+Readable.prototype.pipe = function (dest, pipeOpts) {
+ var src = this;
+ var state = this._readableState;
+
+ switch (state.pipesCount) {
+ case 0:
+ state.pipes = dest;
+ break;
+ case 1:
+ state.pipes = [state.pipes, dest];
+ break;
+ default:
+ state.pipes.push(dest);
+ break;
+ }
+ state.pipesCount += 1;
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+
+ var endFn = doEnd ? onend : unpipe;
+ if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
+
+ dest.on('unpipe', onunpipe);
+ function onunpipe(readable, unpipeInfo) {
+ debug('onunpipe');
+ if (readable === src) {
+ if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
+ unpipeInfo.hasUnpiped = true;
+ cleanup();
+ }
+ }
+ }
+
+ function onend() {
+ debug('onend');
+ dest.end();
+ }
+
+ // when the dest drains, it reduces the awaitDrain counter
+ // on the source. This would be more elegant with a .once()
+ // handler in flow(), but adding and removing repeatedly is
+ // too slow.
+ var ondrain = pipeOnDrain(src);
+ dest.on('drain', ondrain);
+
+ var cleanedUp = false;
+ function cleanup() {
+ debug('cleanup');
+ // cleanup event handlers once the pipe is broken
+ dest.removeListener('close', onclose);
+ dest.removeListener('finish', onfinish);
+ dest.removeListener('drain', ondrain);
+ dest.removeListener('error', onerror);
+ dest.removeListener('unpipe', onunpipe);
+ src.removeListener('end', onend);
+ src.removeListener('end', unpipe);
+ src.removeListener('data', ondata);
+
+ cleanedUp = true;
+
+ // if the reader is waiting for a drain event from this
+ // specific writer, then it would cause it to never start
+ // flowing again.
+ // So, if this is awaiting a drain, then we just call it now.
+ // If we don't know, then assume that we are waiting for one.
+ if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+ }
+
+ // If the user pushes more data while we're writing to dest then we'll end up
+ // in ondata again. However, we only want to increase awaitDrain once because
+ // dest will only emit one 'drain' event for the multiple writes.
+ // => Introduce a guard on increasing awaitDrain.
+ var increasedAwaitDrain = false;
+ src.on('data', ondata);
+ function ondata(chunk) {
+ debug('ondata');
+ increasedAwaitDrain = false;
+ var ret = dest.write(chunk);
+ if (false === ret && !increasedAwaitDrain) {
+ // If the user unpiped during `dest.write()`, it is possible
+ // to get stuck in a permanently paused state if that write
+ // also returned false.
+ // => Check whether `dest` is still a piping destination.
+ if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
+ debug('false write response, pause', src._readableState.awaitDrain);
+ src._readableState.awaitDrain++;
+ increasedAwaitDrain = true;
+ }
+ src.pause();
+ }
+ }
+
+ // if the dest has an error, then stop piping into it.
+ // however, don't suppress the throwing behavior for this.
+ function onerror(er) {
+ debug('onerror', er);
+ unpipe();
+ dest.removeListener('error', onerror);
+ if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
+ }
+
+ // Make sure our error handler is attached before userland ones.
+ prependListener(dest, 'error', onerror);
+
+ // Both close and finish should trigger unpipe, but only once.
+ function onclose() {
+ dest.removeListener('finish', onfinish);
+ unpipe();
+ }
+ dest.once('close', onclose);
+ function onfinish() {
+ debug('onfinish');
+ dest.removeListener('close', onclose);
+ unpipe();
+ }
+ dest.once('finish', onfinish);
+
+ function unpipe() {
+ debug('unpipe');
+ src.unpipe(dest);
+ }
+
+ // tell the dest that it's being piped to
+ dest.emit('pipe', src);
+
+ // start the flow if it hasn't been started already.
+ if (!state.flowing) {
+ debug('pipe resume');
+ src.resume();
+ }
+
+ return dest;
+};
+
+function pipeOnDrain(src) {
+ return function () {
+ var state = src._readableState;
+ debug('pipeOnDrain', state.awaitDrain);
+ if (state.awaitDrain) state.awaitDrain--;
+ if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+ state.flowing = true;
+ flow(src);
+ }
+ };
+}
+
+Readable.prototype.unpipe = function (dest) {
+ var state = this._readableState;
+ var unpipeInfo = { hasUnpiped: false };
+
+ // if we're not piping anywhere, then do nothing.
+ if (state.pipesCount === 0) return this;
+
+ // just one destination. most common case.
+ if (state.pipesCount === 1) {
+ // passed in one, but it's not the right one.
+ if (dest && dest !== state.pipes) return this;
+
+ if (!dest) dest = state.pipes;
+
+ // got a match.
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+ if (dest) dest.emit('unpipe', this, unpipeInfo);
+ return this;
+ }
+
+ // slow case. multiple pipe destinations.
+
+ if (!dest) {
+ // remove all.
+ var dests = state.pipes;
+ var len = state.pipesCount;
+ state.pipes = null;
+ state.pipesCount = 0;
+ state.flowing = false;
+
+ for (var i = 0; i < len; i++) {
+ dests[i].emit('unpipe', this, unpipeInfo);
+ }return this;
+ }
+
+ // try to find the right one.
+ var index = indexOf(state.pipes, dest);
+ if (index === -1) return this;
+
+ state.pipes.splice(index, 1);
+ state.pipesCount -= 1;
+ if (state.pipesCount === 1) state.pipes = state.pipes[0];
+
+ dest.emit('unpipe', this, unpipeInfo);
+
+ return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+ var res = Stream.prototype.on.call(this, ev, fn);
+
+ if (ev === 'data') {
+ // Start flowing on next tick if stream isn't explicitly paused
+ if (this._readableState.flowing !== false) this.resume();
+ } else if (ev === 'readable') {
+ var state = this._readableState;
+ if (!state.endEmitted && !state.readableListening) {
+ state.readableListening = state.needReadable = true;
+ state.emittedReadable = false;
+ if (!state.reading) {
+ pna.nextTick(nReadingNextTick, this);
+ } else if (state.length) {
+ emitReadable(this);
+ }
+ }
+ }
+
+ return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+function nReadingNextTick(self) {
+ debug('readable nexttick read 0');
+ self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+ var state = this._readableState;
+ if (!state.flowing) {
+ debug('resume');
+ state.flowing = true;
+ resume(this, state);
+ }
+ return this;
+};
+
+function resume(stream, state) {
+ if (!state.resumeScheduled) {
+ state.resumeScheduled = true;
+ pna.nextTick(resume_, stream, state);
+ }
+}
+
+function resume_(stream, state) {
+ if (!state.reading) {
+ debug('resume read 0');
+ stream.read(0);
+ }
+
+ state.resumeScheduled = false;
+ state.awaitDrain = 0;
+ stream.emit('resume');
+ flow(stream);
+ if (state.flowing && !state.reading) stream.read(0);
+}
+
+Readable.prototype.pause = function () {
+ debug('call pause flowing=%j', this._readableState.flowing);
+ if (false !== this._readableState.flowing) {
+ debug('pause');
+ this._readableState.flowing = false;
+ this.emit('pause');
+ }
+ return this;
+};
+
+function flow(stream) {
+ var state = stream._readableState;
+ debug('flow', state.flowing);
+ while (state.flowing && stream.read() !== null) {}
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+ var _this = this;
+
+ var state = this._readableState;
+ var paused = false;
+
+ stream.on('end', function () {
+ debug('wrapped end');
+ if (state.decoder && !state.ended) {
+ var chunk = state.decoder.end();
+ if (chunk && chunk.length) _this.push(chunk);
+ }
+
+ _this.push(null);
+ });
+
+ stream.on('data', function (chunk) {
+ debug('wrapped data');
+ if (state.decoder) chunk = state.decoder.write(chunk);
+
+ // don't skip over falsy values in objectMode
+ if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+
+ var ret = _this.push(chunk);
+ if (!ret) {
+ paused = true;
+ stream.pause();
+ }
+ });
+
+ // proxy all the other methods.
+ // important when wrapping filters and duplexes.
+ for (var i in stream) {
+ if (this[i] === undefined && typeof stream[i] === 'function') {
+ this[i] = function (method) {
+ return function () {
+ return stream[method].apply(stream, arguments);
+ };
+ }(i);
+ }
+ }
+
+ // proxy certain important events.
+ for (var n = 0; n < kProxyEvents.length; n++) {
+ stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
+ }
+
+ // when we try to consume some more bytes, simply unpause the
+ // underlying stream.
+ this._read = function (n) {
+ debug('wrapped _read', n);
+ if (paused) {
+ paused = false;
+ stream.resume();
+ }
+ };
+
+ return this;
+};
+
+Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._readableState.highWaterMark;
+ }
+});
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromList(n, state) {
+ // nothing buffered
+ if (state.length === 0) return null;
+
+ var ret;
+ if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
+ // read it all, truncate the list
+ if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
+ state.buffer.clear();
+ } else {
+ // read part of list
+ ret = fromListPartial(n, state.buffer, state.decoder);
+ }
+
+ return ret;
+}
+
+// Extracts only enough buffered data to satisfy the amount requested.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromListPartial(n, list, hasStrings) {
+ var ret;
+ if (n < list.head.data.length) {
+ // slice is the same for buffers and strings
+ ret = list.head.data.slice(0, n);
+ list.head.data = list.head.data.slice(n);
+ } else if (n === list.head.data.length) {
+ // first chunk is a perfect match
+ ret = list.shift();
+ } else {
+ // result spans more than one buffer
+ ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
+ }
+ return ret;
+}
+
+// Copies a specified amount of characters from the list of buffered data
+// chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBufferString(n, list) {
+ var p = list.head;
+ var c = 1;
+ var ret = p.data;
+ n -= ret.length;
+ while (p = p.next) {
+ var str = p.data;
+ var nb = n > str.length ? str.length : n;
+ if (nb === str.length) ret += str;else ret += str.slice(0, n);
+ n -= nb;
+ if (n === 0) {
+ if (nb === str.length) {
+ ++c;
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
+ } else {
+ list.head = p;
+ p.data = str.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ list.length -= c;
+ return ret;
+}
+
+// Copies a specified amount of bytes from the list of buffered data chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBuffer(n, list) {
+ var ret = Buffer.allocUnsafe(n);
+ var p = list.head;
+ var c = 1;
+ p.data.copy(ret);
+ n -= p.data.length;
+ while (p = p.next) {
+ var buf = p.data;
+ var nb = n > buf.length ? buf.length : n;
+ buf.copy(ret, ret.length - n, 0, nb);
+ n -= nb;
+ if (n === 0) {
+ if (nb === buf.length) {
+ ++c;
+ if (p.next) list.head = p.next;else list.head = list.tail = null;
+ } else {
+ list.head = p;
+ p.data = buf.slice(nb);
+ }
+ break;
+ }
+ ++c;
+ }
+ list.length -= c;
+ return ret;
+}
+
+function endReadable(stream) {
+ var state = stream._readableState;
+
+ // If we get here before consuming all the bytes, then that is a
+ // bug in node. Should never happen.
+ if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
+
+ if (!state.endEmitted) {
+ state.ended = true;
+ pna.nextTick(endReadableNT, state, stream);
+ }
+}
+
+function endReadableNT(state, stream) {
+ // Check that we didn't get one last unshift.
+ if (!state.endEmitted && state.length === 0) {
+ state.endEmitted = true;
+ stream.readable = false;
+ stream.emit('end');
+ }
+}
+
+function indexOf(xs, x) {
+ for (var i = 0, l = xs.length; i < l; i++) {
+ if (xs[i] === x) return i;
+ }
+ return -1;
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000..fcfc105
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,214 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a transform stream is a readable/writable stream where you do
+// something with the data. Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored. (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation. For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes. When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up. When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer. When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks. If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk. However,
+// a pathological inflate type of transform can cause excessive buffering
+// here. For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output. In this case, you could write a very small
+// amount of input, and end up with a very large amount of output. In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform. A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+util.inherits(Transform, Duplex);
+
+function afterTransform(er, data) {
+ var ts = this._transformState;
+ ts.transforming = false;
+
+ var cb = ts.writecb;
+
+ if (!cb) {
+ return this.emit('error', new Error('write callback called multiple times'));
+ }
+
+ ts.writechunk = null;
+ ts.writecb = null;
+
+ if (data != null) // single equals check for both `null` and `undefined`
+ this.push(data);
+
+ cb(er);
+
+ var rs = this._readableState;
+ rs.reading = false;
+ if (rs.needReadable || rs.length < rs.highWaterMark) {
+ this._read(rs.highWaterMark);
+ }
+}
+
+function Transform(options) {
+ if (!(this instanceof Transform)) return new Transform(options);
+
+ Duplex.call(this, options);
+
+ this._transformState = {
+ afterTransform: afterTransform.bind(this),
+ needTransform: false,
+ transforming: false,
+ writecb: null,
+ writechunk: null,
+ writeencoding: null
+ };
+
+ // start out asking for a readable event once data is transformed.
+ this._readableState.needReadable = true;
+
+ // we have implemented the _read method, and done the other things
+ // that Readable wants before the first _read call, so unset the
+ // sync guard flag.
+ this._readableState.sync = false;
+
+ if (options) {
+ if (typeof options.transform === 'function') this._transform = options.transform;
+
+ if (typeof options.flush === 'function') this._flush = options.flush;
+ }
+
+ // When the writable side finishes, then flush out anything remaining.
+ this.on('prefinish', prefinish);
+}
+
+function prefinish() {
+ var _this = this;
+
+ if (typeof this._flush === 'function') {
+ this._flush(function (er, data) {
+ done(_this, er, data);
+ });
+ } else {
+ done(this, null, null);
+ }
+}
+
+Transform.prototype.push = function (chunk, encoding) {
+ this._transformState.needTransform = false;
+ return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side. You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk. If you pass
+// an error, then that'll put the hurt on the whole operation. If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function (chunk, encoding, cb) {
+ throw new Error('_transform() is not implemented');
+};
+
+Transform.prototype._write = function (chunk, encoding, cb) {
+ var ts = this._transformState;
+ ts.writecb = cb;
+ ts.writechunk = chunk;
+ ts.writeencoding = encoding;
+ if (!ts.transforming) {
+ var rs = this._readableState;
+ if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+ }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function (n) {
+ var ts = this._transformState;
+
+ if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+ ts.transforming = true;
+ this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+ } else {
+ // mark that we need a transform, so that any data that comes in
+ // will get processed, now that we've asked for it.
+ ts.needTransform = true;
+ }
+};
+
+Transform.prototype._destroy = function (err, cb) {
+ var _this2 = this;
+
+ Duplex.prototype._destroy.call(this, err, function (err2) {
+ cb(err2);
+ _this2.emit('close');
+ });
+};
+
+function done(stream, er, data) {
+ if (er) return stream.emit('error', er);
+
+ if (data != null) // single equals check for both `null` and `undefined`
+ stream.push(data);
+
+ // if there's nothing in the write buffer, then that means
+ // that nothing more will ever be provided
+ if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
+
+ if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
+
+ return stream.push(null);
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000..b0b0220
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,687 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+module.exports = Writable;
+
+/* */
+function WriteReq(chunk, encoding, cb) {
+ this.chunk = chunk;
+ this.encoding = encoding;
+ this.callback = cb;
+ this.next = null;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+ var _this = this;
+
+ this.next = null;
+ this.entry = null;
+ this.finish = function () {
+ onCorkedFinish(_this, state);
+ };
+}
+/* */
+
+/**/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
+/* */
+
+/**/
+var Duplex;
+/* */
+
+Writable.WritableState = WritableState;
+
+/**/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/* */
+
+/**/
+var internalUtil = {
+ deprecate: require('util-deprecate')
+};
+/* */
+
+/**/
+var Stream = require('./internal/streams/stream');
+/* */
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+ return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+ return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/* */
+
+var destroyImpl = require('./internal/streams/destroy');
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WritableState(options, stream) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ options = options || {};
+
+ // Duplex streams are both readable and writable, but share
+ // the same options object.
+ // However, some cases require setting options to different
+ // values for the readable and the writable sides of the duplex stream.
+ // These options can be provided separately as readableXXX and writableXXX.
+ var isDuplex = stream instanceof Duplex;
+
+ // object stream flag to indicate whether or not this stream
+ // contains buffers or objects.
+ this.objectMode = !!options.objectMode;
+
+ if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+ // the point at which write() starts returning false
+ // Note: 0 is a valid value, means that we always return false if
+ // the entire buffer is not flushed immediately on write()
+ var hwm = options.highWaterMark;
+ var writableHwm = options.writableHighWaterMark;
+ var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+ if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
+
+ // cast to ints.
+ this.highWaterMark = Math.floor(this.highWaterMark);
+
+ // if _final has been called
+ this.finalCalled = false;
+
+ // drain event flag.
+ this.needDrain = false;
+ // at the start of calling end()
+ this.ending = false;
+ // when end() has been called, and returned
+ this.ended = false;
+ // when 'finish' is emitted
+ this.finished = false;
+
+ // has it been destroyed
+ this.destroyed = false;
+
+ // should we decode strings into buffers before passing to _write?
+ // this is here so that some node-core streams can optimize string
+ // handling at a lower level.
+ var noDecode = options.decodeStrings === false;
+ this.decodeStrings = !noDecode;
+
+ // Crypto is kind of old and crusty. Historically, its default string
+ // encoding is 'binary' so we have to make this configurable.
+ // Everything else in the universe uses 'utf8', though.
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+ // not an actual buffer we keep track of, but a measurement
+ // of how much we're waiting to get pushed to some underlying
+ // socket or file.
+ this.length = 0;
+
+ // a flag to see when we're in the middle of a write.
+ this.writing = false;
+
+ // when true all writes will be buffered until .uncork() call
+ this.corked = 0;
+
+ // a flag to be able to tell if the onwrite cb is called immediately,
+ // or on a later tick. We set this to true at first, because any
+ // actions that shouldn't happen until "later" should generally also
+ // not happen before the first write call.
+ this.sync = true;
+
+ // a flag to know if we're processing previously buffered items, which
+ // may call the _write() callback in the same tick, so that we don't
+ // end up in an overlapped onwrite situation.
+ this.bufferProcessing = false;
+
+ // the callback that's passed to _write(chunk,cb)
+ this.onwrite = function (er) {
+ onwrite(stream, er);
+ };
+
+ // the callback that the user supplies to write(chunk,encoding,cb)
+ this.writecb = null;
+
+ // the amount that is being written when _write is called.
+ this.writelen = 0;
+
+ this.bufferedRequest = null;
+ this.lastBufferedRequest = null;
+
+ // number of pending user-supplied write callbacks
+ // this must be 0 before 'finish' can be emitted
+ this.pendingcb = 0;
+
+ // emit prefinish if the only thing we're waiting for is _write cbs
+ // This is relevant for synchronous Transform streams
+ this.prefinished = false;
+
+ // True if the error was already emitted and should not be thrown again
+ this.errorEmitted = false;
+
+ // count buffered requests
+ this.bufferedRequestCount = 0;
+
+ // allocate the first CorkedRequest, there is always
+ // one allocated and free to use, and we maintain at most two
+ this.corkedRequestsFree = new CorkedRequest(this);
+}
+
+WritableState.prototype.getBuffer = function getBuffer() {
+ var current = this.bufferedRequest;
+ var out = [];
+ while (current) {
+ out.push(current);
+ current = current.next;
+ }
+ return out;
+};
+
+(function () {
+ try {
+ Object.defineProperty(WritableState.prototype, 'buffer', {
+ get: internalUtil.deprecate(function () {
+ return this.getBuffer();
+ }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
+ });
+ } catch (_) {}
+})();
+
+// Test _writableState for inheritance to account for Duplex streams,
+// whose prototype chain only points to Readable.
+var realHasInstance;
+if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
+ realHasInstance = Function.prototype[Symbol.hasInstance];
+ Object.defineProperty(Writable, Symbol.hasInstance, {
+ value: function (object) {
+ if (realHasInstance.call(this, object)) return true;
+ if (this !== Writable) return false;
+
+ return object && object._writableState instanceof WritableState;
+ }
+ });
+} else {
+ realHasInstance = function (object) {
+ return object instanceof this;
+ };
+}
+
+function Writable(options) {
+ Duplex = Duplex || require('./_stream_duplex');
+
+ // Writable ctor is applied to Duplexes, too.
+ // `realHasInstance` is necessary because using plain `instanceof`
+ // would return false, as no `_writableState` property is attached.
+
+ // Trying to use the custom `instanceof` for Writable here will also break the
+ // Node.js LazyTransform implementation, which has a non-trivial getter for
+ // `_writableState` that would lead to infinite recursion.
+ if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
+ return new Writable(options);
+ }
+
+ this._writableState = new WritableState(options, this);
+
+ // legacy.
+ this.writable = true;
+
+ if (options) {
+ if (typeof options.write === 'function') this._write = options.write;
+
+ if (typeof options.writev === 'function') this._writev = options.writev;
+
+ if (typeof options.destroy === 'function') this._destroy = options.destroy;
+
+ if (typeof options.final === 'function') this._final = options.final;
+ }
+
+ Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+ this.emit('error', new Error('Cannot pipe, not readable'));
+};
+
+function writeAfterEnd(stream, cb) {
+ var er = new Error('write after end');
+ // TODO: defer error events consistently everywhere, not just the cb
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+}
+
+// Checks that a user-supplied chunk is valid, especially for the particular
+// mode the stream is in. Currently this means that `null` is never accepted
+// and undefined/non-string values are only allowed in object mode.
+function validChunk(stream, state, chunk, cb) {
+ var valid = true;
+ var er = false;
+
+ if (chunk === null) {
+ er = new TypeError('May not write null values to stream');
+ } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+ er = new TypeError('Invalid non-string/buffer chunk');
+ }
+ if (er) {
+ stream.emit('error', er);
+ pna.nextTick(cb, er);
+ valid = false;
+ }
+ return valid;
+}
+
+Writable.prototype.write = function (chunk, encoding, cb) {
+ var state = this._writableState;
+ var ret = false;
+ var isBuf = !state.objectMode && _isUint8Array(chunk);
+
+ if (isBuf && !Buffer.isBuffer(chunk)) {
+ chunk = _uint8ArrayToBuffer(chunk);
+ }
+
+ if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+
+ if (typeof cb !== 'function') cb = nop;
+
+ if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+ state.pendingcb++;
+ ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+ }
+
+ return ret;
+};
+
+Writable.prototype.cork = function () {
+ var state = this._writableState;
+
+ state.corked++;
+};
+
+Writable.prototype.uncork = function () {
+ var state = this._writableState;
+
+ if (state.corked) {
+ state.corked--;
+
+ if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+ }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+ // node::ParseEncoding() requires lower case.
+ if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+ if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
+ this._writableState.defaultEncoding = encoding;
+ return this;
+};
+
+function decodeChunk(state, chunk, encoding) {
+ if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+ chunk = Buffer.from(chunk, encoding);
+ }
+ return chunk;
+}
+
+Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
+ // making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get: function () {
+ return this._writableState.highWaterMark;
+ }
+});
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn. Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
+ if (!isBuf) {
+ var newChunk = decodeChunk(state, chunk, encoding);
+ if (chunk !== newChunk) {
+ isBuf = true;
+ encoding = 'buffer';
+ chunk = newChunk;
+ }
+ }
+ var len = state.objectMode ? 1 : chunk.length;
+
+ state.length += len;
+
+ var ret = state.length < state.highWaterMark;
+ // we must ensure that previous needDrain will not be reset to false.
+ if (!ret) state.needDrain = true;
+
+ if (state.writing || state.corked) {
+ var last = state.lastBufferedRequest;
+ state.lastBufferedRequest = {
+ chunk: chunk,
+ encoding: encoding,
+ isBuf: isBuf,
+ callback: cb,
+ next: null
+ };
+ if (last) {
+ last.next = state.lastBufferedRequest;
+ } else {
+ state.bufferedRequest = state.lastBufferedRequest;
+ }
+ state.bufferedRequestCount += 1;
+ } else {
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ }
+
+ return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+ state.writelen = len;
+ state.writecb = cb;
+ state.writing = true;
+ state.sync = true;
+ if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+ state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+ --state.pendingcb;
+
+ if (sync) {
+ // defer the callback if we are being called synchronously
+ // to avoid piling up things on the stack
+ pna.nextTick(cb, er);
+ // this can emit finish, and it will always happen
+ // after error
+ pna.nextTick(finishMaybe, stream, state);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ } else {
+ // the caller expect this to happen before if
+ // it is async
+ cb(er);
+ stream._writableState.errorEmitted = true;
+ stream.emit('error', er);
+ // this can emit finish, but finish must
+ // always follow error
+ finishMaybe(stream, state);
+ }
+}
+
+function onwriteStateUpdate(state) {
+ state.writing = false;
+ state.writecb = null;
+ state.length -= state.writelen;
+ state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+ var state = stream._writableState;
+ var sync = state.sync;
+ var cb = state.writecb;
+
+ onwriteStateUpdate(state);
+
+ if (er) onwriteError(stream, state, sync, er, cb);else {
+ // Check if we're actually ready to finish, but don't emit yet
+ var finished = needFinish(state);
+
+ if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+ clearBuffer(stream, state);
+ }
+
+ if (sync) {
+ /**/
+ asyncWrite(afterWrite, stream, state, finished, cb);
+ /* */
+ } else {
+ afterWrite(stream, state, finished, cb);
+ }
+ }
+}
+
+function afterWrite(stream, state, finished, cb) {
+ if (!finished) onwriteDrain(stream, state);
+ state.pendingcb--;
+ cb();
+ finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+ if (state.length === 0 && state.needDrain) {
+ state.needDrain = false;
+ stream.emit('drain');
+ }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+ state.bufferProcessing = true;
+ var entry = state.bufferedRequest;
+
+ if (stream._writev && entry && entry.next) {
+ // Fast case, write everything using _writev()
+ var l = state.bufferedRequestCount;
+ var buffer = new Array(l);
+ var holder = state.corkedRequestsFree;
+ holder.entry = entry;
+
+ var count = 0;
+ var allBuffers = true;
+ while (entry) {
+ buffer[count] = entry;
+ if (!entry.isBuf) allBuffers = false;
+ entry = entry.next;
+ count += 1;
+ }
+ buffer.allBuffers = allBuffers;
+
+ doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+ // doWrite is almost always async, defer these to save a bit of time
+ // as the hot path ends with doWrite
+ state.pendingcb++;
+ state.lastBufferedRequest = null;
+ if (holder.next) {
+ state.corkedRequestsFree = holder.next;
+ holder.next = null;
+ } else {
+ state.corkedRequestsFree = new CorkedRequest(state);
+ }
+ state.bufferedRequestCount = 0;
+ } else {
+ // Slow case, write chunks one-by-one
+ while (entry) {
+ var chunk = entry.chunk;
+ var encoding = entry.encoding;
+ var cb = entry.callback;
+ var len = state.objectMode ? 1 : chunk.length;
+
+ doWrite(stream, state, false, len, chunk, encoding, cb);
+ entry = entry.next;
+ state.bufferedRequestCount--;
+ // if we didn't call the onwrite immediately, then
+ // it means that we need to wait until it does.
+ // also, that means that the chunk and cb are currently
+ // being processed, so move the buffer counter past them.
+ if (state.writing) {
+ break;
+ }
+ }
+
+ if (entry === null) state.lastBufferedRequest = null;
+ }
+
+ state.bufferedRequest = entry;
+ state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function (chunk, encoding, cb) {
+ cb(new Error('_write() is not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function (chunk, encoding, cb) {
+ var state = this._writableState;
+
+ if (typeof chunk === 'function') {
+ cb = chunk;
+ chunk = null;
+ encoding = null;
+ } else if (typeof encoding === 'function') {
+ cb = encoding;
+ encoding = null;
+ }
+
+ if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+ // .end() fully uncorks
+ if (state.corked) {
+ state.corked = 1;
+ this.uncork();
+ }
+
+ // ignore unnecessary end() calls.
+ if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+
+function needFinish(state) {
+ return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+function callFinal(stream, state) {
+ stream._final(function (err) {
+ state.pendingcb--;
+ if (err) {
+ stream.emit('error', err);
+ }
+ state.prefinished = true;
+ stream.emit('prefinish');
+ finishMaybe(stream, state);
+ });
+}
+function prefinish(stream, state) {
+ if (!state.prefinished && !state.finalCalled) {
+ if (typeof stream._final === 'function') {
+ state.pendingcb++;
+ state.finalCalled = true;
+ pna.nextTick(callFinal, stream, state);
+ } else {
+ state.prefinished = true;
+ stream.emit('prefinish');
+ }
+ }
+}
+
+function finishMaybe(stream, state) {
+ var need = needFinish(state);
+ if (need) {
+ prefinish(stream, state);
+ if (state.pendingcb === 0) {
+ state.finished = true;
+ stream.emit('finish');
+ }
+ }
+ return need;
+}
+
+function endWritable(stream, state, cb) {
+ state.ending = true;
+ finishMaybe(stream, state);
+ if (cb) {
+ if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
+ }
+ state.ended = true;
+ stream.writable = false;
+}
+
+function onCorkedFinish(corkReq, state, err) {
+ var entry = corkReq.entry;
+ corkReq.entry = null;
+ while (entry) {
+ var cb = entry.callback;
+ state.pendingcb--;
+ cb(err);
+ entry = entry.next;
+ }
+ if (state.corkedRequestsFree) {
+ state.corkedRequestsFree.next = corkReq;
+ } else {
+ state.corkedRequestsFree = corkReq;
+ }
+}
+
+Object.defineProperty(Writable.prototype, 'destroyed', {
+ get: function () {
+ if (this._writableState === undefined) {
+ return false;
+ }
+ return this._writableState.destroyed;
+ },
+ set: function (value) {
+ // we ignore the value if the stream
+ // has not been initialized yet
+ if (!this._writableState) {
+ return;
+ }
+
+ // backward compatibility, the user is explicitly
+ // managing destroyed
+ this._writableState.destroyed = value;
+ }
+});
+
+Writable.prototype.destroy = destroyImpl.destroy;
+Writable.prototype._undestroy = destroyImpl.undestroy;
+Writable.prototype._destroy = function (err, cb) {
+ this.end();
+ cb(err);
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js
new file mode 100644
index 0000000..aefc68b
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/BufferList.js
@@ -0,0 +1,79 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Buffer = require('safe-buffer').Buffer;
+var util = require('util');
+
+function copyBuffer(src, target, offset) {
+ src.copy(target, offset);
+}
+
+module.exports = function () {
+ function BufferList() {
+ _classCallCheck(this, BufferList);
+
+ this.head = null;
+ this.tail = null;
+ this.length = 0;
+ }
+
+ BufferList.prototype.push = function push(v) {
+ var entry = { data: v, next: null };
+ if (this.length > 0) this.tail.next = entry;else this.head = entry;
+ this.tail = entry;
+ ++this.length;
+ };
+
+ BufferList.prototype.unshift = function unshift(v) {
+ var entry = { data: v, next: this.head };
+ if (this.length === 0) this.tail = entry;
+ this.head = entry;
+ ++this.length;
+ };
+
+ BufferList.prototype.shift = function shift() {
+ if (this.length === 0) return;
+ var ret = this.head.data;
+ if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
+ --this.length;
+ return ret;
+ };
+
+ BufferList.prototype.clear = function clear() {
+ this.head = this.tail = null;
+ this.length = 0;
+ };
+
+ BufferList.prototype.join = function join(s) {
+ if (this.length === 0) return '';
+ var p = this.head;
+ var ret = '' + p.data;
+ while (p = p.next) {
+ ret += s + p.data;
+ }return ret;
+ };
+
+ BufferList.prototype.concat = function concat(n) {
+ if (this.length === 0) return Buffer.alloc(0);
+ if (this.length === 1) return this.head.data;
+ var ret = Buffer.allocUnsafe(n >>> 0);
+ var p = this.head;
+ var i = 0;
+ while (p) {
+ copyBuffer(p.data, ret, i);
+ i += p.data.length;
+ p = p.next;
+ }
+ return ret;
+ };
+
+ return BufferList;
+}();
+
+if (util && util.inspect && util.inspect.custom) {
+ module.exports.prototype[util.inspect.custom] = function () {
+ var obj = util.inspect({ length: this.length });
+ return this.constructor.name + ' ' + obj;
+ };
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js
new file mode 100644
index 0000000..5a0a0d8
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/destroy.js
@@ -0,0 +1,74 @@
+'use strict';
+
+/**/
+
+var pna = require('process-nextick-args');
+/* */
+
+// undocumented cb() API, needed for core, not for public API
+function destroy(err, cb) {
+ var _this = this;
+
+ var readableDestroyed = this._readableState && this._readableState.destroyed;
+ var writableDestroyed = this._writableState && this._writableState.destroyed;
+
+ if (readableDestroyed || writableDestroyed) {
+ if (cb) {
+ cb(err);
+ } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
+ pna.nextTick(emitErrorNT, this, err);
+ }
+ return this;
+ }
+
+ // we set destroyed to true before firing error callbacks in order
+ // to make it re-entrance safe in case destroy() is called within callbacks
+
+ if (this._readableState) {
+ this._readableState.destroyed = true;
+ }
+
+ // if this is a duplex stream mark the writable part as destroyed as well
+ if (this._writableState) {
+ this._writableState.destroyed = true;
+ }
+
+ this._destroy(err || null, function (err) {
+ if (!cb && err) {
+ pna.nextTick(emitErrorNT, _this, err);
+ if (_this._writableState) {
+ _this._writableState.errorEmitted = true;
+ }
+ } else if (cb) {
+ cb(err);
+ }
+ });
+
+ return this;
+}
+
+function undestroy() {
+ if (this._readableState) {
+ this._readableState.destroyed = false;
+ this._readableState.reading = false;
+ this._readableState.ended = false;
+ this._readableState.endEmitted = false;
+ }
+
+ if (this._writableState) {
+ this._writableState.destroyed = false;
+ this._writableState.ended = false;
+ this._writableState.ending = false;
+ this._writableState.finished = false;
+ this._writableState.errorEmitted = false;
+ }
+}
+
+function emitErrorNT(self, err) {
+ self.emit('error', err);
+}
+
+module.exports = {
+ destroy: destroy,
+ undestroy: undestroy
+};
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js
new file mode 100644
index 0000000..9332a3f
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream-browser.js
@@ -0,0 +1 @@
+module.exports = require('events').EventEmitter;
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js
new file mode 100644
index 0000000..ce2ad5b
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/lib/internal/streams/stream.js
@@ -0,0 +1 @@
+module.exports = require('stream');
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/package.json b/Nodejs/node_modules/duplexify/node_modules/readable-stream/package.json
new file mode 100644
index 0000000..3d01661
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/package.json
@@ -0,0 +1,81 @@
+{
+ "_from": "readable-stream@^2.0.0",
+ "_id": "readable-stream@2.3.7",
+ "_inBundle": false,
+ "_integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "_location": "/duplexify/readable-stream",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "readable-stream@^2.0.0",
+ "name": "readable-stream",
+ "escapedName": "readable-stream",
+ "rawSpec": "^2.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.0.0"
+ },
+ "_requiredBy": [
+ "/duplexify"
+ ],
+ "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "_shasum": "1eca1cf711aef814c04f62252a36a62f6cb23b57",
+ "_spec": "readable-stream@^2.0.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/duplexify",
+ "browser": {
+ "util": false,
+ "./readable.js": "./readable-browser.js",
+ "./writable.js": "./writable-browser.js",
+ "./duplex.js": "./duplex-browser.js",
+ "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
+ },
+ "bugs": {
+ "url": "https://github.com/nodejs/readable-stream/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ },
+ "deprecated": false,
+ "description": "Streams3, a user-land copy of the stream library from Node.js",
+ "devDependencies": {
+ "assert": "^1.4.0",
+ "babel-polyfill": "^6.9.1",
+ "buffer": "^4.9.0",
+ "lolex": "^2.3.2",
+ "nyc": "^6.4.0",
+ "tap": "^0.7.0",
+ "tape": "^4.8.0"
+ },
+ "homepage": "https://github.com/nodejs/readable-stream#readme",
+ "keywords": [
+ "readable",
+ "stream",
+ "pipe"
+ ],
+ "license": "MIT",
+ "main": "readable.js",
+ "name": "readable-stream",
+ "nyc": {
+ "include": [
+ "lib/**.js"
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/readable-stream.git"
+ },
+ "scripts": {
+ "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+ "cover": "nyc npm test",
+ "report": "nyc report --reporter=lcov",
+ "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js"
+ },
+ "version": "2.3.7"
+}
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/passthrough.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/passthrough.js
new file mode 100644
index 0000000..ffd791d
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/passthrough.js
@@ -0,0 +1 @@
+module.exports = require('./readable').PassThrough
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/readable-browser.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/readable-browser.js
new file mode 100644
index 0000000..e503725
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/readable-browser.js
@@ -0,0 +1,7 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/readable.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/readable.js
new file mode 100644
index 0000000..ec89ec5
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/readable.js
@@ -0,0 +1,19 @@
+var Stream = require('stream');
+if (process.env.READABLE_STREAM === 'disable' && Stream) {
+ module.exports = Stream;
+ exports = module.exports = Stream.Readable;
+ exports.Readable = Stream.Readable;
+ exports.Writable = Stream.Writable;
+ exports.Duplex = Stream.Duplex;
+ exports.Transform = Stream.Transform;
+ exports.PassThrough = Stream.PassThrough;
+ exports.Stream = Stream;
+} else {
+ exports = module.exports = require('./lib/_stream_readable.js');
+ exports.Stream = Stream || exports;
+ exports.Readable = exports;
+ exports.Writable = require('./lib/_stream_writable.js');
+ exports.Duplex = require('./lib/_stream_duplex.js');
+ exports.Transform = require('./lib/_stream_transform.js');
+ exports.PassThrough = require('./lib/_stream_passthrough.js');
+}
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/transform.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/transform.js
new file mode 100644
index 0000000..b1baba2
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/transform.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Transform
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/writable-browser.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/writable-browser.js
new file mode 100644
index 0000000..ebdde6a
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/writable-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_writable.js');
diff --git a/Nodejs/node_modules/duplexify/node_modules/readable-stream/writable.js b/Nodejs/node_modules/duplexify/node_modules/readable-stream/writable.js
new file mode 100644
index 0000000..3211a6f
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/readable-stream/writable.js
@@ -0,0 +1,8 @@
+var Stream = require("stream")
+var Writable = require("./lib/_stream_writable.js")
+
+if (process.env.READABLE_STREAM === 'disable') {
+ module.exports = Stream && Stream.Writable || Writable
+} else {
+ module.exports = Writable
+}
diff --git a/Nodejs/node_modules/duplexify/node_modules/safe-buffer/LICENSE b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/LICENSE
new file mode 100644
index 0000000..0c068ce
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/duplexify/node_modules/safe-buffer/README.md b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/README.md
new file mode 100644
index 0000000..e9a81af
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/README.md
@@ -0,0 +1,584 @@
+# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/safe-buffer
+[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
+[npm-url]: https://npmjs.org/package/safe-buffer
+[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
+[downloads-url]: https://npmjs.org/package/safe-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### Safer Node.js Buffer API
+
+**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
+`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
+
+**Uses the built-in implementation when available.**
+
+## install
+
+```
+npm install safe-buffer
+```
+
+## usage
+
+The goal of this package is to provide a safe replacement for the node.js `Buffer`.
+
+It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
+the top of your node.js modules:
+
+```js
+var Buffer = require('safe-buffer').Buffer
+
+// Existing buffer code will continue to work without issues:
+
+new Buffer('hey', 'utf8')
+new Buffer([1, 2, 3], 'utf8')
+new Buffer(obj)
+new Buffer(16) // create an uninitialized buffer (potentially unsafe)
+
+// But you can use these new explicit APIs to make clear what you want:
+
+Buffer.from('hey', 'utf8') // convert from many types to a Buffer
+Buffer.alloc(16) // create a zero-filled buffer (safe)
+Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
+```
+
+## api
+
+### Class Method: Buffer.from(array)
+
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+ // creates a new Buffer containing ASCII bytes
+ // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+ a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+ // Prints:
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+ // Prints:
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+ // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+ // 'auffer'
+console.log(buf2.toString());
+ // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+ // prints: this is a tést
+console.log(buf1.toString('ascii'));
+ // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+ // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+ //
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+ //
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+ //
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes. The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+ //
+ // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+ //
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes. The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+ const data = socket.read();
+ // allocate for retained data
+ const sb = Buffer.allocUnsafeSlow(10);
+ // copy the data into the new allocation
+ data.copy(sb, 0, 0, 10);
+ store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+ return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+ var data = ''
+ req.setEncoding('utf8')
+ req.on('data', function (chunk) {
+ data += chunk
+ })
+ req.on('end', function () {
+ var body = JSON.parse(data)
+ res.end(new Buffer(body.str).toString('hex'))
+ })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+ "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+ socket.on('message', function (message) {
+ message = JSON.parse(message)
+ if (message.type === 'echo') {
+ socket.send(message.data) // send back the user's message
+ }
+ })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+ buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/Nodejs/node_modules/duplexify/node_modules/safe-buffer/index.d.ts b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/index.d.ts
new file mode 100644
index 0000000..e9fed80
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/index.d.ts
@@ -0,0 +1,187 @@
+declare module "safe-buffer" {
+ export class Buffer {
+ length: number
+ write(string: string, offset?: number, length?: number, encoding?: string): number;
+ toString(encoding?: string, start?: number, end?: number): string;
+ toJSON(): { type: 'Buffer', data: any[] };
+ equals(otherBuffer: Buffer): boolean;
+ compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+ copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+ slice(start?: number, end?: number): Buffer;
+ writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+ readUInt8(offset: number, noAssert?: boolean): number;
+ readUInt16LE(offset: number, noAssert?: boolean): number;
+ readUInt16BE(offset: number, noAssert?: boolean): number;
+ readUInt32LE(offset: number, noAssert?: boolean): number;
+ readUInt32BE(offset: number, noAssert?: boolean): number;
+ readInt8(offset: number, noAssert?: boolean): number;
+ readInt16LE(offset: number, noAssert?: boolean): number;
+ readInt16BE(offset: number, noAssert?: boolean): number;
+ readInt32LE(offset: number, noAssert?: boolean): number;
+ readInt32BE(offset: number, noAssert?: boolean): number;
+ readFloatLE(offset: number, noAssert?: boolean): number;
+ readFloatBE(offset: number, noAssert?: boolean): number;
+ readDoubleLE(offset: number, noAssert?: boolean): number;
+ readDoubleBE(offset: number, noAssert?: boolean): number;
+ swap16(): Buffer;
+ swap32(): Buffer;
+ swap64(): Buffer;
+ writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt8(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+ writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+ writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+ writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+ fill(value: any, offset?: number, end?: number): this;
+ indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+ /**
+ * Allocates a new buffer containing the given {str}.
+ *
+ * @param str String to store in buffer.
+ * @param encoding encoding to use, optional. Default is 'utf8'
+ */
+ constructor (str: string, encoding?: string);
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ */
+ constructor (size: number);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: Uint8Array);
+ /**
+ * Produces a Buffer backed by the same allocated memory as
+ * the given {ArrayBuffer}.
+ *
+ *
+ * @param arrayBuffer The ArrayBuffer with which to share memory.
+ */
+ constructor (arrayBuffer: ArrayBuffer);
+ /**
+ * Allocates a new buffer containing the given {array} of octets.
+ *
+ * @param array The octets to store.
+ */
+ constructor (array: any[]);
+ /**
+ * Copies the passed {buffer} data onto a new {Buffer} instance.
+ *
+ * @param buffer The buffer to copy.
+ */
+ constructor (buffer: Buffer);
+ prototype: Buffer;
+ /**
+ * Allocates a new Buffer using an {array} of octets.
+ *
+ * @param array
+ */
+ static from(array: any[]): Buffer;
+ /**
+ * When passed a reference to the .buffer property of a TypedArray instance,
+ * the newly created Buffer will share the same allocated memory as the TypedArray.
+ * The optional {byteOffset} and {length} arguments specify a memory range
+ * within the {arrayBuffer} that will be shared by the Buffer.
+ *
+ * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+ * @param byteOffset
+ * @param length
+ */
+ static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+ /**
+ * Copies the passed {buffer} data onto a new Buffer instance.
+ *
+ * @param buffer
+ */
+ static from(buffer: Buffer): Buffer;
+ /**
+ * Creates a new Buffer containing the given JavaScript string {str}.
+ * If provided, the {encoding} parameter identifies the character encoding.
+ * If not provided, {encoding} defaults to 'utf8'.
+ *
+ * @param str
+ */
+ static from(str: string, encoding?: string): Buffer;
+ /**
+ * Returns true if {obj} is a Buffer
+ *
+ * @param obj object to test.
+ */
+ static isBuffer(obj: any): obj is Buffer;
+ /**
+ * Returns true if {encoding} is a valid encoding argument.
+ * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ *
+ * @param encoding string to test.
+ */
+ static isEncoding(encoding: string): boolean;
+ /**
+ * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+ * This is not the same as String.prototype.length since that returns the number of characters in a string.
+ *
+ * @param string string to test.
+ * @param encoding encoding used to evaluate (defaults to 'utf8')
+ */
+ static byteLength(string: string, encoding?: string): number;
+ /**
+ * Returns a buffer which is the result of concatenating all the buffers in the list together.
+ *
+ * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+ * If the list has exactly one item, then the first item of the list is returned.
+ * If the list has more than one item, then a new Buffer is created.
+ *
+ * @param list An array of Buffer objects to concatenate
+ * @param totalLength Total length of the buffers when concatenated.
+ * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+ */
+ static concat(list: Buffer[], totalLength?: number): Buffer;
+ /**
+ * The same as buf1.compare(buf2).
+ */
+ static compare(buf1: Buffer, buf2: Buffer): number;
+ /**
+ * Allocates a new buffer of {size} octets.
+ *
+ * @param size count of octets to allocate.
+ * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+ * If parameter is omitted, buffer will be filled with zeros.
+ * @param encoding encoding used for call to buf.fill while initalizing
+ */
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+ /**
+ * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafe(size: number): Buffer;
+ /**
+ * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+ * of the newly created Buffer are unknown and may contain sensitive data.
+ *
+ * @param size count of octets to allocate
+ */
+ static allocUnsafeSlow(size: number): Buffer;
+ }
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/safe-buffer/index.js b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/index.js
new file mode 100644
index 0000000..22438da
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/index.js
@@ -0,0 +1,62 @@
+/* eslint-disable node/no-deprecated-api */
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+// alternative to using Object.keys for old browsers
+function copyProps (src, dst) {
+ for (var key in src) {
+ dst[key] = src[key]
+ }
+}
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+ module.exports = buffer
+} else {
+ // Copy properties from require('buffer')
+ copyProps(buffer, exports)
+ exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+// Copy static methods from Buffer
+copyProps(Buffer, SafeBuffer)
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+ if (typeof arg === 'number') {
+ throw new TypeError('Argument must not be a number')
+ }
+ return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ var buf = Buffer(size)
+ if (fill !== undefined) {
+ if (typeof encoding === 'string') {
+ buf.fill(fill, encoding)
+ } else {
+ buf.fill(fill)
+ }
+ } else {
+ buf.fill(0)
+ }
+ return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+ if (typeof size !== 'number') {
+ throw new TypeError('Argument must be a number')
+ }
+ return buffer.SlowBuffer(size)
+}
diff --git a/Nodejs/node_modules/duplexify/node_modules/safe-buffer/package.json b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/package.json
new file mode 100644
index 0000000..1bb5c20
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/safe-buffer/package.json
@@ -0,0 +1,63 @@
+{
+ "_from": "safe-buffer@~5.1.1",
+ "_id": "safe-buffer@5.1.2",
+ "_inBundle": false,
+ "_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+ "_location": "/duplexify/safe-buffer",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "safe-buffer@~5.1.1",
+ "name": "safe-buffer",
+ "escapedName": "safe-buffer",
+ "rawSpec": "~5.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~5.1.1"
+ },
+ "_requiredBy": [
+ "/duplexify/readable-stream",
+ "/duplexify/string_decoder"
+ ],
+ "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+ "_shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d",
+ "_spec": "safe-buffer@~5.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/duplexify/node_modules/readable-stream",
+ "author": {
+ "name": "Feross Aboukhadijeh",
+ "email": "feross@feross.org",
+ "url": "http://feross.org"
+ },
+ "bugs": {
+ "url": "https://github.com/feross/safe-buffer/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Safer Node.js Buffer API",
+ "devDependencies": {
+ "standard": "*",
+ "tape": "^4.0.0"
+ },
+ "homepage": "https://github.com/feross/safe-buffer",
+ "keywords": [
+ "buffer",
+ "buffer allocate",
+ "node security",
+ "safe",
+ "safe-buffer",
+ "security",
+ "uninitialized"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "safe-buffer",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/feross/safe-buffer.git"
+ },
+ "scripts": {
+ "test": "standard && tape test/*.js"
+ },
+ "types": "index.d.ts",
+ "version": "5.1.2"
+}
diff --git a/Nodejs/node_modules/duplexify/node_modules/string_decoder/.travis.yml b/Nodejs/node_modules/duplexify/node_modules/string_decoder/.travis.yml
new file mode 100644
index 0000000..3347a72
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/string_decoder/.travis.yml
@@ -0,0 +1,50 @@
+sudo: false
+language: node_js
+before_install:
+ - npm install -g npm@2
+ - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
+notifications:
+ email: false
+matrix:
+ fast_finish: true
+ include:
+ - node_js: '0.8'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.10'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.11'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: '0.12'
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 1
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 2
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 3
+ env:
+ - TASK=test
+ - NPM_LEGACY=true
+ - node_js: 4
+ env: TASK=test
+ - node_js: 5
+ env: TASK=test
+ - node_js: 6
+ env: TASK=test
+ - node_js: 7
+ env: TASK=test
+ - node_js: 8
+ env: TASK=test
+ - node_js: 9
+ env: TASK=test
diff --git a/Nodejs/node_modules/duplexify/node_modules/string_decoder/LICENSE b/Nodejs/node_modules/duplexify/node_modules/string_decoder/LICENSE
new file mode 100644
index 0000000..778edb2
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/string_decoder/LICENSE
@@ -0,0 +1,48 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
diff --git a/Nodejs/node_modules/duplexify/node_modules/string_decoder/README.md b/Nodejs/node_modules/duplexify/node_modules/string_decoder/README.md
new file mode 100644
index 0000000..5fd5831
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/string_decoder/README.md
@@ -0,0 +1,47 @@
+# string_decoder
+
+***Node-core v8.9.4 string_decoder for userland***
+
+
+[](https://nodei.co/npm/string_decoder/)
+[](https://nodei.co/npm/string_decoder/)
+
+
+```bash
+npm install --save string_decoder
+```
+
+***Node-core string_decoder for userland***
+
+This package is a mirror of the string_decoder implementation in Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
+
+As of version 1.0.0 **string_decoder** uses semantic versioning.
+
+## Previous versions
+
+Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
+
+## Update
+
+The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
+
+## Streams Working Group
+
+`string_decoder` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+ project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+ notice of changes.
+
+See [readable-stream](https://github.com/nodejs/readable-stream) for
+more details.
diff --git a/Nodejs/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js b/Nodejs/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js
new file mode 100644
index 0000000..2e89e63
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/string_decoder/lib/string_decoder.js
@@ -0,0 +1,296 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/**/
+
+var Buffer = require('safe-buffer').Buffer;
+/* */
+
+var isEncoding = Buffer.isEncoding || function (encoding) {
+ encoding = '' + encoding;
+ switch (encoding && encoding.toLowerCase()) {
+ case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
+ return true;
+ default:
+ return false;
+ }
+};
+
+function _normalizeEncoding(enc) {
+ if (!enc) return 'utf8';
+ var retried;
+ while (true) {
+ switch (enc) {
+ case 'utf8':
+ case 'utf-8':
+ return 'utf8';
+ case 'ucs2':
+ case 'ucs-2':
+ case 'utf16le':
+ case 'utf-16le':
+ return 'utf16le';
+ case 'latin1':
+ case 'binary':
+ return 'latin1';
+ case 'base64':
+ case 'ascii':
+ case 'hex':
+ return enc;
+ default:
+ if (retried) return; // undefined
+ enc = ('' + enc).toLowerCase();
+ retried = true;
+ }
+ }
+};
+
+// Do not cache `Buffer.isEncoding` when checking encoding names as some
+// modules monkey-patch it to support additional encodings
+function normalizeEncoding(enc) {
+ var nenc = _normalizeEncoding(enc);
+ if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
+ return nenc || enc;
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters.
+exports.StringDecoder = StringDecoder;
+function StringDecoder(encoding) {
+ this.encoding = normalizeEncoding(encoding);
+ var nb;
+ switch (this.encoding) {
+ case 'utf16le':
+ this.text = utf16Text;
+ this.end = utf16End;
+ nb = 4;
+ break;
+ case 'utf8':
+ this.fillLast = utf8FillLast;
+ nb = 4;
+ break;
+ case 'base64':
+ this.text = base64Text;
+ this.end = base64End;
+ nb = 3;
+ break;
+ default:
+ this.write = simpleWrite;
+ this.end = simpleEnd;
+ return;
+ }
+ this.lastNeed = 0;
+ this.lastTotal = 0;
+ this.lastChar = Buffer.allocUnsafe(nb);
+}
+
+StringDecoder.prototype.write = function (buf) {
+ if (buf.length === 0) return '';
+ var r;
+ var i;
+ if (this.lastNeed) {
+ r = this.fillLast(buf);
+ if (r === undefined) return '';
+ i = this.lastNeed;
+ this.lastNeed = 0;
+ } else {
+ i = 0;
+ }
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
+ return r || '';
+};
+
+StringDecoder.prototype.end = utf8End;
+
+// Returns only complete characters in a Buffer
+StringDecoder.prototype.text = utf8Text;
+
+// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
+StringDecoder.prototype.fillLast = function (buf) {
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
+ this.lastNeed -= buf.length;
+};
+
+// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
+// continuation byte. If an invalid byte is detected, -2 is returned.
+function utf8CheckByte(byte) {
+ if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
+ return byte >> 6 === 0x02 ? -1 : -2;
+}
+
+// Checks at most 3 bytes at the end of a Buffer in order to detect an
+// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
+// needed to complete the UTF-8 character (if applicable) are returned.
+function utf8CheckIncomplete(self, buf, i) {
+ var j = buf.length - 1;
+ if (j < i) return 0;
+ var nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 1;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) self.lastNeed = nb - 2;
+ return nb;
+ }
+ if (--j < i || nb === -2) return 0;
+ nb = utf8CheckByte(buf[j]);
+ if (nb >= 0) {
+ if (nb > 0) {
+ if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
+ }
+ return nb;
+ }
+ return 0;
+}
+
+// Validates as many continuation bytes for a multi-byte UTF-8 character as
+// needed or are available. If we see a non-continuation byte where we expect
+// one, we "replace" the validated continuation bytes we've seen so far with
+// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
+// behavior. The continuation byte check is included three times in the case
+// where all of the continuation bytes for a character exist in the same buffer.
+// It is also done this way as a slight performance increase instead of using a
+// loop.
+function utf8CheckExtraBytes(self, buf, p) {
+ if ((buf[0] & 0xC0) !== 0x80) {
+ self.lastNeed = 0;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 1 && buf.length > 1) {
+ if ((buf[1] & 0xC0) !== 0x80) {
+ self.lastNeed = 1;
+ return '\ufffd';
+ }
+ if (self.lastNeed > 2 && buf.length > 2) {
+ if ((buf[2] & 0xC0) !== 0x80) {
+ self.lastNeed = 2;
+ return '\ufffd';
+ }
+ }
+ }
+}
+
+// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
+function utf8FillLast(buf) {
+ var p = this.lastTotal - this.lastNeed;
+ var r = utf8CheckExtraBytes(this, buf, p);
+ if (r !== undefined) return r;
+ if (this.lastNeed <= buf.length) {
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+ }
+ buf.copy(this.lastChar, p, 0, buf.length);
+ this.lastNeed -= buf.length;
+}
+
+// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
+// partial character, the character's bytes are buffered until the required
+// number of bytes are available.
+function utf8Text(buf, i) {
+ var total = utf8CheckIncomplete(this, buf, i);
+ if (!this.lastNeed) return buf.toString('utf8', i);
+ this.lastTotal = total;
+ var end = buf.length - (total - this.lastNeed);
+ buf.copy(this.lastChar, 0, end);
+ return buf.toString('utf8', i, end);
+}
+
+// For UTF-8, a replacement character is added when ending on a partial
+// character.
+function utf8End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + '\ufffd';
+ return r;
+}
+
+// UTF-16LE typically needs two bytes per character, but even if we have an even
+// number of bytes available, we need to check if we end on a leading/high
+// surrogate. In that case, we need to wait for the next two bytes in order to
+// decode the last character properly.
+function utf16Text(buf, i) {
+ if ((buf.length - i) % 2 === 0) {
+ var r = buf.toString('utf16le', i);
+ if (r) {
+ var c = r.charCodeAt(r.length - 1);
+ if (c >= 0xD800 && c <= 0xDBFF) {
+ this.lastNeed = 2;
+ this.lastTotal = 4;
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ return r.slice(0, -1);
+ }
+ }
+ return r;
+ }
+ this.lastNeed = 1;
+ this.lastTotal = 2;
+ this.lastChar[0] = buf[buf.length - 1];
+ return buf.toString('utf16le', i, buf.length - 1);
+}
+
+// For UTF-16LE we do not explicitly append special replacement characters if we
+// end on a partial character, we simply let v8 handle that.
+function utf16End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) {
+ var end = this.lastTotal - this.lastNeed;
+ return r + this.lastChar.toString('utf16le', 0, end);
+ }
+ return r;
+}
+
+function base64Text(buf, i) {
+ var n = (buf.length - i) % 3;
+ if (n === 0) return buf.toString('base64', i);
+ this.lastNeed = 3 - n;
+ this.lastTotal = 3;
+ if (n === 1) {
+ this.lastChar[0] = buf[buf.length - 1];
+ } else {
+ this.lastChar[0] = buf[buf.length - 2];
+ this.lastChar[1] = buf[buf.length - 1];
+ }
+ return buf.toString('base64', i, buf.length - n);
+}
+
+function base64End(buf) {
+ var r = buf && buf.length ? this.write(buf) : '';
+ if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
+ return r;
+}
+
+// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
+function simpleWrite(buf) {
+ return buf.toString(this.encoding);
+}
+
+function simpleEnd(buf) {
+ return buf && buf.length ? this.write(buf) : '';
+}
\ No newline at end of file
diff --git a/Nodejs/node_modules/duplexify/node_modules/string_decoder/package.json b/Nodejs/node_modules/duplexify/node_modules/string_decoder/package.json
new file mode 100644
index 0000000..697b4cf
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/node_modules/string_decoder/package.json
@@ -0,0 +1,59 @@
+{
+ "_from": "string_decoder@~1.1.1",
+ "_id": "string_decoder@1.1.1",
+ "_inBundle": false,
+ "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+ "_location": "/duplexify/string_decoder",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "string_decoder@~1.1.1",
+ "name": "string_decoder",
+ "escapedName": "string_decoder",
+ "rawSpec": "~1.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~1.1.1"
+ },
+ "_requiredBy": [
+ "/duplexify/readable-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+ "_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
+ "_spec": "string_decoder@~1.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/duplexify/node_modules/readable-stream",
+ "bugs": {
+ "url": "https://github.com/nodejs/string_decoder/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "safe-buffer": "~5.1.0"
+ },
+ "deprecated": false,
+ "description": "The string_decoder module from Node core",
+ "devDependencies": {
+ "babel-polyfill": "^6.23.0",
+ "core-util-is": "^1.0.2",
+ "inherits": "^2.0.3",
+ "tap": "~0.4.8"
+ },
+ "homepage": "https://github.com/nodejs/string_decoder",
+ "keywords": [
+ "string",
+ "decoder",
+ "browser",
+ "browserify"
+ ],
+ "license": "MIT",
+ "main": "lib/string_decoder.js",
+ "name": "string_decoder",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/nodejs/string_decoder.git"
+ },
+ "scripts": {
+ "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+ "test": "tap test/parallel/*.js && node test/verify-dependencies"
+ },
+ "version": "1.1.1"
+}
diff --git a/Nodejs/node_modules/duplexify/package.json b/Nodejs/node_modules/duplexify/package.json
new file mode 100644
index 0000000..2fb4f9f
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/package.json
@@ -0,0 +1,73 @@
+{
+ "_from": "duplexify@^3.6.0",
+ "_id": "duplexify@3.7.1",
+ "_inBundle": false,
+ "_integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==",
+ "_location": "/duplexify",
+ "_phantomChildren": {
+ "core-util-is": "1.0.2",
+ "inherits": "2.0.4",
+ "isarray": "1.0.0",
+ "process-nextick-args": "2.0.1",
+ "util-deprecate": "1.0.2"
+ },
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "duplexify@^3.6.0",
+ "name": "duplexify",
+ "escapedName": "duplexify",
+ "rawSpec": "^3.6.0",
+ "saveSpec": null,
+ "fetchSpec": "^3.6.0"
+ },
+ "_requiredBy": [
+ "/pumpify",
+ "/websocket-stream"
+ ],
+ "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",
+ "_shasum": "2a4df5317f6ccfd91f86d6fd25d8d8a103b88309",
+ "_spec": "duplexify@^3.6.0",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/pumpify",
+ "author": {
+ "name": "Mathias Buus"
+ },
+ "bugs": {
+ "url": "https://github.com/mafintosh/duplexify/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "end-of-stream": "^1.0.0",
+ "inherits": "^2.0.1",
+ "readable-stream": "^2.0.0",
+ "stream-shift": "^1.0.0"
+ },
+ "deprecated": false,
+ "description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input",
+ "devDependencies": {
+ "concat-stream": "^1.5.2",
+ "tape": "^4.0.0",
+ "through2": "^2.0.0"
+ },
+ "homepage": "https://github.com/mafintosh/duplexify",
+ "keywords": [
+ "duplex",
+ "streams2",
+ "streams",
+ "stream",
+ "writable",
+ "readable",
+ "async"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "duplexify",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mafintosh/duplexify.git"
+ },
+ "scripts": {
+ "test": "tape test.js"
+ },
+ "version": "3.7.1"
+}
diff --git a/Nodejs/node_modules/duplexify/test.js b/Nodejs/node_modules/duplexify/test.js
new file mode 100644
index 0000000..0074060
--- /dev/null
+++ b/Nodejs/node_modules/duplexify/test.js
@@ -0,0 +1,295 @@
+var tape = require('tape')
+var through = require('through2')
+var concat = require('concat-stream')
+var net = require('net')
+var duplexify = require('./')
+
+var HELLO_WORLD = (Buffer.from && Buffer.from !== Uint8Array.from)
+ ? Buffer.from('hello world')
+ : new Buffer('hello world')
+
+tape('passthrough', function(t) {
+ t.plan(2)
+
+ var pt = through()
+ var dup = duplexify(pt, pt)
+
+ dup.end('hello world')
+ dup.on('finish', function() {
+ t.ok(true, 'should finish')
+ })
+ dup.pipe(concat(function(data) {
+ t.same(data.toString(), 'hello world', 'same in as out')
+ }))
+})
+
+tape('passthrough + double end', function(t) {
+ t.plan(2)
+
+ var pt = through()
+ var dup = duplexify(pt, pt)
+
+ dup.end('hello world')
+ dup.end()
+
+ dup.on('finish', function() {
+ t.ok(true, 'should finish')
+ })
+ dup.pipe(concat(function(data) {
+ t.same(data.toString(), 'hello world', 'same in as out')
+ }))
+})
+
+tape('async passthrough + end', function(t) {
+ t.plan(2)
+
+ var pt = through.obj({highWaterMark:1}, function(data, enc, cb) {
+ setTimeout(function() {
+ cb(null, data)
+ }, 100)
+ })
+
+ var dup = duplexify(pt, pt)
+
+ dup.write('hello ')
+ dup.write('world')
+ dup.end()
+
+ dup.on('finish', function() {
+ t.ok(true, 'should finish')
+ })
+ dup.pipe(concat(function(data) {
+ t.same(data.toString(), 'hello world', 'same in as out')
+ }))
+})
+
+tape('duplex', function(t) {
+ var readExpected = ['read-a', 'read-b', 'read-c']
+ var writeExpected = ['write-a', 'write-b', 'write-c']
+
+ t.plan(readExpected.length+writeExpected.length+2)
+
+ var readable = through.obj()
+ var writable = through.obj(function(data, enc, cb) {
+ t.same(data, writeExpected.shift(), 'onwrite should match')
+ cb()
+ })
+
+ var dup = duplexify.obj(writable, readable)
+
+ readExpected.slice().forEach(function(data) {
+ readable.write(data)
+ })
+ readable.end()
+
+ writeExpected.slice().forEach(function(data) {
+ dup.write(data)
+ })
+ dup.end()
+
+ dup.on('data', function(data) {
+ t.same(data, readExpected.shift(), 'ondata should match')
+ })
+ dup.on('end', function() {
+ t.ok(true, 'should end')
+ })
+ dup.on('finish', function() {
+ t.ok(true, 'should finish')
+ })
+})
+
+tape('async', function(t) {
+ var dup = duplexify()
+ var pt = through()
+
+ dup.pipe(concat(function(data) {
+ t.same(data.toString(), 'i was async', 'same in as out')
+ t.end()
+ }))
+
+ dup.write('i')
+ dup.write(' was ')
+ dup.end('async')
+
+ setTimeout(function() {
+ dup.setWritable(pt)
+ setTimeout(function() {
+ dup.setReadable(pt)
+ }, 50)
+ }, 50)
+})
+
+tape('destroy', function(t) {
+ t.plan(2)
+
+ var write = through()
+ var read = through()
+ var dup = duplexify(write, read)
+
+ write.destroy = function() {
+ t.ok(true, 'write destroyed')
+ }
+
+ dup.on('close', function() {
+ t.ok(true, 'close emitted')
+ })
+
+ dup.destroy()
+ dup.destroy() // should only work once
+})
+
+tape('destroy both', function(t) {
+ t.plan(3)
+
+ var write = through()
+ var read = through()
+ var dup = duplexify(write, read)
+
+ write.destroy = function() {
+ t.ok(true, 'write destroyed')
+ }
+
+ read.destroy = function() {
+ t.ok(true, 'read destroyed')
+ }
+
+ dup.on('close', function() {
+ t.ok(true, 'close emitted')
+ })
+
+ dup.destroy()
+ dup.destroy() // should only work once
+})
+
+tape('bubble read errors', function(t) {
+ t.plan(2)
+
+ var write = through()
+ var read = through()
+ var dup = duplexify(write, read)
+
+ dup.on('error', function(err) {
+ t.same(err.message, 'read-error', 'received read error')
+ })
+ dup.on('close', function() {
+ t.ok(true, 'close emitted')
+ })
+
+ read.emit('error', new Error('read-error'))
+ write.emit('error', new Error('write-error')) // only emit first error
+})
+
+tape('bubble write errors', function(t) {
+ t.plan(2)
+
+ var write = through()
+ var read = through()
+ var dup = duplexify(write, read)
+
+ dup.on('error', function(err) {
+ t.same(err.message, 'write-error', 'received write error')
+ })
+ dup.on('close', function() {
+ t.ok(true, 'close emitted')
+ })
+
+ write.emit('error', new Error('write-error'))
+ read.emit('error', new Error('read-error')) // only emit first error
+})
+
+tape('reset writable / readable', function(t) {
+ t.plan(3)
+
+ var toUpperCase = function(data, enc, cb) {
+ cb(null, data.toString().toUpperCase())
+ }
+
+ var passthrough = through()
+ var upper = through(toUpperCase)
+ var dup = duplexify(passthrough, passthrough)
+
+ dup.once('data', function(data) {
+ t.same(data.toString(), 'hello')
+ dup.setWritable(upper)
+ dup.setReadable(upper)
+ dup.once('data', function(data) {
+ t.same(data.toString(), 'HELLO')
+ dup.once('data', function(data) {
+ t.same(data.toString(), 'HI')
+ t.end()
+ })
+ })
+ dup.write('hello')
+ dup.write('hi')
+ })
+ dup.write('hello')
+})
+
+tape('cork', function(t) {
+ var passthrough = through()
+ var dup = duplexify(passthrough, passthrough)
+ var ok = false
+
+ dup.on('prefinish', function() {
+ dup.cork()
+ setTimeout(function() {
+ ok = true
+ dup.uncork()
+ }, 100)
+ })
+ dup.on('finish', function() {
+ t.ok(ok)
+ t.end()
+ })
+ dup.end()
+})
+
+tape('prefinish not twice', function(t) {
+ var passthrough = through()
+ var dup = duplexify(passthrough, passthrough)
+ var prefinished = false
+
+ dup.on('prefinish', function() {
+ t.ok(!prefinished, 'only prefinish once')
+ prefinished = true
+ })
+
+ dup.on('finish', function() {
+ t.end()
+ })
+
+ dup.end()
+})
+
+tape('close', function(t) {
+ var passthrough = through()
+ var dup = duplexify(passthrough, passthrough)
+
+ passthrough.emit('close')
+ dup.on('close', function() {
+ t.ok(true, 'should forward close')
+ t.end()
+ })
+})
+
+tape('works with node native streams (net)', function(t) {
+ t.plan(1)
+
+ var server = net.createServer(function(socket) {
+ var dup = duplexify(socket, socket)
+
+ dup.once('data', function(chunk) {
+ t.same(chunk, HELLO_WORLD)
+ server.close()
+ socket.end()
+ t.end()
+ })
+ })
+
+ server.listen(0, function () {
+ var socket = net.connect(server.address().port)
+ var dup = duplexify(socket, socket)
+
+ dup.write(HELLO_WORLD)
+ })
+})
diff --git a/Nodejs/node_modules/ecc-jsbn/LICENSE b/Nodejs/node_modules/ecc-jsbn/LICENSE
new file mode 100755
index 0000000..f668fef
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Jeremie Miller
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/Nodejs/node_modules/ecc-jsbn/README.md b/Nodejs/node_modules/ecc-jsbn/README.md
new file mode 100755
index 0000000..b5d0b9d
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/README.md
@@ -0,0 +1,8 @@
+ecc-jsbn
+========
+
+ECC package based on [jsbn](https://github.com/andyperlitch/jsbn) from [Tom Wu](http://www-cs-students.stanford.edu/~tjw/).
+
+This is a subset of the same interface as the [node compiled module](https://github.com/quartzjer/ecc), but works in the browser too.
+
+Also uses point compression now from [https://github.com/kaielvin](https://github.com/kaielvin/jsbn-ec-point-compression).
diff --git a/Nodejs/node_modules/ecc-jsbn/index.js b/Nodejs/node_modules/ecc-jsbn/index.js
new file mode 100755
index 0000000..fb19a1d
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/index.js
@@ -0,0 +1,58 @@
+var crypto = require("crypto");
+var BigInteger = require("jsbn").BigInteger;
+var ECPointFp = require("./lib/ec.js").ECPointFp;
+var Buffer = require("safer-buffer").Buffer;
+exports.ECCurves = require("./lib/sec.js");
+
+// zero prepad
+function unstupid(hex,len)
+{
+ return (hex.length >= len) ? hex : unstupid("0"+hex,len);
+}
+
+exports.ECKey = function(curve, key, isPublic)
+{
+ var priv;
+ var c = curve();
+ var n = c.getN();
+ var bytes = Math.floor(n.bitLength()/8);
+
+ if(key)
+ {
+ if(isPublic)
+ {
+ var curve = c.getCurve();
+// var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format
+// var y = key.slice(bytes+1);
+// this.P = new ECPointFp(curve,
+// curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)),
+// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16)));
+ this.P = curve.decodePointHex(key.toString("hex"));
+ }else{
+ if(key.length != bytes) return false;
+ priv = new BigInteger(key.toString("hex"), 16);
+ }
+ }else{
+ var n1 = n.subtract(BigInteger.ONE);
+ var r = new BigInteger(crypto.randomBytes(n.bitLength()));
+ priv = r.mod(n1).add(BigInteger.ONE);
+ this.P = c.getG().multiply(priv);
+ }
+ if(this.P)
+ {
+// var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2);
+// this.PublicKey = Buffer.from("04"+pubhex,"hex");
+ this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),"hex");
+ }
+ if(priv)
+ {
+ this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),"hex");
+ this.deriveSharedSecret = function(key)
+ {
+ if(!key || !key.P) return false;
+ var S = key.P.multiply(priv);
+ return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex");
+ }
+ }
+}
+
diff --git a/Nodejs/node_modules/ecc-jsbn/lib/LICENSE-jsbn b/Nodejs/node_modules/ecc-jsbn/lib/LICENSE-jsbn
new file mode 100755
index 0000000..24502a9
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/lib/LICENSE-jsbn
@@ -0,0 +1,40 @@
+Licensing
+---------
+
+This software is covered under the following copyright:
+
+/*
+ * Copyright (c) 2003-2005 Tom Wu
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
+ * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * In addition, the following condition applies:
+ *
+ * All redistributions must retain an intact copy of this copyright notice
+ * and disclaimer.
+ */
+
+Address all questions regarding this license to:
+
+ Tom Wu
+ tjw@cs.Stanford.EDU
diff --git a/Nodejs/node_modules/ecc-jsbn/lib/ec.js b/Nodejs/node_modules/ecc-jsbn/lib/ec.js
new file mode 100755
index 0000000..3852671
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/lib/ec.js
@@ -0,0 +1,561 @@
+// Basic Javascript Elliptic Curve implementation
+// Ported loosely from BouncyCastle's Java EC code
+// Only Fp curves implemented for now
+
+// Requires jsbn.js and jsbn2.js
+var BigInteger = require('jsbn').BigInteger
+var Barrett = BigInteger.prototype.Barrett
+
+// ----------------
+// ECFieldElementFp
+
+// constructor
+function ECFieldElementFp(q,x) {
+ this.x = x;
+ // TODO if(x.compareTo(q) >= 0) error
+ this.q = q;
+}
+
+function feFpEquals(other) {
+ if(other == this) return true;
+ return (this.q.equals(other.q) && this.x.equals(other.x));
+}
+
+function feFpToBigInteger() {
+ return this.x;
+}
+
+function feFpNegate() {
+ return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));
+}
+
+function feFpAdd(b) {
+ return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));
+}
+
+function feFpSubtract(b) {
+ return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));
+}
+
+function feFpMultiply(b) {
+ return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));
+}
+
+function feFpSquare() {
+ return new ECFieldElementFp(this.q, this.x.square().mod(this.q));
+}
+
+function feFpDivide(b) {
+ return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));
+}
+
+ECFieldElementFp.prototype.equals = feFpEquals;
+ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger;
+ECFieldElementFp.prototype.negate = feFpNegate;
+ECFieldElementFp.prototype.add = feFpAdd;
+ECFieldElementFp.prototype.subtract = feFpSubtract;
+ECFieldElementFp.prototype.multiply = feFpMultiply;
+ECFieldElementFp.prototype.square = feFpSquare;
+ECFieldElementFp.prototype.divide = feFpDivide;
+
+// ----------------
+// ECPointFp
+
+// constructor
+function ECPointFp(curve,x,y,z) {
+ this.curve = curve;
+ this.x = x;
+ this.y = y;
+ // Projective coordinates: either zinv == null or z * zinv == 1
+ // z and zinv are just BigIntegers, not fieldElements
+ if(z == null) {
+ this.z = BigInteger.ONE;
+ }
+ else {
+ this.z = z;
+ }
+ this.zinv = null;
+ //TODO: compression flag
+}
+
+function pointFpGetX() {
+ if(this.zinv == null) {
+ this.zinv = this.z.modInverse(this.curve.q);
+ }
+ var r = this.x.toBigInteger().multiply(this.zinv);
+ this.curve.reduce(r);
+ return this.curve.fromBigInteger(r);
+}
+
+function pointFpGetY() {
+ if(this.zinv == null) {
+ this.zinv = this.z.modInverse(this.curve.q);
+ }
+ var r = this.y.toBigInteger().multiply(this.zinv);
+ this.curve.reduce(r);
+ return this.curve.fromBigInteger(r);
+}
+
+function pointFpEquals(other) {
+ if(other == this) return true;
+ if(this.isInfinity()) return other.isInfinity();
+ if(other.isInfinity()) return this.isInfinity();
+ var u, v;
+ // u = Y2 * Z1 - Y1 * Z2
+ u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);
+ if(!u.equals(BigInteger.ZERO)) return false;
+ // v = X2 * Z1 - X1 * Z2
+ v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);
+ return v.equals(BigInteger.ZERO);
+}
+
+function pointFpIsInfinity() {
+ if((this.x == null) && (this.y == null)) return true;
+ return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);
+}
+
+function pointFpNegate() {
+ return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);
+}
+
+function pointFpAdd(b) {
+ if(this.isInfinity()) return b;
+ if(b.isInfinity()) return this;
+
+ // u = Y2 * Z1 - Y1 * Z2
+ var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q);
+ // v = X2 * Z1 - X1 * Z2
+ var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);
+
+ if(BigInteger.ZERO.equals(v)) {
+ if(BigInteger.ZERO.equals(u)) {
+ return this.twice(); // this == b, so double
+ }
+ return this.curve.getInfinity(); // this = -b, so infinity
+ }
+
+ var THREE = new BigInteger("3");
+ var x1 = this.x.toBigInteger();
+ var y1 = this.y.toBigInteger();
+ var x2 = b.x.toBigInteger();
+ var y2 = b.y.toBigInteger();
+
+ var v2 = v.square();
+ var v3 = v2.multiply(v);
+ var x1v2 = x1.multiply(v2);
+ var zu2 = u.square().multiply(this.z);
+
+ // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
+ var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q);
+ // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
+ var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q);
+ // z3 = v^3 * z1 * z2
+ var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q);
+
+ return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
+}
+
+function pointFpTwice() {
+ if(this.isInfinity()) return this;
+ if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();
+
+ // TODO: optimized handling of constants
+ var THREE = new BigInteger("3");
+ var x1 = this.x.toBigInteger();
+ var y1 = this.y.toBigInteger();
+
+ var y1z1 = y1.multiply(this.z);
+ var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q);
+ var a = this.curve.a.toBigInteger();
+
+ // w = 3 * x1^2 + a * z1^2
+ var w = x1.square().multiply(THREE);
+ if(!BigInteger.ZERO.equals(a)) {
+ w = w.add(this.z.square().multiply(a));
+ }
+ w = w.mod(this.curve.q);
+ //this.curve.reduce(w);
+ // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
+ var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q);
+ // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
+ var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q);
+ // z3 = 8 * (y1 * z1)^3
+ var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);
+
+ return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
+}
+
+// Simple NAF (Non-Adjacent Form) multiplication algorithm
+// TODO: modularize the multiplication algorithm
+function pointFpMultiply(k) {
+ if(this.isInfinity()) return this;
+ if(k.signum() == 0) return this.curve.getInfinity();
+
+ var e = k;
+ var h = e.multiply(new BigInteger("3"));
+
+ var neg = this.negate();
+ var R = this;
+
+ var i;
+ for(i = h.bitLength() - 2; i > 0; --i) {
+ R = R.twice();
+
+ var hBit = h.testBit(i);
+ var eBit = e.testBit(i);
+
+ if (hBit != eBit) {
+ R = R.add(hBit ? this : neg);
+ }
+ }
+
+ return R;
+}
+
+// Compute this*j + x*k (simultaneous multiplication)
+function pointFpMultiplyTwo(j,x,k) {
+ var i;
+ if(j.bitLength() > k.bitLength())
+ i = j.bitLength() - 1;
+ else
+ i = k.bitLength() - 1;
+
+ var R = this.curve.getInfinity();
+ var both = this.add(x);
+ while(i >= 0) {
+ R = R.twice();
+ if(j.testBit(i)) {
+ if(k.testBit(i)) {
+ R = R.add(both);
+ }
+ else {
+ R = R.add(this);
+ }
+ }
+ else {
+ if(k.testBit(i)) {
+ R = R.add(x);
+ }
+ }
+ --i;
+ }
+
+ return R;
+}
+
+ECPointFp.prototype.getX = pointFpGetX;
+ECPointFp.prototype.getY = pointFpGetY;
+ECPointFp.prototype.equals = pointFpEquals;
+ECPointFp.prototype.isInfinity = pointFpIsInfinity;
+ECPointFp.prototype.negate = pointFpNegate;
+ECPointFp.prototype.add = pointFpAdd;
+ECPointFp.prototype.twice = pointFpTwice;
+ECPointFp.prototype.multiply = pointFpMultiply;
+ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo;
+
+// ----------------
+// ECCurveFp
+
+// constructor
+function ECCurveFp(q,a,b) {
+ this.q = q;
+ this.a = this.fromBigInteger(a);
+ this.b = this.fromBigInteger(b);
+ this.infinity = new ECPointFp(this, null, null);
+ this.reducer = new Barrett(this.q);
+}
+
+function curveFpGetQ() {
+ return this.q;
+}
+
+function curveFpGetA() {
+ return this.a;
+}
+
+function curveFpGetB() {
+ return this.b;
+}
+
+function curveFpEquals(other) {
+ if(other == this) return true;
+ return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b));
+}
+
+function curveFpGetInfinity() {
+ return this.infinity;
+}
+
+function curveFpFromBigInteger(x) {
+ return new ECFieldElementFp(this.q, x);
+}
+
+function curveReduce(x) {
+ this.reducer.reduce(x);
+}
+
+// for now, work with hex strings because they're easier in JS
+function curveFpDecodePointHex(s) {
+ switch(parseInt(s.substr(0,2), 16)) { // first byte
+ case 0:
+ return this.infinity;
+ case 2:
+ case 3:
+ // point compression not supported yet
+ return null;
+ case 4:
+ case 6:
+ case 7:
+ var len = (s.length - 2) / 2;
+ var xHex = s.substr(2, len);
+ var yHex = s.substr(len+2, len);
+
+ return new ECPointFp(this,
+ this.fromBigInteger(new BigInteger(xHex, 16)),
+ this.fromBigInteger(new BigInteger(yHex, 16)));
+
+ default: // unsupported
+ return null;
+ }
+}
+
+function curveFpEncodePointHex(p) {
+ if (p.isInfinity()) return "00";
+ var xHex = p.getX().toBigInteger().toString(16);
+ var yHex = p.getY().toBigInteger().toString(16);
+ var oLen = this.getQ().toString(16).length;
+ if ((oLen % 2) != 0) oLen++;
+ while (xHex.length < oLen) {
+ xHex = "0" + xHex;
+ }
+ while (yHex.length < oLen) {
+ yHex = "0" + yHex;
+ }
+ return "04" + xHex + yHex;
+}
+
+ECCurveFp.prototype.getQ = curveFpGetQ;
+ECCurveFp.prototype.getA = curveFpGetA;
+ECCurveFp.prototype.getB = curveFpGetB;
+ECCurveFp.prototype.equals = curveFpEquals;
+ECCurveFp.prototype.getInfinity = curveFpGetInfinity;
+ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger;
+ECCurveFp.prototype.reduce = curveReduce;
+//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex;
+ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex;
+
+// from: https://github.com/kaielvin/jsbn-ec-point-compression
+ECCurveFp.prototype.decodePointHex = function(s)
+{
+ var yIsEven;
+ switch(parseInt(s.substr(0,2), 16)) { // first byte
+ case 0:
+ return this.infinity;
+ case 2:
+ yIsEven = false;
+ case 3:
+ if(yIsEven == undefined) yIsEven = true;
+ var len = s.length - 2;
+ var xHex = s.substr(2, len);
+ var x = this.fromBigInteger(new BigInteger(xHex,16));
+ var alpha = x.multiply(x.square().add(this.getA())).add(this.getB());
+ var beta = alpha.sqrt();
+
+ if (beta == null) throw "Invalid point compression";
+
+ var betaValue = beta.toBigInteger();
+ if (betaValue.testBit(0) != yIsEven)
+ {
+ // Use the other root
+ beta = this.fromBigInteger(this.getQ().subtract(betaValue));
+ }
+ return new ECPointFp(this,x,beta);
+ case 4:
+ case 6:
+ case 7:
+ var len = (s.length - 2) / 2;
+ var xHex = s.substr(2, len);
+ var yHex = s.substr(len+2, len);
+
+ return new ECPointFp(this,
+ this.fromBigInteger(new BigInteger(xHex, 16)),
+ this.fromBigInteger(new BigInteger(yHex, 16)));
+
+ default: // unsupported
+ return null;
+ }
+}
+ECCurveFp.prototype.encodeCompressedPointHex = function(p)
+{
+ if (p.isInfinity()) return "00";
+ var xHex = p.getX().toBigInteger().toString(16);
+ var oLen = this.getQ().toString(16).length;
+ if ((oLen % 2) != 0) oLen++;
+ while (xHex.length < oLen)
+ xHex = "0" + xHex;
+ var yPrefix;
+ if(p.getY().toBigInteger().isEven()) yPrefix = "02";
+ else yPrefix = "03";
+
+ return yPrefix + xHex;
+}
+
+
+ECFieldElementFp.prototype.getR = function()
+{
+ if(this.r != undefined) return this.r;
+
+ this.r = null;
+ var bitLength = this.q.bitLength();
+ if (bitLength > 128)
+ {
+ var firstWord = this.q.shiftRight(bitLength - 64);
+ if (firstWord.intValue() == -1)
+ {
+ this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q);
+ }
+ }
+ return this.r;
+}
+ECFieldElementFp.prototype.modMult = function(x1,x2)
+{
+ return this.modReduce(x1.multiply(x2));
+}
+ECFieldElementFp.prototype.modReduce = function(x)
+{
+ if (this.getR() != null)
+ {
+ var qLen = q.bitLength();
+ while (x.bitLength() > (qLen + 1))
+ {
+ var u = x.shiftRight(qLen);
+ var v = x.subtract(u.shiftLeft(qLen));
+ if (!this.getR().equals(BigInteger.ONE))
+ {
+ u = u.multiply(this.getR());
+ }
+ x = u.add(v);
+ }
+ while (x.compareTo(q) >= 0)
+ {
+ x = x.subtract(q);
+ }
+ }
+ else
+ {
+ x = x.mod(q);
+ }
+ return x;
+}
+ECFieldElementFp.prototype.sqrt = function()
+{
+ if (!this.q.testBit(0)) throw "unsupported";
+
+ // p mod 4 == 3
+ if (this.q.testBit(1))
+ {
+ var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));
+ return z.square().equals(this) ? z : null;
+ }
+
+ // p mod 4 == 1
+ var qMinusOne = this.q.subtract(BigInteger.ONE);
+
+ var legendreExponent = qMinusOne.shiftRight(1);
+ if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)))
+ {
+ return null;
+ }
+
+ var u = qMinusOne.shiftRight(2);
+ var k = u.shiftLeft(1).add(BigInteger.ONE);
+
+ var Q = this.x;
+ var fourQ = modDouble(modDouble(Q));
+
+ var U, V;
+ do
+ {
+ var P;
+ do
+ {
+ P = new BigInteger(this.q.bitLength(), new SecureRandom());
+ }
+ while (P.compareTo(this.q) >= 0
+ || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)));
+
+ var result = this.lucasSequence(P, Q, k);
+ U = result[0];
+ V = result[1];
+
+ if (this.modMult(V, V).equals(fourQ))
+ {
+ // Integer division by 2, mod q
+ if (V.testBit(0))
+ {
+ V = V.add(q);
+ }
+
+ V = V.shiftRight(1);
+
+ return new ECFieldElementFp(q,V);
+ }
+ }
+ while (U.equals(BigInteger.ONE) || U.equals(qMinusOne));
+
+ return null;
+}
+ECFieldElementFp.prototype.lucasSequence = function(P,Q,k)
+{
+ var n = k.bitLength();
+ var s = k.getLowestSetBit();
+
+ var Uh = BigInteger.ONE;
+ var Vl = BigInteger.TWO;
+ var Vh = P;
+ var Ql = BigInteger.ONE;
+ var Qh = BigInteger.ONE;
+
+ for (var j = n - 1; j >= s + 1; --j)
+ {
+ Ql = this.modMult(Ql, Qh);
+
+ if (k.testBit(j))
+ {
+ Qh = this.modMult(Ql, Q);
+ Uh = this.modMult(Uh, Vh);
+ Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
+ Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)));
+ }
+ else
+ {
+ Qh = Ql;
+ Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
+ Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
+ Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
+ }
+ }
+
+ Ql = this.modMult(Ql, Qh);
+ Qh = this.modMult(Ql, Q);
+ Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
+ Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
+ Ql = this.modMult(Ql, Qh);
+
+ for (var j = 1; j <= s; ++j)
+ {
+ Uh = this.modMult(Uh, Vl);
+ Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
+ Ql = this.modMult(Ql, Ql);
+ }
+
+ return [ Uh, Vl ];
+}
+
+var exports = {
+ ECCurveFp: ECCurveFp,
+ ECPointFp: ECPointFp,
+ ECFieldElementFp: ECFieldElementFp
+}
+
+module.exports = exports
diff --git a/Nodejs/node_modules/ecc-jsbn/lib/sec.js b/Nodejs/node_modules/ecc-jsbn/lib/sec.js
new file mode 100755
index 0000000..5eec817
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/lib/sec.js
@@ -0,0 +1,170 @@
+// Named EC curves
+
+// Requires ec.js, jsbn.js, and jsbn2.js
+var BigInteger = require('jsbn').BigInteger
+var ECCurveFp = require('./ec.js').ECCurveFp
+
+
+// ----------------
+// X9ECParameters
+
+// constructor
+function X9ECParameters(curve,g,n,h) {
+ this.curve = curve;
+ this.g = g;
+ this.n = n;
+ this.h = h;
+}
+
+function x9getCurve() {
+ return this.curve;
+}
+
+function x9getG() {
+ return this.g;
+}
+
+function x9getN() {
+ return this.n;
+}
+
+function x9getH() {
+ return this.h;
+}
+
+X9ECParameters.prototype.getCurve = x9getCurve;
+X9ECParameters.prototype.getG = x9getG;
+X9ECParameters.prototype.getN = x9getN;
+X9ECParameters.prototype.getH = x9getH;
+
+// ----------------
+// SECNamedCurves
+
+function fromHex(s) { return new BigInteger(s, 16); }
+
+function secp128r1() {
+ // p = 2^128 - 2^97 - 1
+ var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
+ var a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC");
+ var b = fromHex("E87579C11079F43DD824993C2CEE5ED3");
+ //byte[] S = Hex.decode("000E0D4D696E6768756151750CC03A4473D03679");
+ var n = fromHex("FFFFFFFE0000000075A30D1B9038A115");
+ var h = BigInteger.ONE;
+ var curve = new ECCurveFp(p, a, b);
+ var G = curve.decodePointHex("04"
+ + "161FF7528B899B2D0C28607CA52C5B86"
+ + "CF5AC8395BAFEB13C02DA292DDED7A83");
+ return new X9ECParameters(curve, G, n, h);
+}
+
+function secp160k1() {
+ // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
+ var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
+ var a = BigInteger.ZERO;
+ var b = fromHex("7");
+ //byte[] S = null;
+ var n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
+ var h = BigInteger.ONE;
+ var curve = new ECCurveFp(p, a, b);
+ var G = curve.decodePointHex("04"
+ + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"
+ + "938CF935318FDCED6BC28286531733C3F03C4FEE");
+ return new X9ECParameters(curve, G, n, h);
+}
+
+function secp160r1() {
+ // p = 2^160 - 2^31 - 1
+ var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF");
+ var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC");
+ var b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45");
+ //byte[] S = Hex.decode("1053CDE42C14D696E67687561517533BF3F83345");
+ var n = fromHex("0100000000000000000001F4C8F927AED3CA752257");
+ var h = BigInteger.ONE;
+ var curve = new ECCurveFp(p, a, b);
+ var G = curve.decodePointHex("04"
+ + "4A96B5688EF573284664698968C38BB913CBFC82"
+ + "23A628553168947D59DCC912042351377AC5FB32");
+ return new X9ECParameters(curve, G, n, h);
+}
+
+function secp192k1() {
+ // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1
+ var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37");
+ var a = BigInteger.ZERO;
+ var b = fromHex("3");
+ //byte[] S = null;
+ var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D");
+ var h = BigInteger.ONE;
+ var curve = new ECCurveFp(p, a, b);
+ var G = curve.decodePointHex("04"
+ + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D"
+ + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");
+ return new X9ECParameters(curve, G, n, h);
+}
+
+function secp192r1() {
+ // p = 2^192 - 2^64 - 1
+ var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF");
+ var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC");
+ var b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1");
+ //byte[] S = Hex.decode("3045AE6FC8422F64ED579528D38120EAE12196D5");
+ var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831");
+ var h = BigInteger.ONE;
+ var curve = new ECCurveFp(p, a, b);
+ var G = curve.decodePointHex("04"
+ + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"
+ + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811");
+ return new X9ECParameters(curve, G, n, h);
+}
+
+function secp224r1() {
+ // p = 2^224 - 2^96 + 1
+ var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001");
+ var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE");
+ var b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4");
+ //byte[] S = Hex.decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5");
+ var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D");
+ var h = BigInteger.ONE;
+ var curve = new ECCurveFp(p, a, b);
+ var G = curve.decodePointHex("04"
+ + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"
+ + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");
+ return new X9ECParameters(curve, G, n, h);
+}
+
+function secp256r1() {
+ // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1
+ var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF");
+ var a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC");
+ var b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B");
+ //byte[] S = Hex.decode("C49D360886E704936A6678E1139D26B7819F7E90");
+ var n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551");
+ var h = BigInteger.ONE;
+ var curve = new ECCurveFp(p, a, b);
+ var G = curve.decodePointHex("04"
+ + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"
+ + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");
+ return new X9ECParameters(curve, G, n, h);
+}
+
+// TODO: make this into a proper hashtable
+function getSECCurveByName(name) {
+ if(name == "secp128r1") return secp128r1();
+ if(name == "secp160k1") return secp160k1();
+ if(name == "secp160r1") return secp160r1();
+ if(name == "secp192k1") return secp192k1();
+ if(name == "secp192r1") return secp192r1();
+ if(name == "secp224r1") return secp224r1();
+ if(name == "secp256r1") return secp256r1();
+ return null;
+}
+
+module.exports = {
+ "secp128r1":secp128r1,
+ "secp160k1":secp160k1,
+ "secp160r1":secp160r1,
+ "secp192k1":secp192k1,
+ "secp192r1":secp192r1,
+ "secp224r1":secp224r1,
+ "secp256r1":secp256r1
+}
diff --git a/Nodejs/node_modules/ecc-jsbn/package.json b/Nodejs/node_modules/ecc-jsbn/package.json
new file mode 100755
index 0000000..533c7a0
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/package.json
@@ -0,0 +1,65 @@
+{
+ "_from": "ecc-jsbn@~0.1.1",
+ "_id": "ecc-jsbn@0.1.2",
+ "_inBundle": false,
+ "_integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
+ "_location": "/ecc-jsbn",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "ecc-jsbn@~0.1.1",
+ "name": "ecc-jsbn",
+ "escapedName": "ecc-jsbn",
+ "rawSpec": "~0.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~0.1.1"
+ },
+ "_requiredBy": [
+ "/sshpk"
+ ],
+ "_resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
+ "_shasum": "3a83a904e54353287874c564b7549386849a98c9",
+ "_spec": "ecc-jsbn@~0.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/sshpk",
+ "author": {
+ "name": "Jeremie Miller",
+ "email": "jeremie@jabber.org",
+ "url": "http://jeremie.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/quartzjer/ecc-jsbn/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "jsbn": "~0.1.0",
+ "safer-buffer": "^2.1.0"
+ },
+ "deprecated": false,
+ "description": "ECC JS code based on JSBN",
+ "homepage": "https://github.com/quartzjer/ecc-jsbn",
+ "keywords": [
+ "jsbn",
+ "ecc",
+ "browserify"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "maintainers": [
+ {
+ "name": "Jeremie Miller",
+ "email": "jeremie@jabber.org",
+ "url": "http://jeremie.com/"
+ },
+ {
+ "name": "Ryan Bennett",
+ "url": "https://github.com/rynomad"
+ }
+ ],
+ "name": "ecc-jsbn",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/quartzjer/ecc-jsbn.git"
+ },
+ "version": "0.1.2"
+}
diff --git a/Nodejs/node_modules/ecc-jsbn/test.js b/Nodejs/node_modules/ecc-jsbn/test.js
new file mode 100755
index 0000000..bd52abf
--- /dev/null
+++ b/Nodejs/node_modules/ecc-jsbn/test.js
@@ -0,0 +1,14 @@
+var ecc = require("./index.js");
+var key1 = new ecc.ECKey(ecc.ECCurves.secp160r1);
+var key2 = new ecc.ECKey(ecc.ECCurves.secp160r1);
+console.log(key1.deriveSharedSecret(key2));
+var key3 = new ecc.ECKey(ecc.ECCurves.secp160r1,key1.PrivateKey);
+var key4 = new ecc.ECKey(ecc.ECCurves.secp160r1,key2.PublicKey,true);
+console.log(key3.deriveSharedSecret(key4));
+
+var key1 = new ecc.ECKey(ecc.ECCurves.secp256r1);
+var key2 = new ecc.ECKey(ecc.ECCurves.secp256r1);
+console.log(key1.deriveSharedSecret(key2));
+var key3 = new ecc.ECKey(ecc.ECCurves.secp256r1,key1.PrivateKey);
+var key4 = new ecc.ECKey(ecc.ECCurves.secp256r1,key2.PublicKey,true);
+console.log(key3.deriveSharedSecret(key4));
diff --git a/Nodejs/node_modules/end-of-stream/LICENSE b/Nodejs/node_modules/end-of-stream/LICENSE
new file mode 100644
index 0000000..757562e
--- /dev/null
+++ b/Nodejs/node_modules/end-of-stream/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/Nodejs/node_modules/end-of-stream/README.md b/Nodejs/node_modules/end-of-stream/README.md
new file mode 100644
index 0000000..857b14b
--- /dev/null
+++ b/Nodejs/node_modules/end-of-stream/README.md
@@ -0,0 +1,54 @@
+# end-of-stream
+
+A node module that calls a callback when a readable/writable/duplex stream has completed or failed.
+
+ npm install end-of-stream
+
+[](https://travis-ci.org/mafintosh/end-of-stream)
+
+## Usage
+
+Simply pass a stream and a callback to the `eos`.
+Both legacy streams, streams2 and stream3 are supported.
+
+``` js
+var eos = require('end-of-stream');
+
+eos(readableStream, function(err) {
+ // this will be set to the stream instance
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has ended', this === readableStream);
+});
+
+eos(writableStream, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has finished', this === writableStream);
+});
+
+eos(duplexStream, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has ended and finished', this === duplexStream);
+});
+
+eos(duplexStream, {readable:false}, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has finished but might still be readable');
+});
+
+eos(duplexStream, {writable:false}, function(err) {
+ if (err) return console.log('stream had an error or closed early');
+ console.log('stream has ended but might still be writable');
+});
+
+eos(readableStream, {error:false}, function(err) {
+ // do not treat emit('error', err) as a end-of-stream
+});
+```
+
+## License
+
+MIT
+
+## Related
+
+`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
diff --git a/Nodejs/node_modules/end-of-stream/index.js b/Nodejs/node_modules/end-of-stream/index.js
new file mode 100644
index 0000000..c77f0d5
--- /dev/null
+++ b/Nodejs/node_modules/end-of-stream/index.js
@@ -0,0 +1,94 @@
+var once = require('once');
+
+var noop = function() {};
+
+var isRequest = function(stream) {
+ return stream.setHeader && typeof stream.abort === 'function';
+};
+
+var isChildProcess = function(stream) {
+ return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
+};
+
+var eos = function(stream, opts, callback) {
+ if (typeof opts === 'function') return eos(stream, null, opts);
+ if (!opts) opts = {};
+
+ callback = once(callback || noop);
+
+ var ws = stream._writableState;
+ var rs = stream._readableState;
+ var readable = opts.readable || (opts.readable !== false && stream.readable);
+ var writable = opts.writable || (opts.writable !== false && stream.writable);
+ var cancelled = false;
+
+ var onlegacyfinish = function() {
+ if (!stream.writable) onfinish();
+ };
+
+ var onfinish = function() {
+ writable = false;
+ if (!readable) callback.call(stream);
+ };
+
+ var onend = function() {
+ readable = false;
+ if (!writable) callback.call(stream);
+ };
+
+ var onexit = function(exitCode) {
+ callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
+ };
+
+ var onerror = function(err) {
+ callback.call(stream, err);
+ };
+
+ var onclose = function() {
+ process.nextTick(onclosenexttick);
+ };
+
+ var onclosenexttick = function() {
+ if (cancelled) return;
+ if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
+ if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
+ };
+
+ var onrequest = function() {
+ stream.req.on('finish', onfinish);
+ };
+
+ if (isRequest(stream)) {
+ stream.on('complete', onfinish);
+ stream.on('abort', onclose);
+ if (stream.req) onrequest();
+ else stream.on('request', onrequest);
+ } else if (writable && !ws) { // legacy streams
+ stream.on('end', onlegacyfinish);
+ stream.on('close', onlegacyfinish);
+ }
+
+ if (isChildProcess(stream)) stream.on('exit', onexit);
+
+ stream.on('end', onend);
+ stream.on('finish', onfinish);
+ if (opts.error !== false) stream.on('error', onerror);
+ stream.on('close', onclose);
+
+ return function() {
+ cancelled = true;
+ stream.removeListener('complete', onfinish);
+ stream.removeListener('abort', onclose);
+ stream.removeListener('request', onrequest);
+ if (stream.req) stream.req.removeListener('finish', onfinish);
+ stream.removeListener('end', onlegacyfinish);
+ stream.removeListener('close', onlegacyfinish);
+ stream.removeListener('finish', onfinish);
+ stream.removeListener('exit', onexit);
+ stream.removeListener('end', onend);
+ stream.removeListener('error', onerror);
+ stream.removeListener('close', onclose);
+ };
+};
+
+module.exports = eos;
diff --git a/Nodejs/node_modules/end-of-stream/package.json b/Nodejs/node_modules/end-of-stream/package.json
new file mode 100644
index 0000000..a95eea0
--- /dev/null
+++ b/Nodejs/node_modules/end-of-stream/package.json
@@ -0,0 +1,68 @@
+{
+ "_from": "end-of-stream@^1.4.1",
+ "_id": "end-of-stream@1.4.4",
+ "_inBundle": false,
+ "_integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+ "_location": "/end-of-stream",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "end-of-stream@^1.4.1",
+ "name": "end-of-stream",
+ "escapedName": "end-of-stream",
+ "rawSpec": "^1.4.1",
+ "saveSpec": null,
+ "fetchSpec": "^1.4.1"
+ },
+ "_requiredBy": [
+ "/duplexify",
+ "/mqtt",
+ "/pump",
+ "/pumpify/pump"
+ ],
+ "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+ "_shasum": "5ae64a5f45057baf3626ec14da0ca5e4b2431eb0",
+ "_spec": "end-of-stream@^1.4.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/mqtt",
+ "author": {
+ "name": "Mathias Buus",
+ "email": "mathiasbuus@gmail.com"
+ },
+ "bugs": {
+ "url": "https://github.com/mafintosh/end-of-stream/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "once": "^1.4.0"
+ },
+ "deprecated": false,
+ "description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
+ "devDependencies": {
+ "tape": "^4.11.0"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/mafintosh/end-of-stream",
+ "keywords": [
+ "stream",
+ "streams",
+ "callback",
+ "finish",
+ "close",
+ "end",
+ "wait"
+ ],
+ "license": "MIT",
+ "main": "index.js",
+ "name": "end-of-stream",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mafintosh/end-of-stream.git"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "version": "1.4.4"
+}
diff --git a/Nodejs/node_modules/entities/.travis.yml b/Nodejs/node_modules/entities/.travis.yml
new file mode 100644
index 0000000..0ce2af6
--- /dev/null
+++ b/Nodejs/node_modules/entities/.travis.yml
@@ -0,0 +1,5 @@
+sudo: true
+language: node_js
+node_js:
+ - 8
+script: npm run coveralls
diff --git a/Nodejs/node_modules/entities/LICENSE b/Nodejs/node_modules/entities/LICENSE
new file mode 100644
index 0000000..c464f86
--- /dev/null
+++ b/Nodejs/node_modules/entities/LICENSE
@@ -0,0 +1,11 @@
+Copyright (c) Felix Böhm
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Nodejs/node_modules/entities/index.js b/Nodejs/node_modules/entities/index.js
new file mode 100644
index 0000000..91bf845
--- /dev/null
+++ b/Nodejs/node_modules/entities/index.js
@@ -0,0 +1,26 @@
+var encode = require("./lib/encode.js"),
+ decode = require("./lib/decode.js");
+
+exports.decode = function(data, level) {
+ return (!level || level <= 0 ? decode.XML : decode.HTML)(data);
+};
+
+exports.decodeStrict = function(data, level) {
+ return (!level || level <= 0 ? decode.XML : decode.HTMLStrict)(data);
+};
+
+exports.encode = function(data, level) {
+ return (!level || level <= 0 ? encode.XML : encode.HTML)(data);
+};
+
+exports.encodeXML = encode.XML;
+
+exports.encodeHTML4 = exports.encodeHTML5 = exports.encodeHTML = encode.HTML;
+
+exports.decodeXML = exports.decodeXMLStrict = decode.XML;
+
+exports.decodeHTML4 = exports.decodeHTML5 = exports.decodeHTML = decode.HTML;
+
+exports.decodeHTML4Strict = exports.decodeHTML5Strict = exports.decodeHTMLStrict = decode.HTMLStrict;
+
+exports.escape = encode.escape;
diff --git a/Nodejs/node_modules/entities/lib/decode.js b/Nodejs/node_modules/entities/lib/decode.js
new file mode 100644
index 0000000..1ca99ad
--- /dev/null
+++ b/Nodejs/node_modules/entities/lib/decode.js
@@ -0,0 +1,70 @@
+var entityMap = require("../maps/entities.json"),
+ legacyMap = require("../maps/legacy.json"),
+ xmlMap = require("../maps/xml.json"),
+ decodeCodePoint = require("./decode_codepoint.js");
+
+var decodeXMLStrict = getStrictDecoder(xmlMap),
+ decodeHTMLStrict = getStrictDecoder(entityMap);
+
+function getStrictDecoder(map) {
+ var keys = Object.keys(map).join("|"),
+ replace = getReplacer(map);
+
+ keys += "|#[xX][\\da-fA-F]+|#\\d+";
+
+ var re = new RegExp("&(?:" + keys + ");", "g");
+
+ return function(str) {
+ return String(str).replace(re, replace);
+ };
+}
+
+var decodeHTML = (function() {
+ var legacy = Object.keys(legacyMap).sort(sorter);
+
+ var keys = Object.keys(entityMap).sort(sorter);
+
+ for (var i = 0, j = 0; i < keys.length; i++) {
+ if (legacy[j] === keys[i]) {
+ keys[i] += ";?";
+ j++;
+ } else {
+ keys[i] += ";";
+ }
+ }
+
+ var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\da-fA-F]+;?|#\\d+;?)", "g"),
+ replace = getReplacer(entityMap);
+
+ function replacer(str) {
+ if (str.substr(-1) !== ";") str += ";";
+ return replace(str);
+ }
+
+ //TODO consider creating a merged map
+ return function(str) {
+ return String(str).replace(re, replacer);
+ };
+})();
+
+function sorter(a, b) {
+ return a < b ? 1 : -1;
+}
+
+function getReplacer(map) {
+ return function replace(str) {
+ if (str.charAt(1) === "#") {
+ if (str.charAt(2) === "X" || str.charAt(2) === "x") {
+ return decodeCodePoint(parseInt(str.substr(3), 16));
+ }
+ return decodeCodePoint(parseInt(str.substr(2), 10));
+ }
+ return map[str.slice(1, -1)];
+ };
+}
+
+module.exports = {
+ XML: decodeXMLStrict,
+ HTML: decodeHTML,
+ HTMLStrict: decodeHTMLStrict
+};
diff --git a/Nodejs/node_modules/entities/lib/decode_codepoint.js b/Nodejs/node_modules/entities/lib/decode_codepoint.js
new file mode 100644
index 0000000..2eadbe4
--- /dev/null
+++ b/Nodejs/node_modules/entities/lib/decode_codepoint.js
@@ -0,0 +1,25 @@
+var decodeMap = require("../maps/decode.json");
+
+module.exports = decodeCodePoint;
+
+// modified version of https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119
+function decodeCodePoint(codePoint) {
+ if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {
+ return "\uFFFD";
+ }
+
+ if (codePoint in decodeMap) {
+ codePoint = decodeMap[codePoint];
+ }
+
+ var output = "";
+
+ if (codePoint > 0xffff) {
+ codePoint -= 0x10000;
+ output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);
+ codePoint = 0xdc00 | (codePoint & 0x3ff);
+ }
+
+ output += String.fromCharCode(codePoint);
+ return output;
+}
diff --git a/Nodejs/node_modules/entities/lib/encode.js b/Nodejs/node_modules/entities/lib/encode.js
new file mode 100644
index 0000000..791c405
--- /dev/null
+++ b/Nodejs/node_modules/entities/lib/encode.js
@@ -0,0 +1,82 @@
+var inverseXML = getInverseObj(require("../maps/xml.json")),
+ xmlReplacer = getInverseReplacer(inverseXML);
+
+exports.XML = getInverse(inverseXML, xmlReplacer);
+
+var inverseHTML = getInverseObj(require("../maps/entities.json")),
+ htmlReplacer = getInverseReplacer(inverseHTML);
+
+exports.HTML = getInverse(inverseHTML, htmlReplacer);
+
+function getInverseObj(obj) {
+ return Object.keys(obj)
+ .sort()
+ .reduce(function(inverse, name) {
+ inverse[obj[name]] = "&" + name + ";";
+ return inverse;
+ }, {});
+}
+
+function getInverseReplacer(inverse) {
+ var single = [],
+ multiple = [];
+
+ Object.keys(inverse).forEach(function(k) {
+ if (k.length === 1) {
+ single.push("\\" + k);
+ } else {
+ multiple.push(k);
+ }
+ });
+
+ //TODO add ranges
+ multiple.unshift("[" + single.join("") + "]");
+
+ return new RegExp(multiple.join("|"), "g");
+}
+
+var re_nonASCII = /[^\0-\x7F]/g,
+ re_astralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
+
+function singleCharReplacer(c) {
+ return (
+ "" +
+ c
+ .charCodeAt(0)
+ .toString(16)
+ .toUpperCase() +
+ ";"
+ );
+}
+
+function astralReplacer(c) {
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ var high = c.charCodeAt(0);
+ var low = c.charCodeAt(1);
+ var codePoint = (high - 0xd800) * 0x400 + low - 0xdc00 + 0x10000;
+ return "" + codePoint.toString(16).toUpperCase() + ";";
+}
+
+function getInverse(inverse, re) {
+ function func(name) {
+ return inverse[name];
+ }
+
+ return function(data) {
+ return data
+ .replace(re, func)
+ .replace(re_astralSymbols, astralReplacer)
+ .replace(re_nonASCII, singleCharReplacer);
+ };
+}
+
+var re_xmlChars = getInverseReplacer(inverseXML);
+
+function escapeXML(data) {
+ return data
+ .replace(re_xmlChars, singleCharReplacer)
+ .replace(re_astralSymbols, astralReplacer)
+ .replace(re_nonASCII, singleCharReplacer);
+}
+
+exports.escape = escapeXML;
diff --git a/Nodejs/node_modules/entities/maps/decode.json b/Nodejs/node_modules/entities/maps/decode.json
new file mode 100644
index 0000000..44e5d0b
--- /dev/null
+++ b/Nodejs/node_modules/entities/maps/decode.json
@@ -0,0 +1 @@
+{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}
\ No newline at end of file
diff --git a/Nodejs/node_modules/entities/maps/entities.json b/Nodejs/node_modules/entities/maps/entities.json
new file mode 100644
index 0000000..7ccfcd8
--- /dev/null
+++ b/Nodejs/node_modules/entities/maps/entities.json
@@ -0,0 +1 @@
+{"Aacute":"\u00C1","aacute":"\u00E1","Abreve":"\u0102","abreve":"\u0103","ac":"\u223E","acd":"\u223F","acE":"\u223E\u0333","Acirc":"\u00C2","acirc":"\u00E2","acute":"\u00B4","Acy":"\u0410","acy":"\u0430","AElig":"\u00C6","aelig":"\u00E6","af":"\u2061","Afr":"\uD835\uDD04","afr":"\uD835\uDD1E","Agrave":"\u00C0","agrave":"\u00E0","alefsym":"\u2135","aleph":"\u2135","Alpha":"\u0391","alpha":"\u03B1","Amacr":"\u0100","amacr":"\u0101","amalg":"\u2A3F","amp":"&","AMP":"&","andand":"\u2A55","And":"\u2A53","and":"\u2227","andd":"\u2A5C","andslope":"\u2A58","andv":"\u2A5A","ang":"\u2220","ange":"\u29A4","angle":"\u2220","angmsdaa":"\u29A8","angmsdab":"\u29A9","angmsdac":"\u29AA","angmsdad":"\u29AB","angmsdae":"\u29AC","angmsdaf":"\u29AD","angmsdag":"\u29AE","angmsdah":"\u29AF","angmsd":"\u2221","angrt":"\u221F","angrtvb":"\u22BE","angrtvbd":"\u299D","angsph":"\u2222","angst":"\u00C5","angzarr":"\u237C","Aogon":"\u0104","aogon":"\u0105","Aopf":"\uD835\uDD38","aopf":"\uD835\uDD52","apacir":"\u2A6F","ap":"\u2248","apE":"\u2A70","ape":"\u224A","apid":"\u224B","apos":"'","ApplyFunction":"\u2061","approx":"\u2248","approxeq":"\u224A","Aring":"\u00C5","aring":"\u00E5","Ascr":"\uD835\uDC9C","ascr":"\uD835\uDCB6","Assign":"\u2254","ast":"*","asymp":"\u2248","asympeq":"\u224D","Atilde":"\u00C3","atilde":"\u00E3","Auml":"\u00C4","auml":"\u00E4","awconint":"\u2233","awint":"\u2A11","backcong":"\u224C","backepsilon":"\u03F6","backprime":"\u2035","backsim":"\u223D","backsimeq":"\u22CD","Backslash":"\u2216","Barv":"\u2AE7","barvee":"\u22BD","barwed":"\u2305","Barwed":"\u2306","barwedge":"\u2305","bbrk":"\u23B5","bbrktbrk":"\u23B6","bcong":"\u224C","Bcy":"\u0411","bcy":"\u0431","bdquo":"\u201E","becaus":"\u2235","because":"\u2235","Because":"\u2235","bemptyv":"\u29B0","bepsi":"\u03F6","bernou":"\u212C","Bernoullis":"\u212C","Beta":"\u0392","beta":"\u03B2","beth":"\u2136","between":"\u226C","Bfr":"\uD835\uDD05","bfr":"\uD835\uDD1F","bigcap":"\u22C2","bigcirc":"\u25EF","bigcup":"\u22C3","bigodot":"\u2A00","bigoplus":"\u2A01","bigotimes":"\u2A02","bigsqcup":"\u2A06","bigstar":"\u2605","bigtriangledown":"\u25BD","bigtriangleup":"\u25B3","biguplus":"\u2A04","bigvee":"\u22C1","bigwedge":"\u22C0","bkarow":"\u290D","blacklozenge":"\u29EB","blacksquare":"\u25AA","blacktriangle":"\u25B4","blacktriangledown":"\u25BE","blacktriangleleft":"\u25C2","blacktriangleright":"\u25B8","blank":"\u2423","blk12":"\u2592","blk14":"\u2591","blk34":"\u2593","block":"\u2588","bne":"=\u20E5","bnequiv":"\u2261\u20E5","bNot":"\u2AED","bnot":"\u2310","Bopf":"\uD835\uDD39","bopf":"\uD835\uDD53","bot":"\u22A5","bottom":"\u22A5","bowtie":"\u22C8","boxbox":"\u29C9","boxdl":"\u2510","boxdL":"\u2555","boxDl":"\u2556","boxDL":"\u2557","boxdr":"\u250C","boxdR":"\u2552","boxDr":"\u2553","boxDR":"\u2554","boxh":"\u2500","boxH":"\u2550","boxhd":"\u252C","boxHd":"\u2564","boxhD":"\u2565","boxHD":"\u2566","boxhu":"\u2534","boxHu":"\u2567","boxhU":"\u2568","boxHU":"\u2569","boxminus":"\u229F","boxplus":"\u229E","boxtimes":"\u22A0","boxul":"\u2518","boxuL":"\u255B","boxUl":"\u255C","boxUL":"\u255D","boxur":"\u2514","boxuR":"\u2558","boxUr":"\u2559","boxUR":"\u255A","boxv":"\u2502","boxV":"\u2551","boxvh":"\u253C","boxvH":"\u256A","boxVh":"\u256B","boxVH":"\u256C","boxvl":"\u2524","boxvL":"\u2561","boxVl":"\u2562","boxVL":"\u2563","boxvr":"\u251C","boxvR":"\u255E","boxVr":"\u255F","boxVR":"\u2560","bprime":"\u2035","breve":"\u02D8","Breve":"\u02D8","brvbar":"\u00A6","bscr":"\uD835\uDCB7","Bscr":"\u212C","bsemi":"\u204F","bsim":"\u223D","bsime":"\u22CD","bsolb":"\u29C5","bsol":"\\","bsolhsub":"\u27C8","bull":"\u2022","bullet":"\u2022","bump":"\u224E","bumpE":"\u2AAE","bumpe":"\u224F","Bumpeq":"\u224E","bumpeq":"\u224F","Cacute":"\u0106","cacute":"\u0107","capand":"\u2A44","capbrcup":"\u2A49","capcap":"\u2A4B","cap":"\u2229","Cap":"\u22D2","capcup":"\u2A47","capdot":"\u2A40","CapitalDifferentialD":"\u2145","caps":"\u2229\uFE00","caret":"\u2041","caron":"\u02C7","Cayleys":"\u212D","ccaps":"\u2A4D","Ccaron":"\u010C","ccaron":"\u010D","Ccedil":"\u00C7","ccedil":"\u00E7","Ccirc":"\u0108","ccirc":"\u0109","Cconint":"\u2230","ccups":"\u2A4C","ccupssm":"\u2A50","Cdot":"\u010A","cdot":"\u010B","cedil":"\u00B8","Cedilla":"\u00B8","cemptyv":"\u29B2","cent":"\u00A2","centerdot":"\u00B7","CenterDot":"\u00B7","cfr":"\uD835\uDD20","Cfr":"\u212D","CHcy":"\u0427","chcy":"\u0447","check":"\u2713","checkmark":"\u2713","Chi":"\u03A7","chi":"\u03C7","circ":"\u02C6","circeq":"\u2257","circlearrowleft":"\u21BA","circlearrowright":"\u21BB","circledast":"\u229B","circledcirc":"\u229A","circleddash":"\u229D","CircleDot":"\u2299","circledR":"\u00AE","circledS":"\u24C8","CircleMinus":"\u2296","CirclePlus":"\u2295","CircleTimes":"\u2297","cir":"\u25CB","cirE":"\u29C3","cire":"\u2257","cirfnint":"\u2A10","cirmid":"\u2AEF","cirscir":"\u29C2","ClockwiseContourIntegral":"\u2232","CloseCurlyDoubleQuote":"\u201D","CloseCurlyQuote":"\u2019","clubs":"\u2663","clubsuit":"\u2663","colon":":","Colon":"\u2237","Colone":"\u2A74","colone":"\u2254","coloneq":"\u2254","comma":",","commat":"@","comp":"\u2201","compfn":"\u2218","complement":"\u2201","complexes":"\u2102","cong":"\u2245","congdot":"\u2A6D","Congruent":"\u2261","conint":"\u222E","Conint":"\u222F","ContourIntegral":"\u222E","copf":"\uD835\uDD54","Copf":"\u2102","coprod":"\u2210","Coproduct":"\u2210","copy":"\u00A9","COPY":"\u00A9","copysr":"\u2117","CounterClockwiseContourIntegral":"\u2233","crarr":"\u21B5","cross":"\u2717","Cross":"\u2A2F","Cscr":"\uD835\uDC9E","cscr":"\uD835\uDCB8","csub":"\u2ACF","csube":"\u2AD1","csup":"\u2AD0","csupe":"\u2AD2","ctdot":"\u22EF","cudarrl":"\u2938","cudarrr":"\u2935","cuepr":"\u22DE","cuesc":"\u22DF","cularr":"\u21B6","cularrp":"\u293D","cupbrcap":"\u2A48","cupcap":"\u2A46","CupCap":"\u224D","cup":"\u222A","Cup":"\u22D3","cupcup":"\u2A4A","cupdot":"\u228D","cupor":"\u2A45","cups":"\u222A\uFE00","curarr":"\u21B7","curarrm":"\u293C","curlyeqprec":"\u22DE","curlyeqsucc":"\u22DF","curlyvee":"\u22CE","curlywedge":"\u22CF","curren":"\u00A4","curvearrowleft":"\u21B6","curvearrowright":"\u21B7","cuvee":"\u22CE","cuwed":"\u22CF","cwconint":"\u2232","cwint":"\u2231","cylcty":"\u232D","dagger":"\u2020","Dagger":"\u2021","daleth":"\u2138","darr":"\u2193","Darr":"\u21A1","dArr":"\u21D3","dash":"\u2010","Dashv":"\u2AE4","dashv":"\u22A3","dbkarow":"\u290F","dblac":"\u02DD","Dcaron":"\u010E","dcaron":"\u010F","Dcy":"\u0414","dcy":"\u0434","ddagger":"\u2021","ddarr":"\u21CA","DD":"\u2145","dd":"\u2146","DDotrahd":"\u2911","ddotseq":"\u2A77","deg":"\u00B0","Del":"\u2207","Delta":"\u0394","delta":"\u03B4","demptyv":"\u29B1","dfisht":"\u297F","Dfr":"\uD835\uDD07","dfr":"\uD835\uDD21","dHar":"\u2965","dharl":"\u21C3","dharr":"\u21C2","DiacriticalAcute":"\u00B4","DiacriticalDot":"\u02D9","DiacriticalDoubleAcute":"\u02DD","DiacriticalGrave":"`","DiacriticalTilde":"\u02DC","diam":"\u22C4","diamond":"\u22C4","Diamond":"\u22C4","diamondsuit":"\u2666","diams":"\u2666","die":"\u00A8","DifferentialD":"\u2146","digamma":"\u03DD","disin":"\u22F2","div":"\u00F7","divide":"\u00F7","divideontimes":"\u22C7","divonx":"\u22C7","DJcy":"\u0402","djcy":"\u0452","dlcorn":"\u231E","dlcrop":"\u230D","dollar":"$","Dopf":"\uD835\uDD3B","dopf":"\uD835\uDD55","Dot":"\u00A8","dot":"\u02D9","DotDot":"\u20DC","doteq":"\u2250","doteqdot":"\u2251","DotEqual":"\u2250","dotminus":"\u2238","dotplus":"\u2214","dotsquare":"\u22A1","doublebarwedge":"\u2306","DoubleContourIntegral":"\u222F","DoubleDot":"\u00A8","DoubleDownArrow":"\u21D3","DoubleLeftArrow":"\u21D0","DoubleLeftRightArrow":"\u21D4","DoubleLeftTee":"\u2AE4","DoubleLongLeftArrow":"\u27F8","DoubleLongLeftRightArrow":"\u27FA","DoubleLongRightArrow":"\u27F9","DoubleRightArrow":"\u21D2","DoubleRightTee":"\u22A8","DoubleUpArrow":"\u21D1","DoubleUpDownArrow":"\u21D5","DoubleVerticalBar":"\u2225","DownArrowBar":"\u2913","downarrow":"\u2193","DownArrow":"\u2193","Downarrow":"\u21D3","DownArrowUpArrow":"\u21F5","DownBreve":"\u0311","downdownarrows":"\u21CA","downharpoonleft":"\u21C3","downharpoonright":"\u21C2","DownLeftRightVector":"\u2950","DownLeftTeeVector":"\u295E","DownLeftVectorBar":"\u2956","DownLeftVector":"\u21BD","DownRightTeeVector":"\u295F","DownRightVectorBar":"\u2957","DownRightVector":"\u21C1","DownTeeArrow":"\u21A7","DownTee":"\u22A4","drbkarow":"\u2910","drcorn":"\u231F","drcrop":"\u230C","Dscr":"\uD835\uDC9F","dscr":"\uD835\uDCB9","DScy":"\u0405","dscy":"\u0455","dsol":"\u29F6","Dstrok":"\u0110","dstrok":"\u0111","dtdot":"\u22F1","dtri":"\u25BF","dtrif":"\u25BE","duarr":"\u21F5","duhar":"\u296F","dwangle":"\u29A6","DZcy":"\u040F","dzcy":"\u045F","dzigrarr":"\u27FF","Eacute":"\u00C9","eacute":"\u00E9","easter":"\u2A6E","Ecaron":"\u011A","ecaron":"\u011B","Ecirc":"\u00CA","ecirc":"\u00EA","ecir":"\u2256","ecolon":"\u2255","Ecy":"\u042D","ecy":"\u044D","eDDot":"\u2A77","Edot":"\u0116","edot":"\u0117","eDot":"\u2251","ee":"\u2147","efDot":"\u2252","Efr":"\uD835\uDD08","efr":"\uD835\uDD22","eg":"\u2A9A","Egrave":"\u00C8","egrave":"\u00E8","egs":"\u2A96","egsdot":"\u2A98","el":"\u2A99","Element":"\u2208","elinters":"\u23E7","ell":"\u2113","els":"\u2A95","elsdot":"\u2A97","Emacr":"\u0112","emacr":"\u0113","empty":"\u2205","emptyset":"\u2205","EmptySmallSquare":"\u25FB","emptyv":"\u2205","EmptyVerySmallSquare":"\u25AB","emsp13":"\u2004","emsp14":"\u2005","emsp":"\u2003","ENG":"\u014A","eng":"\u014B","ensp":"\u2002","Eogon":"\u0118","eogon":"\u0119","Eopf":"\uD835\uDD3C","eopf":"\uD835\uDD56","epar":"\u22D5","eparsl":"\u29E3","eplus":"\u2A71","epsi":"\u03B5","Epsilon":"\u0395","epsilon":"\u03B5","epsiv":"\u03F5","eqcirc":"\u2256","eqcolon":"\u2255","eqsim":"\u2242","eqslantgtr":"\u2A96","eqslantless":"\u2A95","Equal":"\u2A75","equals":"=","EqualTilde":"\u2242","equest":"\u225F","Equilibrium":"\u21CC","equiv":"\u2261","equivDD":"\u2A78","eqvparsl":"\u29E5","erarr":"\u2971","erDot":"\u2253","escr":"\u212F","Escr":"\u2130","esdot":"\u2250","Esim":"\u2A73","esim":"\u2242","Eta":"\u0397","eta":"\u03B7","ETH":"\u00D0","eth":"\u00F0","Euml":"\u00CB","euml":"\u00EB","euro":"\u20AC","excl":"!","exist":"\u2203","Exists":"\u2203","expectation":"\u2130","exponentiale":"\u2147","ExponentialE":"\u2147","fallingdotseq":"\u2252","Fcy":"\u0424","fcy":"\u0444","female":"\u2640","ffilig":"\uFB03","fflig":"\uFB00","ffllig":"\uFB04","Ffr":"\uD835\uDD09","ffr":"\uD835\uDD23","filig":"\uFB01","FilledSmallSquare":"\u25FC","FilledVerySmallSquare":"\u25AA","fjlig":"fj","flat":"\u266D","fllig":"\uFB02","fltns":"\u25B1","fnof":"\u0192","Fopf":"\uD835\uDD3D","fopf":"\uD835\uDD57","forall":"\u2200","ForAll":"\u2200","fork":"\u22D4","forkv":"\u2AD9","Fouriertrf":"\u2131","fpartint":"\u2A0D","frac12":"\u00BD","frac13":"\u2153","frac14":"\u00BC","frac15":"\u2155","frac16":"\u2159","frac18":"\u215B","frac23":"\u2154","frac25":"\u2156","frac34":"\u00BE","frac35":"\u2157","frac38":"\u215C","frac45":"\u2158","frac56":"\u215A","frac58":"\u215D","frac78":"\u215E","frasl":"\u2044","frown":"\u2322","fscr":"\uD835\uDCBB","Fscr":"\u2131","gacute":"\u01F5","Gamma":"\u0393","gamma":"\u03B3","Gammad":"\u03DC","gammad":"\u03DD","gap":"\u2A86","Gbreve":"\u011E","gbreve":"\u011F","Gcedil":"\u0122","Gcirc":"\u011C","gcirc":"\u011D","Gcy":"\u0413","gcy":"\u0433","Gdot":"\u0120","gdot":"\u0121","ge":"\u2265","gE":"\u2267","gEl":"\u2A8C","gel":"\u22DB","geq":"\u2265","geqq":"\u2267","geqslant":"\u2A7E","gescc":"\u2AA9","ges":"\u2A7E","gesdot":"\u2A80","gesdoto":"\u2A82","gesdotol":"\u2A84","gesl":"\u22DB\uFE00","gesles":"\u2A94","Gfr":"\uD835\uDD0A","gfr":"\uD835\uDD24","gg":"\u226B","Gg":"\u22D9","ggg":"\u22D9","gimel":"\u2137","GJcy":"\u0403","gjcy":"\u0453","gla":"\u2AA5","gl":"\u2277","glE":"\u2A92","glj":"\u2AA4","gnap":"\u2A8A","gnapprox":"\u2A8A","gne":"\u2A88","gnE":"\u2269","gneq":"\u2A88","gneqq":"\u2269","gnsim":"\u22E7","Gopf":"\uD835\uDD3E","gopf":"\uD835\uDD58","grave":"`","GreaterEqual":"\u2265","GreaterEqualLess":"\u22DB","GreaterFullEqual":"\u2267","GreaterGreater":"\u2AA2","GreaterLess":"\u2277","GreaterSlantEqual":"\u2A7E","GreaterTilde":"\u2273","Gscr":"\uD835\uDCA2","gscr":"\u210A","gsim":"\u2273","gsime":"\u2A8E","gsiml":"\u2A90","gtcc":"\u2AA7","gtcir":"\u2A7A","gt":">","GT":">","Gt":"\u226B","gtdot":"\u22D7","gtlPar":"\u2995","gtquest":"\u2A7C","gtrapprox":"\u2A86","gtrarr":"\u2978","gtrdot":"\u22D7","gtreqless":"\u22DB","gtreqqless":"\u2A8C","gtrless":"\u2277","gtrsim":"\u2273","gvertneqq":"\u2269\uFE00","gvnE":"\u2269\uFE00","Hacek":"\u02C7","hairsp":"\u200A","half":"\u00BD","hamilt":"\u210B","HARDcy":"\u042A","hardcy":"\u044A","harrcir":"\u2948","harr":"\u2194","hArr":"\u21D4","harrw":"\u21AD","Hat":"^","hbar":"\u210F","Hcirc":"\u0124","hcirc":"\u0125","hearts":"\u2665","heartsuit":"\u2665","hellip":"\u2026","hercon":"\u22B9","hfr":"\uD835\uDD25","Hfr":"\u210C","HilbertSpace":"\u210B","hksearow":"\u2925","hkswarow":"\u2926","hoarr":"\u21FF","homtht":"\u223B","hookleftarrow":"\u21A9","hookrightarrow":"\u21AA","hopf":"\uD835\uDD59","Hopf":"\u210D","horbar":"\u2015","HorizontalLine":"\u2500","hscr":"\uD835\uDCBD","Hscr":"\u210B","hslash":"\u210F","Hstrok":"\u0126","hstrok":"\u0127","HumpDownHump":"\u224E","HumpEqual":"\u224F","hybull":"\u2043","hyphen":"\u2010","Iacute":"\u00CD","iacute":"\u00ED","ic":"\u2063","Icirc":"\u00CE","icirc":"\u00EE","Icy":"\u0418","icy":"\u0438","Idot":"\u0130","IEcy":"\u0415","iecy":"\u0435","iexcl":"\u00A1","iff":"\u21D4","ifr":"\uD835\uDD26","Ifr":"\u2111","Igrave":"\u00CC","igrave":"\u00EC","ii":"\u2148","iiiint":"\u2A0C","iiint":"\u222D","iinfin":"\u29DC","iiota":"\u2129","IJlig":"\u0132","ijlig":"\u0133","Imacr":"\u012A","imacr":"\u012B","image":"\u2111","ImaginaryI":"\u2148","imagline":"\u2110","imagpart":"\u2111","imath":"\u0131","Im":"\u2111","imof":"\u22B7","imped":"\u01B5","Implies":"\u21D2","incare":"\u2105","in":"\u2208","infin":"\u221E","infintie":"\u29DD","inodot":"\u0131","intcal":"\u22BA","int":"\u222B","Int":"\u222C","integers":"\u2124","Integral":"\u222B","intercal":"\u22BA","Intersection":"\u22C2","intlarhk":"\u2A17","intprod":"\u2A3C","InvisibleComma":"\u2063","InvisibleTimes":"\u2062","IOcy":"\u0401","iocy":"\u0451","Iogon":"\u012E","iogon":"\u012F","Iopf":"\uD835\uDD40","iopf":"\uD835\uDD5A","Iota":"\u0399","iota":"\u03B9","iprod":"\u2A3C","iquest":"\u00BF","iscr":"\uD835\uDCBE","Iscr":"\u2110","isin":"\u2208","isindot":"\u22F5","isinE":"\u22F9","isins":"\u22F4","isinsv":"\u22F3","isinv":"\u2208","it":"\u2062","Itilde":"\u0128","itilde":"\u0129","Iukcy":"\u0406","iukcy":"\u0456","Iuml":"\u00CF","iuml":"\u00EF","Jcirc":"\u0134","jcirc":"\u0135","Jcy":"\u0419","jcy":"\u0439","Jfr":"\uD835\uDD0D","jfr":"\uD835\uDD27","jmath":"\u0237","Jopf":"\uD835\uDD41","jopf":"\uD835\uDD5B","Jscr":"\uD835\uDCA5","jscr":"\uD835\uDCBF","Jsercy":"\u0408","jsercy":"\u0458","Jukcy":"\u0404","jukcy":"\u0454","Kappa":"\u039A","kappa":"\u03BA","kappav":"\u03F0","Kcedil":"\u0136","kcedil":"\u0137","Kcy":"\u041A","kcy":"\u043A","Kfr":"\uD835\uDD0E","kfr":"\uD835\uDD28","kgreen":"\u0138","KHcy":"\u0425","khcy":"\u0445","KJcy":"\u040C","kjcy":"\u045C","Kopf":"\uD835\uDD42","kopf":"\uD835\uDD5C","Kscr":"\uD835\uDCA6","kscr":"\uD835\uDCC0","lAarr":"\u21DA","Lacute":"\u0139","lacute":"\u013A","laemptyv":"\u29B4","lagran":"\u2112","Lambda":"\u039B","lambda":"\u03BB","lang":"\u27E8","Lang":"\u27EA","langd":"\u2991","langle":"\u27E8","lap":"\u2A85","Laplacetrf":"\u2112","laquo":"\u00AB","larrb":"\u21E4","larrbfs":"\u291F","larr":"\u2190","Larr":"\u219E","lArr":"\u21D0","larrfs":"\u291D","larrhk":"\u21A9","larrlp":"\u21AB","larrpl":"\u2939","larrsim":"\u2973","larrtl":"\u21A2","latail":"\u2919","lAtail":"\u291B","lat":"\u2AAB","late":"\u2AAD","lates":"\u2AAD\uFE00","lbarr":"\u290C","lBarr":"\u290E","lbbrk":"\u2772","lbrace":"{","lbrack":"[","lbrke":"\u298B","lbrksld":"\u298F","lbrkslu":"\u298D","Lcaron":"\u013D","lcaron":"\u013E","Lcedil":"\u013B","lcedil":"\u013C","lceil":"\u2308","lcub":"{","Lcy":"\u041B","lcy":"\u043B","ldca":"\u2936","ldquo":"\u201C","ldquor":"\u201E","ldrdhar":"\u2967","ldrushar":"\u294B","ldsh":"\u21B2","le":"\u2264","lE":"\u2266","LeftAngleBracket":"\u27E8","LeftArrowBar":"\u21E4","leftarrow":"\u2190","LeftArrow":"\u2190","Leftarrow":"\u21D0","LeftArrowRightArrow":"\u21C6","leftarrowtail":"\u21A2","LeftCeiling":"\u2308","LeftDoubleBracket":"\u27E6","LeftDownTeeVector":"\u2961","LeftDownVectorBar":"\u2959","LeftDownVector":"\u21C3","LeftFloor":"\u230A","leftharpoondown":"\u21BD","leftharpoonup":"\u21BC","leftleftarrows":"\u21C7","leftrightarrow":"\u2194","LeftRightArrow":"\u2194","Leftrightarrow":"\u21D4","leftrightarrows":"\u21C6","leftrightharpoons":"\u21CB","leftrightsquigarrow":"\u21AD","LeftRightVector":"\u294E","LeftTeeArrow":"\u21A4","LeftTee":"\u22A3","LeftTeeVector":"\u295A","leftthreetimes":"\u22CB","LeftTriangleBar":"\u29CF","LeftTriangle":"\u22B2","LeftTriangleEqual":"\u22B4","LeftUpDownVector":"\u2951","LeftUpTeeVector":"\u2960","LeftUpVectorBar":"\u2958","LeftUpVector":"\u21BF","LeftVectorBar":"\u2952","LeftVector":"\u21BC","lEg":"\u2A8B","leg":"\u22DA","leq":"\u2264","leqq":"\u2266","leqslant":"\u2A7D","lescc":"\u2AA8","les":"\u2A7D","lesdot":"\u2A7F","lesdoto":"\u2A81","lesdotor":"\u2A83","lesg":"\u22DA\uFE00","lesges":"\u2A93","lessapprox":"\u2A85","lessdot":"\u22D6","lesseqgtr":"\u22DA","lesseqqgtr":"\u2A8B","LessEqualGreater":"\u22DA","LessFullEqual":"\u2266","LessGreater":"\u2276","lessgtr":"\u2276","LessLess":"\u2AA1","lesssim":"\u2272","LessSlantEqual":"\u2A7D","LessTilde":"\u2272","lfisht":"\u297C","lfloor":"\u230A","Lfr":"\uD835\uDD0F","lfr":"\uD835\uDD29","lg":"\u2276","lgE":"\u2A91","lHar":"\u2962","lhard":"\u21BD","lharu":"\u21BC","lharul":"\u296A","lhblk":"\u2584","LJcy":"\u0409","ljcy":"\u0459","llarr":"\u21C7","ll":"\u226A","Ll":"\u22D8","llcorner":"\u231E","Lleftarrow":"\u21DA","llhard":"\u296B","lltri":"\u25FA","Lmidot":"\u013F","lmidot":"\u0140","lmoustache":"\u23B0","lmoust":"\u23B0","lnap":"\u2A89","lnapprox":"\u2A89","lne":"\u2A87","lnE":"\u2268","lneq":"\u2A87","lneqq":"\u2268","lnsim":"\u22E6","loang":"\u27EC","loarr":"\u21FD","lobrk":"\u27E6","longleftarrow":"\u27F5","LongLeftArrow":"\u27F5","Longleftarrow":"\u27F8","longleftrightarrow":"\u27F7","LongLeftRightArrow":"\u27F7","Longleftrightarrow":"\u27FA","longmapsto":"\u27FC","longrightarrow":"\u27F6","LongRightArrow":"\u27F6","Longrightarrow":"\u27F9","looparrowleft":"\u21AB","looparrowright":"\u21AC","lopar":"\u2985","Lopf":"\uD835\uDD43","lopf":"\uD835\uDD5D","loplus":"\u2A2D","lotimes":"\u2A34","lowast":"\u2217","lowbar":"_","LowerLeftArrow":"\u2199","LowerRightArrow":"\u2198","loz":"\u25CA","lozenge":"\u25CA","lozf":"\u29EB","lpar":"(","lparlt":"\u2993","lrarr":"\u21C6","lrcorner":"\u231F","lrhar":"\u21CB","lrhard":"\u296D","lrm":"\u200E","lrtri":"\u22BF","lsaquo":"\u2039","lscr":"\uD835\uDCC1","Lscr":"\u2112","lsh":"\u21B0","Lsh":"\u21B0","lsim":"\u2272","lsime":"\u2A8D","lsimg":"\u2A8F","lsqb":"[","lsquo":"\u2018","lsquor":"\u201A","Lstrok":"\u0141","lstrok":"\u0142","ltcc":"\u2AA6","ltcir":"\u2A79","lt":"<","LT":"<","Lt":"\u226A","ltdot":"\u22D6","lthree":"\u22CB","ltimes":"\u22C9","ltlarr":"\u2976","ltquest":"\u2A7B","ltri":"\u25C3","ltrie":"\u22B4","ltrif":"\u25C2","ltrPar":"\u2996","lurdshar":"\u294A","luruhar":"\u2966","lvertneqq":"\u2268\uFE00","lvnE":"\u2268\uFE00","macr":"\u00AF","male":"\u2642","malt":"\u2720","maltese":"\u2720","Map":"\u2905","map":"\u21A6","mapsto":"\u21A6","mapstodown":"\u21A7","mapstoleft":"\u21A4","mapstoup":"\u21A5","marker":"\u25AE","mcomma":"\u2A29","Mcy":"\u041C","mcy":"\u043C","mdash":"\u2014","mDDot":"\u223A","measuredangle":"\u2221","MediumSpace":"\u205F","Mellintrf":"\u2133","Mfr":"\uD835\uDD10","mfr":"\uD835\uDD2A","mho":"\u2127","micro":"\u00B5","midast":"*","midcir":"\u2AF0","mid":"\u2223","middot":"\u00B7","minusb":"\u229F","minus":"\u2212","minusd":"\u2238","minusdu":"\u2A2A","MinusPlus":"\u2213","mlcp":"\u2ADB","mldr":"\u2026","mnplus":"\u2213","models":"\u22A7","Mopf":"\uD835\uDD44","mopf":"\uD835\uDD5E","mp":"\u2213","mscr":"\uD835\uDCC2","Mscr":"\u2133","mstpos":"\u223E","Mu":"\u039C","mu":"\u03BC","multimap":"\u22B8","mumap":"\u22B8","nabla":"\u2207","Nacute":"\u0143","nacute":"\u0144","nang":"\u2220\u20D2","nap":"\u2249","napE":"\u2A70\u0338","napid":"\u224B\u0338","napos":"\u0149","napprox":"\u2249","natural":"\u266E","naturals":"\u2115","natur":"\u266E","nbsp":"\u00A0","nbump":"\u224E\u0338","nbumpe":"\u224F\u0338","ncap":"\u2A43","Ncaron":"\u0147","ncaron":"\u0148","Ncedil":"\u0145","ncedil":"\u0146","ncong":"\u2247","ncongdot":"\u2A6D\u0338","ncup":"\u2A42","Ncy":"\u041D","ncy":"\u043D","ndash":"\u2013","nearhk":"\u2924","nearr":"\u2197","neArr":"\u21D7","nearrow":"\u2197","ne":"\u2260","nedot":"\u2250\u0338","NegativeMediumSpace":"\u200B","NegativeThickSpace":"\u200B","NegativeThinSpace":"\u200B","NegativeVeryThinSpace":"\u200B","nequiv":"\u2262","nesear":"\u2928","nesim":"\u2242\u0338","NestedGreaterGreater":"\u226B","NestedLessLess":"\u226A","NewLine":"\n","nexist":"\u2204","nexists":"\u2204","Nfr":"\uD835\uDD11","nfr":"\uD835\uDD2B","ngE":"\u2267\u0338","nge":"\u2271","ngeq":"\u2271","ngeqq":"\u2267\u0338","ngeqslant":"\u2A7E\u0338","nges":"\u2A7E\u0338","nGg":"\u22D9\u0338","ngsim":"\u2275","nGt":"\u226B\u20D2","ngt":"\u226F","ngtr":"\u226F","nGtv":"\u226B\u0338","nharr":"\u21AE","nhArr":"\u21CE","nhpar":"\u2AF2","ni":"\u220B","nis":"\u22FC","nisd":"\u22FA","niv":"\u220B","NJcy":"\u040A","njcy":"\u045A","nlarr":"\u219A","nlArr":"\u21CD","nldr":"\u2025","nlE":"\u2266\u0338","nle":"\u2270","nleftarrow":"\u219A","nLeftarrow":"\u21CD","nleftrightarrow":"\u21AE","nLeftrightarrow":"\u21CE","nleq":"\u2270","nleqq":"\u2266\u0338","nleqslant":"\u2A7D\u0338","nles":"\u2A7D\u0338","nless":"\u226E","nLl":"\u22D8\u0338","nlsim":"\u2274","nLt":"\u226A\u20D2","nlt":"\u226E","nltri":"\u22EA","nltrie":"\u22EC","nLtv":"\u226A\u0338","nmid":"\u2224","NoBreak":"\u2060","NonBreakingSpace":"\u00A0","nopf":"\uD835\uDD5F","Nopf":"\u2115","Not":"\u2AEC","not":"\u00AC","NotCongruent":"\u2262","NotCupCap":"\u226D","NotDoubleVerticalBar":"\u2226","NotElement":"\u2209","NotEqual":"\u2260","NotEqualTilde":"\u2242\u0338","NotExists":"\u2204","NotGreater":"\u226F","NotGreaterEqual":"\u2271","NotGreaterFullEqual":"\u2267\u0338","NotGreaterGreater":"\u226B\u0338","NotGreaterLess":"\u2279","NotGreaterSlantEqual":"\u2A7E\u0338","NotGreaterTilde":"\u2275","NotHumpDownHump":"\u224E\u0338","NotHumpEqual":"\u224F\u0338","notin":"\u2209","notindot":"\u22F5\u0338","notinE":"\u22F9\u0338","notinva":"\u2209","notinvb":"\u22F7","notinvc":"\u22F6","NotLeftTriangleBar":"\u29CF\u0338","NotLeftTriangle":"\u22EA","NotLeftTriangleEqual":"\u22EC","NotLess":"\u226E","NotLessEqual":"\u2270","NotLessGreater":"\u2278","NotLessLess":"\u226A\u0338","NotLessSlantEqual":"\u2A7D\u0338","NotLessTilde":"\u2274","NotNestedGreaterGreater":"\u2AA2\u0338","NotNestedLessLess":"\u2AA1\u0338","notni":"\u220C","notniva":"\u220C","notnivb":"\u22FE","notnivc":"\u22FD","NotPrecedes":"\u2280","NotPrecedesEqual":"\u2AAF\u0338","NotPrecedesSlantEqual":"\u22E0","NotReverseElement":"\u220C","NotRightTriangleBar":"\u29D0\u0338","NotRightTriangle":"\u22EB","NotRightTriangleEqual":"\u22ED","NotSquareSubset":"\u228F\u0338","NotSquareSubsetEqual":"\u22E2","NotSquareSuperset":"\u2290\u0338","NotSquareSupersetEqual":"\u22E3","NotSubset":"\u2282\u20D2","NotSubsetEqual":"\u2288","NotSucceeds":"\u2281","NotSucceedsEqual":"\u2AB0\u0338","NotSucceedsSlantEqual":"\u22E1","NotSucceedsTilde":"\u227F\u0338","NotSuperset":"\u2283\u20D2","NotSupersetEqual":"\u2289","NotTilde":"\u2241","NotTildeEqual":"\u2244","NotTildeFullEqual":"\u2247","NotTildeTilde":"\u2249","NotVerticalBar":"\u2224","nparallel":"\u2226","npar":"\u2226","nparsl":"\u2AFD\u20E5","npart":"\u2202\u0338","npolint":"\u2A14","npr":"\u2280","nprcue":"\u22E0","nprec":"\u2280","npreceq":"\u2AAF\u0338","npre":"\u2AAF\u0338","nrarrc":"\u2933\u0338","nrarr":"\u219B","nrArr":"\u21CF","nrarrw":"\u219D\u0338","nrightarrow":"\u219B","nRightarrow":"\u21CF","nrtri":"\u22EB","nrtrie":"\u22ED","nsc":"\u2281","nsccue":"\u22E1","nsce":"\u2AB0\u0338","Nscr":"\uD835\uDCA9","nscr":"\uD835\uDCC3","nshortmid":"\u2224","nshortparallel":"\u2226","nsim":"\u2241","nsime":"\u2244","nsimeq":"\u2244","nsmid":"\u2224","nspar":"\u2226","nsqsube":"\u22E2","nsqsupe":"\u22E3","nsub":"\u2284","nsubE":"\u2AC5\u0338","nsube":"\u2288","nsubset":"\u2282\u20D2","nsubseteq":"\u2288","nsubseteqq":"\u2AC5\u0338","nsucc":"\u2281","nsucceq":"\u2AB0\u0338","nsup":"\u2285","nsupE":"\u2AC6\u0338","nsupe":"\u2289","nsupset":"\u2283\u20D2","nsupseteq":"\u2289","nsupseteqq":"\u2AC6\u0338","ntgl":"\u2279","Ntilde":"\u00D1","ntilde":"\u00F1","ntlg":"\u2278","ntriangleleft":"\u22EA","ntrianglelefteq":"\u22EC","ntriangleright":"\u22EB","ntrianglerighteq":"\u22ED","Nu":"\u039D","nu":"\u03BD","num":"#","numero":"\u2116","numsp":"\u2007","nvap":"\u224D\u20D2","nvdash":"\u22AC","nvDash":"\u22AD","nVdash":"\u22AE","nVDash":"\u22AF","nvge":"\u2265\u20D2","nvgt":">\u20D2","nvHarr":"\u2904","nvinfin":"\u29DE","nvlArr":"\u2902","nvle":"\u2264\u20D2","nvlt":"<\u20D2","nvltrie":"\u22B4\u20D2","nvrArr":"\u2903","nvrtrie":"\u22B5\u20D2","nvsim":"\u223C\u20D2","nwarhk":"\u2923","nwarr":"\u2196","nwArr":"\u21D6","nwarrow":"\u2196","nwnear":"\u2927","Oacute":"\u00D3","oacute":"\u00F3","oast":"\u229B","Ocirc":"\u00D4","ocirc":"\u00F4","ocir":"\u229A","Ocy":"\u041E","ocy":"\u043E","odash":"\u229D","Odblac":"\u0150","odblac":"\u0151","odiv":"\u2A38","odot":"\u2299","odsold":"\u29BC","OElig":"\u0152","oelig":"\u0153","ofcir":"\u29BF","Ofr":"\uD835\uDD12","ofr":"\uD835\uDD2C","ogon":"\u02DB","Ograve":"\u00D2","ograve":"\u00F2","ogt":"\u29C1","ohbar":"\u29B5","ohm":"\u03A9","oint":"\u222E","olarr":"\u21BA","olcir":"\u29BE","olcross":"\u29BB","oline":"\u203E","olt":"\u29C0","Omacr":"\u014C","omacr":"\u014D","Omega":"\u03A9","omega":"\u03C9","Omicron":"\u039F","omicron":"\u03BF","omid":"\u29B6","ominus":"\u2296","Oopf":"\uD835\uDD46","oopf":"\uD835\uDD60","opar":"\u29B7","OpenCurlyDoubleQuote":"\u201C","OpenCurlyQuote":"\u2018","operp":"\u29B9","oplus":"\u2295","orarr":"\u21BB","Or":"\u2A54","or":"\u2228","ord":"\u2A5D","order":"\u2134","orderof":"\u2134","ordf":"\u00AA","ordm":"\u00BA","origof":"\u22B6","oror":"\u2A56","orslope":"\u2A57","orv":"\u2A5B","oS":"\u24C8","Oscr":"\uD835\uDCAA","oscr":"\u2134","Oslash":"\u00D8","oslash":"\u00F8","osol":"\u2298","Otilde":"\u00D5","otilde":"\u00F5","otimesas":"\u2A36","Otimes":"\u2A37","otimes":"\u2297","Ouml":"\u00D6","ouml":"\u00F6","ovbar":"\u233D","OverBar":"\u203E","OverBrace":"\u23DE","OverBracket":"\u23B4","OverParenthesis":"\u23DC","para":"\u00B6","parallel":"\u2225","par":"\u2225","parsim":"\u2AF3","parsl":"\u2AFD","part":"\u2202","PartialD":"\u2202","Pcy":"\u041F","pcy":"\u043F","percnt":"%","period":".","permil":"\u2030","perp":"\u22A5","pertenk":"\u2031","Pfr":"\uD835\uDD13","pfr":"\uD835\uDD2D","Phi":"\u03A6","phi":"\u03C6","phiv":"\u03D5","phmmat":"\u2133","phone":"\u260E","Pi":"\u03A0","pi":"\u03C0","pitchfork":"\u22D4","piv":"\u03D6","planck":"\u210F","planckh":"\u210E","plankv":"\u210F","plusacir":"\u2A23","plusb":"\u229E","pluscir":"\u2A22","plus":"+","plusdo":"\u2214","plusdu":"\u2A25","pluse":"\u2A72","PlusMinus":"\u00B1","plusmn":"\u00B1","plussim":"\u2A26","plustwo":"\u2A27","pm":"\u00B1","Poincareplane":"\u210C","pointint":"\u2A15","popf":"\uD835\uDD61","Popf":"\u2119","pound":"\u00A3","prap":"\u2AB7","Pr":"\u2ABB","pr":"\u227A","prcue":"\u227C","precapprox":"\u2AB7","prec":"\u227A","preccurlyeq":"\u227C","Precedes":"\u227A","PrecedesEqual":"\u2AAF","PrecedesSlantEqual":"\u227C","PrecedesTilde":"\u227E","preceq":"\u2AAF","precnapprox":"\u2AB9","precneqq":"\u2AB5","precnsim":"\u22E8","pre":"\u2AAF","prE":"\u2AB3","precsim":"\u227E","prime":"\u2032","Prime":"\u2033","primes":"\u2119","prnap":"\u2AB9","prnE":"\u2AB5","prnsim":"\u22E8","prod":"\u220F","Product":"\u220F","profalar":"\u232E","profline":"\u2312","profsurf":"\u2313","prop":"\u221D","Proportional":"\u221D","Proportion":"\u2237","propto":"\u221D","prsim":"\u227E","prurel":"\u22B0","Pscr":"\uD835\uDCAB","pscr":"\uD835\uDCC5","Psi":"\u03A8","psi":"\u03C8","puncsp":"\u2008","Qfr":"\uD835\uDD14","qfr":"\uD835\uDD2E","qint":"\u2A0C","qopf":"\uD835\uDD62","Qopf":"\u211A","qprime":"\u2057","Qscr":"\uD835\uDCAC","qscr":"\uD835\uDCC6","quaternions":"\u210D","quatint":"\u2A16","quest":"?","questeq":"\u225F","quot":"\"","QUOT":"\"","rAarr":"\u21DB","race":"\u223D\u0331","Racute":"\u0154","racute":"\u0155","radic":"\u221A","raemptyv":"\u29B3","rang":"\u27E9","Rang":"\u27EB","rangd":"\u2992","range":"\u29A5","rangle":"\u27E9","raquo":"\u00BB","rarrap":"\u2975","rarrb":"\u21E5","rarrbfs":"\u2920","rarrc":"\u2933","rarr":"\u2192","Rarr":"\u21A0","rArr":"\u21D2","rarrfs":"\u291E","rarrhk":"\u21AA","rarrlp":"\u21AC","rarrpl":"\u2945","rarrsim":"\u2974","Rarrtl":"\u2916","rarrtl":"\u21A3","rarrw":"\u219D","ratail":"\u291A","rAtail":"\u291C","ratio":"\u2236","rationals":"\u211A","rbarr":"\u290D","rBarr":"\u290F","RBarr":"\u2910","rbbrk":"\u2773","rbrace":"}","rbrack":"]","rbrke":"\u298C","rbrksld":"\u298E","rbrkslu":"\u2990","Rcaron":"\u0158","rcaron":"\u0159","Rcedil":"\u0156","rcedil":"\u0157","rceil":"\u2309","rcub":"}","Rcy":"\u0420","rcy":"\u0440","rdca":"\u2937","rdldhar":"\u2969","rdquo":"\u201D","rdquor":"\u201D","rdsh":"\u21B3","real":"\u211C","realine":"\u211B","realpart":"\u211C","reals":"\u211D","Re":"\u211C","rect":"\u25AD","reg":"\u00AE","REG":"\u00AE","ReverseElement":"\u220B","ReverseEquilibrium":"\u21CB","ReverseUpEquilibrium":"\u296F","rfisht":"\u297D","rfloor":"\u230B","rfr":"\uD835\uDD2F","Rfr":"\u211C","rHar":"\u2964","rhard":"\u21C1","rharu":"\u21C0","rharul":"\u296C","Rho":"\u03A1","rho":"\u03C1","rhov":"\u03F1","RightAngleBracket":"\u27E9","RightArrowBar":"\u21E5","rightarrow":"\u2192","RightArrow":"\u2192","Rightarrow":"\u21D2","RightArrowLeftArrow":"\u21C4","rightarrowtail":"\u21A3","RightCeiling":"\u2309","RightDoubleBracket":"\u27E7","RightDownTeeVector":"\u295D","RightDownVectorBar":"\u2955","RightDownVector":"\u21C2","RightFloor":"\u230B","rightharpoondown":"\u21C1","rightharpoonup":"\u21C0","rightleftarrows":"\u21C4","rightleftharpoons":"\u21CC","rightrightarrows":"\u21C9","rightsquigarrow":"\u219D","RightTeeArrow":"\u21A6","RightTee":"\u22A2","RightTeeVector":"\u295B","rightthreetimes":"\u22CC","RightTriangleBar":"\u29D0","RightTriangle":"\u22B3","RightTriangleEqual":"\u22B5","RightUpDownVector":"\u294F","RightUpTeeVector":"\u295C","RightUpVectorBar":"\u2954","RightUpVector":"\u21BE","RightVectorBar":"\u2953","RightVector":"\u21C0","ring":"\u02DA","risingdotseq":"\u2253","rlarr":"\u21C4","rlhar":"\u21CC","rlm":"\u200F","rmoustache":"\u23B1","rmoust":"\u23B1","rnmid":"\u2AEE","roang":"\u27ED","roarr":"\u21FE","robrk":"\u27E7","ropar":"\u2986","ropf":"\uD835\uDD63","Ropf":"\u211D","roplus":"\u2A2E","rotimes":"\u2A35","RoundImplies":"\u2970","rpar":")","rpargt":"\u2994","rppolint":"\u2A12","rrarr":"\u21C9","Rrightarrow":"\u21DB","rsaquo":"\u203A","rscr":"\uD835\uDCC7","Rscr":"\u211B","rsh":"\u21B1","Rsh":"\u21B1","rsqb":"]","rsquo":"\u2019","rsquor":"\u2019","rthree":"\u22CC","rtimes":"\u22CA","rtri":"\u25B9","rtrie":"\u22B5","rtrif":"\u25B8","rtriltri":"\u29CE","RuleDelayed":"\u29F4","ruluhar":"\u2968","rx":"\u211E","Sacute":"\u015A","sacute":"\u015B","sbquo":"\u201A","scap":"\u2AB8","Scaron":"\u0160","scaron":"\u0161","Sc":"\u2ABC","sc":"\u227B","sccue":"\u227D","sce":"\u2AB0","scE":"\u2AB4","Scedil":"\u015E","scedil":"\u015F","Scirc":"\u015C","scirc":"\u015D","scnap":"\u2ABA","scnE":"\u2AB6","scnsim":"\u22E9","scpolint":"\u2A13","scsim":"\u227F","Scy":"\u0421","scy":"\u0441","sdotb":"\u22A1","sdot":"\u22C5","sdote":"\u2A66","searhk":"\u2925","searr":"\u2198","seArr":"\u21D8","searrow":"\u2198","sect":"\u00A7","semi":";","seswar":"\u2929","setminus":"\u2216","setmn":"\u2216","sext":"\u2736","Sfr":"\uD835\uDD16","sfr":"\uD835\uDD30","sfrown":"\u2322","sharp":"\u266F","SHCHcy":"\u0429","shchcy":"\u0449","SHcy":"\u0428","shcy":"\u0448","ShortDownArrow":"\u2193","ShortLeftArrow":"\u2190","shortmid":"\u2223","shortparallel":"\u2225","ShortRightArrow":"\u2192","ShortUpArrow":"\u2191","shy":"\u00AD","Sigma":"\u03A3","sigma":"\u03C3","sigmaf":"\u03C2","sigmav":"\u03C2","sim":"\u223C","simdot":"\u2A6A","sime":"\u2243","simeq":"\u2243","simg":"\u2A9E","simgE":"\u2AA0","siml":"\u2A9D","simlE":"\u2A9F","simne":"\u2246","simplus":"\u2A24","simrarr":"\u2972","slarr":"\u2190","SmallCircle":"\u2218","smallsetminus":"\u2216","smashp":"\u2A33","smeparsl":"\u29E4","smid":"\u2223","smile":"\u2323","smt":"\u2AAA","smte":"\u2AAC","smtes":"\u2AAC\uFE00","SOFTcy":"\u042C","softcy":"\u044C","solbar":"\u233F","solb":"\u29C4","sol":"/","Sopf":"\uD835\uDD4A","sopf":"\uD835\uDD64","spades":"\u2660","spadesuit":"\u2660","spar":"\u2225","sqcap":"\u2293","sqcaps":"\u2293\uFE00","sqcup":"\u2294","sqcups":"\u2294\uFE00","Sqrt":"\u221A","sqsub":"\u228F","sqsube":"\u2291","sqsubset":"\u228F","sqsubseteq":"\u2291","sqsup":"\u2290","sqsupe":"\u2292","sqsupset":"\u2290","sqsupseteq":"\u2292","square":"\u25A1","Square":"\u25A1","SquareIntersection":"\u2293","SquareSubset":"\u228F","SquareSubsetEqual":"\u2291","SquareSuperset":"\u2290","SquareSupersetEqual":"\u2292","SquareUnion":"\u2294","squarf":"\u25AA","squ":"\u25A1","squf":"\u25AA","srarr":"\u2192","Sscr":"\uD835\uDCAE","sscr":"\uD835\uDCC8","ssetmn":"\u2216","ssmile":"\u2323","sstarf":"\u22C6","Star":"\u22C6","star":"\u2606","starf":"\u2605","straightepsilon":"\u03F5","straightphi":"\u03D5","strns":"\u00AF","sub":"\u2282","Sub":"\u22D0","subdot":"\u2ABD","subE":"\u2AC5","sube":"\u2286","subedot":"\u2AC3","submult":"\u2AC1","subnE":"\u2ACB","subne":"\u228A","subplus":"\u2ABF","subrarr":"\u2979","subset":"\u2282","Subset":"\u22D0","subseteq":"\u2286","subseteqq":"\u2AC5","SubsetEqual":"\u2286","subsetneq":"\u228A","subsetneqq":"\u2ACB","subsim":"\u2AC7","subsub":"\u2AD5","subsup":"\u2AD3","succapprox":"\u2AB8","succ":"\u227B","succcurlyeq":"\u227D","Succeeds":"\u227B","SucceedsEqual":"\u2AB0","SucceedsSlantEqual":"\u227D","SucceedsTilde":"\u227F","succeq":"\u2AB0","succnapprox":"\u2ABA","succneqq":"\u2AB6","succnsim":"\u22E9","succsim":"\u227F","SuchThat":"\u220B","sum":"\u2211","Sum":"\u2211","sung":"\u266A","sup1":"\u00B9","sup2":"\u00B2","sup3":"\u00B3","sup":"\u2283","Sup":"\u22D1","supdot":"\u2ABE","supdsub":"\u2AD8","supE":"\u2AC6","supe":"\u2287","supedot":"\u2AC4","Superset":"\u2283","SupersetEqual":"\u2287","suphsol":"\u27C9","suphsub":"\u2AD7","suplarr":"\u297B","supmult":"\u2AC2","supnE":"\u2ACC","supne":"\u228B","supplus":"\u2AC0","supset":"\u2283","Supset":"\u22D1","supseteq":"\u2287","supseteqq":"\u2AC6","supsetneq":"\u228B","supsetneqq":"\u2ACC","supsim":"\u2AC8","supsub":"\u2AD4","supsup":"\u2AD6","swarhk":"\u2926","swarr":"\u2199","swArr":"\u21D9","swarrow":"\u2199","swnwar":"\u292A","szlig":"\u00DF","Tab":"\t","target":"\u2316","Tau":"\u03A4","tau":"\u03C4","tbrk":"\u23B4","Tcaron":"\u0164","tcaron":"\u0165","Tcedil":"\u0162","tcedil":"\u0163","Tcy":"\u0422","tcy":"\u0442","tdot":"\u20DB","telrec":"\u2315","Tfr":"\uD835\uDD17","tfr":"\uD835\uDD31","there4":"\u2234","therefore":"\u2234","Therefore":"\u2234","Theta":"\u0398","theta":"\u03B8","thetasym":"\u03D1","thetav":"\u03D1","thickapprox":"\u2248","thicksim":"\u223C","ThickSpace":"\u205F\u200A","ThinSpace":"\u2009","thinsp":"\u2009","thkap":"\u2248","thksim":"\u223C","THORN":"\u00DE","thorn":"\u00FE","tilde":"\u02DC","Tilde":"\u223C","TildeEqual":"\u2243","TildeFullEqual":"\u2245","TildeTilde":"\u2248","timesbar":"\u2A31","timesb":"\u22A0","times":"\u00D7","timesd":"\u2A30","tint":"\u222D","toea":"\u2928","topbot":"\u2336","topcir":"\u2AF1","top":"\u22A4","Topf":"\uD835\uDD4B","topf":"\uD835\uDD65","topfork":"\u2ADA","tosa":"\u2929","tprime":"\u2034","trade":"\u2122","TRADE":"\u2122","triangle":"\u25B5","triangledown":"\u25BF","triangleleft":"\u25C3","trianglelefteq":"\u22B4","triangleq":"\u225C","triangleright":"\u25B9","trianglerighteq":"\u22B5","tridot":"\u25EC","trie":"\u225C","triminus":"\u2A3A","TripleDot":"\u20DB","triplus":"\u2A39","trisb":"\u29CD","tritime":"\u2A3B","trpezium":"\u23E2","Tscr":"\uD835\uDCAF","tscr":"\uD835\uDCC9","TScy":"\u0426","tscy":"\u0446","TSHcy":"\u040B","tshcy":"\u045B","Tstrok":"\u0166","tstrok":"\u0167","twixt":"\u226C","twoheadleftarrow":"\u219E","twoheadrightarrow":"\u21A0","Uacute":"\u00DA","uacute":"\u00FA","uarr":"\u2191","Uarr":"\u219F","uArr":"\u21D1","Uarrocir":"\u2949","Ubrcy":"\u040E","ubrcy":"\u045E","Ubreve":"\u016C","ubreve":"\u016D","Ucirc":"\u00DB","ucirc":"\u00FB","Ucy":"\u0423","ucy":"\u0443","udarr":"\u21C5","Udblac":"\u0170","udblac":"\u0171","udhar":"\u296E","ufisht":"\u297E","Ufr":"\uD835\uDD18","ufr":"\uD835\uDD32","Ugrave":"\u00D9","ugrave":"\u00F9","uHar":"\u2963","uharl":"\u21BF","uharr":"\u21BE","uhblk":"\u2580","ulcorn":"\u231C","ulcorner":"\u231C","ulcrop":"\u230F","ultri":"\u25F8","Umacr":"\u016A","umacr":"\u016B","uml":"\u00A8","UnderBar":"_","UnderBrace":"\u23DF","UnderBracket":"\u23B5","UnderParenthesis":"\u23DD","Union":"\u22C3","UnionPlus":"\u228E","Uogon":"\u0172","uogon":"\u0173","Uopf":"\uD835\uDD4C","uopf":"\uD835\uDD66","UpArrowBar":"\u2912","uparrow":"\u2191","UpArrow":"\u2191","Uparrow":"\u21D1","UpArrowDownArrow":"\u21C5","updownarrow":"\u2195","UpDownArrow":"\u2195","Updownarrow":"\u21D5","UpEquilibrium":"\u296E","upharpoonleft":"\u21BF","upharpoonright":"\u21BE","uplus":"\u228E","UpperLeftArrow":"\u2196","UpperRightArrow":"\u2197","upsi":"\u03C5","Upsi":"\u03D2","upsih":"\u03D2","Upsilon":"\u03A5","upsilon":"\u03C5","UpTeeArrow":"\u21A5","UpTee":"\u22A5","upuparrows":"\u21C8","urcorn":"\u231D","urcorner":"\u231D","urcrop":"\u230E","Uring":"\u016E","uring":"\u016F","urtri":"\u25F9","Uscr":"\uD835\uDCB0","uscr":"\uD835\uDCCA","utdot":"\u22F0","Utilde":"\u0168","utilde":"\u0169","utri":"\u25B5","utrif":"\u25B4","uuarr":"\u21C8","Uuml":"\u00DC","uuml":"\u00FC","uwangle":"\u29A7","vangrt":"\u299C","varepsilon":"\u03F5","varkappa":"\u03F0","varnothing":"\u2205","varphi":"\u03D5","varpi":"\u03D6","varpropto":"\u221D","varr":"\u2195","vArr":"\u21D5","varrho":"\u03F1","varsigma":"\u03C2","varsubsetneq":"\u228A\uFE00","varsubsetneqq":"\u2ACB\uFE00","varsupsetneq":"\u228B\uFE00","varsupsetneqq":"\u2ACC\uFE00","vartheta":"\u03D1","vartriangleleft":"\u22B2","vartriangleright":"\u22B3","vBar":"\u2AE8","Vbar":"\u2AEB","vBarv":"\u2AE9","Vcy":"\u0412","vcy":"\u0432","vdash":"\u22A2","vDash":"\u22A8","Vdash":"\u22A9","VDash":"\u22AB","Vdashl":"\u2AE6","veebar":"\u22BB","vee":"\u2228","Vee":"\u22C1","veeeq":"\u225A","vellip":"\u22EE","verbar":"|","Verbar":"\u2016","vert":"|","Vert":"\u2016","VerticalBar":"\u2223","VerticalLine":"|","VerticalSeparator":"\u2758","VerticalTilde":"\u2240","VeryThinSpace":"\u200A","Vfr":"\uD835\uDD19","vfr":"\uD835\uDD33","vltri":"\u22B2","vnsub":"\u2282\u20D2","vnsup":"\u2283\u20D2","Vopf":"\uD835\uDD4D","vopf":"\uD835\uDD67","vprop":"\u221D","vrtri":"\u22B3","Vscr":"\uD835\uDCB1","vscr":"\uD835\uDCCB","vsubnE":"\u2ACB\uFE00","vsubne":"\u228A\uFE00","vsupnE":"\u2ACC\uFE00","vsupne":"\u228B\uFE00","Vvdash":"\u22AA","vzigzag":"\u299A","Wcirc":"\u0174","wcirc":"\u0175","wedbar":"\u2A5F","wedge":"\u2227","Wedge":"\u22C0","wedgeq":"\u2259","weierp":"\u2118","Wfr":"\uD835\uDD1A","wfr":"\uD835\uDD34","Wopf":"\uD835\uDD4E","wopf":"\uD835\uDD68","wp":"\u2118","wr":"\u2240","wreath":"\u2240","Wscr":"\uD835\uDCB2","wscr":"\uD835\uDCCC","xcap":"\u22C2","xcirc":"\u25EF","xcup":"\u22C3","xdtri":"\u25BD","Xfr":"\uD835\uDD1B","xfr":"\uD835\uDD35","xharr":"\u27F7","xhArr":"\u27FA","Xi":"\u039E","xi":"\u03BE","xlarr":"\u27F5","xlArr":"\u27F8","xmap":"\u27FC","xnis":"\u22FB","xodot":"\u2A00","Xopf":"\uD835\uDD4F","xopf":"\uD835\uDD69","xoplus":"\u2A01","xotime":"\u2A02","xrarr":"\u27F6","xrArr":"\u27F9","Xscr":"\uD835\uDCB3","xscr":"\uD835\uDCCD","xsqcup":"\u2A06","xuplus":"\u2A04","xutri":"\u25B3","xvee":"\u22C1","xwedge":"\u22C0","Yacute":"\u00DD","yacute":"\u00FD","YAcy":"\u042F","yacy":"\u044F","Ycirc":"\u0176","ycirc":"\u0177","Ycy":"\u042B","ycy":"\u044B","yen":"\u00A5","Yfr":"\uD835\uDD1C","yfr":"\uD835\uDD36","YIcy":"\u0407","yicy":"\u0457","Yopf":"\uD835\uDD50","yopf":"\uD835\uDD6A","Yscr":"\uD835\uDCB4","yscr":"\uD835\uDCCE","YUcy":"\u042E","yucy":"\u044E","yuml":"\u00FF","Yuml":"\u0178","Zacute":"\u0179","zacute":"\u017A","Zcaron":"\u017D","zcaron":"\u017E","Zcy":"\u0417","zcy":"\u0437","Zdot":"\u017B","zdot":"\u017C","zeetrf":"\u2128","ZeroWidthSpace":"\u200B","Zeta":"\u0396","zeta":"\u03B6","zfr":"\uD835\uDD37","Zfr":"\u2128","ZHcy":"\u0416","zhcy":"\u0436","zigrarr":"\u21DD","zopf":"\uD835\uDD6B","Zopf":"\u2124","Zscr":"\uD835\uDCB5","zscr":"\uD835\uDCCF","zwj":"\u200D","zwnj":"\u200C"}
\ No newline at end of file
diff --git a/Nodejs/node_modules/entities/maps/legacy.json b/Nodejs/node_modules/entities/maps/legacy.json
new file mode 100644
index 0000000..f0e82a4
--- /dev/null
+++ b/Nodejs/node_modules/entities/maps/legacy.json
@@ -0,0 +1 @@
+{"Aacute":"\u00C1","aacute":"\u00E1","Acirc":"\u00C2","acirc":"\u00E2","acute":"\u00B4","AElig":"\u00C6","aelig":"\u00E6","Agrave":"\u00C0","agrave":"\u00E0","amp":"&","AMP":"&","Aring":"\u00C5","aring":"\u00E5","Atilde":"\u00C3","atilde":"\u00E3","Auml":"\u00C4","auml":"\u00E4","brvbar":"\u00A6","Ccedil":"\u00C7","ccedil":"\u00E7","cedil":"\u00B8","cent":"\u00A2","copy":"\u00A9","COPY":"\u00A9","curren":"\u00A4","deg":"\u00B0","divide":"\u00F7","Eacute":"\u00C9","eacute":"\u00E9","Ecirc":"\u00CA","ecirc":"\u00EA","Egrave":"\u00C8","egrave":"\u00E8","ETH":"\u00D0","eth":"\u00F0","Euml":"\u00CB","euml":"\u00EB","frac12":"\u00BD","frac14":"\u00BC","frac34":"\u00BE","gt":">","GT":">","Iacute":"\u00CD","iacute":"\u00ED","Icirc":"\u00CE","icirc":"\u00EE","iexcl":"\u00A1","Igrave":"\u00CC","igrave":"\u00EC","iquest":"\u00BF","Iuml":"\u00CF","iuml":"\u00EF","laquo":"\u00AB","lt":"<","LT":"<","macr":"\u00AF","micro":"\u00B5","middot":"\u00B7","nbsp":"\u00A0","not":"\u00AC","Ntilde":"\u00D1","ntilde":"\u00F1","Oacute":"\u00D3","oacute":"\u00F3","Ocirc":"\u00D4","ocirc":"\u00F4","Ograve":"\u00D2","ograve":"\u00F2","ordf":"\u00AA","ordm":"\u00BA","Oslash":"\u00D8","oslash":"\u00F8","Otilde":"\u00D5","otilde":"\u00F5","Ouml":"\u00D6","ouml":"\u00F6","para":"\u00B6","plusmn":"\u00B1","pound":"\u00A3","quot":"\"","QUOT":"\"","raquo":"\u00BB","reg":"\u00AE","REG":"\u00AE","sect":"\u00A7","shy":"\u00AD","sup1":"\u00B9","sup2":"\u00B2","sup3":"\u00B3","szlig":"\u00DF","THORN":"\u00DE","thorn":"\u00FE","times":"\u00D7","Uacute":"\u00DA","uacute":"\u00FA","Ucirc":"\u00DB","ucirc":"\u00FB","Ugrave":"\u00D9","ugrave":"\u00F9","uml":"\u00A8","Uuml":"\u00DC","uuml":"\u00FC","Yacute":"\u00DD","yacute":"\u00FD","yen":"\u00A5","yuml":"\u00FF"}
\ No newline at end of file
diff --git a/Nodejs/node_modules/entities/maps/xml.json b/Nodejs/node_modules/entities/maps/xml.json
new file mode 100644
index 0000000..de8db10
--- /dev/null
+++ b/Nodejs/node_modules/entities/maps/xml.json
@@ -0,0 +1 @@
+{"amp":"&","apos":"'","gt":">","lt":"<","quot":"\""}
diff --git a/Nodejs/node_modules/entities/package.json b/Nodejs/node_modules/entities/package.json
new file mode 100644
index 0000000..3817be1
--- /dev/null
+++ b/Nodejs/node_modules/entities/package.json
@@ -0,0 +1,91 @@
+{
+ "_from": "entities@~1.1.1",
+ "_id": "entities@1.1.2",
+ "_inBundle": false,
+ "_integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
+ "_location": "/entities",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "entities@~1.1.1",
+ "name": "entities",
+ "escapedName": "entities",
+ "rawSpec": "~1.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~1.1.1"
+ },
+ "_requiredBy": [
+ "/cheerio",
+ "/dom-serializer",
+ "/htmlparser2"
+ ],
+ "_resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+ "_shasum": "bdfa735299664dfafd34529ed4f8522a275fea56",
+ "_spec": "entities@~1.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/cheerio",
+ "author": {
+ "name": "Felix Boehm",
+ "email": "me@feedic.com"
+ },
+ "bugs": {
+ "url": "https://github.com/fb55/entities/issues"
+ },
+ "bundleDependencies": false,
+ "deprecated": false,
+ "description": "Encode & decode XML/HTML entities with ease",
+ "devDependencies": {
+ "coveralls": "*",
+ "istanbul": "*",
+ "jshint": "2",
+ "mocha": "^5.0.1",
+ "mocha-lcov-reporter": "*"
+ },
+ "directories": {
+ "test": "test"
+ },
+ "homepage": "https://github.com/fb55/entities#readme",
+ "jshintConfig": {
+ "eqeqeq": true,
+ "freeze": true,
+ "latedef": "nofunc",
+ "noarg": true,
+ "nonbsp": true,
+ "quotmark": "double",
+ "undef": true,
+ "unused": true,
+ "trailing": true,
+ "eqnull": true,
+ "proto": true,
+ "smarttabs": true,
+ "node": true,
+ "globals": {
+ "describe": true,
+ "it": true
+ }
+ },
+ "keywords": [
+ "html",
+ "xml",
+ "entity",
+ "decoding",
+ "encoding"
+ ],
+ "license": "BSD-2-Clause",
+ "main": "./index.js",
+ "name": "entities",
+ "prettier": {
+ "tabWidth": 4
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/fb55/entities.git"
+ },
+ "scripts": {
+ "coveralls": "npm run lint && npm run lcov && (cat coverage/lcov.info | coveralls || exit 0)",
+ "lcov": "istanbul cover _mocha --report lcovonly -- -R spec",
+ "lint": "jshint index.js lib/*.js test/*.js",
+ "test": "mocha && npm run lint"
+ },
+ "version": "1.1.2"
+}
diff --git a/Nodejs/node_modules/entities/readme.md b/Nodejs/node_modules/entities/readme.md
new file mode 100644
index 0000000..d1d9eec
--- /dev/null
+++ b/Nodejs/node_modules/entities/readme.md
@@ -0,0 +1,27 @@
+# entities [](https://npmjs.org/package/entities) [](https://npmjs.org/package/entities) [](http://travis-ci.org/fb55/entities) [](https://coveralls.io/r/fb55/entities)
+
+En- & decoder for XML/HTML entities.
+
+## How to…
+
+### …install `entities`
+
+ npm i entities
+
+### …use `entities`
+
+```javascript
+var entities = require("entities");
+//encoding
+entities.encodeXML("&"); // "&"
+entities.encodeHTML("&"); // "&#38;"
+//decoding
+entities.decodeXML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
+entities.decodeHTML("asdf & ÿ ü '"); // "asdf & ÿ ü '"
+```
+
+
+
+---
+
+License: BSD-2-Clause
diff --git a/Nodejs/node_modules/entities/test/mocha.opts b/Nodejs/node_modules/entities/test/mocha.opts
new file mode 100644
index 0000000..af53e24
--- /dev/null
+++ b/Nodejs/node_modules/entities/test/mocha.opts
@@ -0,0 +1,2 @@
+--check-leaks
+--reporter spec
diff --git a/Nodejs/node_modules/entities/test/test.js b/Nodejs/node_modules/entities/test/test.js
new file mode 100644
index 0000000..cb309f3
--- /dev/null
+++ b/Nodejs/node_modules/entities/test/test.js
@@ -0,0 +1,170 @@
+var assert = require("assert"),
+ path = require("path"),
+ entities = require("../");
+
+describe("Encode->decode test", function() {
+ var testcases = [
+ {
+ input: "asdf & ÿ ü '",
+ xml: "asdf & ÿ ü '",
+ html: "asdf & ÿ ü '"
+ },
+ {
+ input: "&",
+ xml: "&",
+ html: "&#38;"
+ }
+ ];
+ testcases.forEach(function(tc) {
+ var encodedXML = entities.encodeXML(tc.input);
+ it("should XML encode " + tc.input, function() {
+ assert.equal(encodedXML, tc.xml);
+ });
+ it("should default to XML encode " + tc.input, function() {
+ assert.equal(entities.encode(tc.input), tc.xml);
+ });
+ it("should XML decode " + encodedXML, function() {
+ assert.equal(entities.decodeXML(encodedXML), tc.input);
+ });
+ it("should default to XML encode " + encodedXML, function() {
+ assert.equal(entities.decode(encodedXML), tc.input);
+ });
+ it("should default strict to XML encode " + encodedXML, function() {
+ assert.equal(entities.decodeStrict(encodedXML), tc.input);
+ });
+
+ var encodedHTML5 = entities.encodeHTML5(tc.input);
+ it("should HTML5 encode " + tc.input, function() {
+ assert.equal(encodedHTML5, tc.html);
+ });
+ it("should HTML5 decode " + encodedHTML5, function() {
+ assert.equal(entities.decodeHTML(encodedHTML5), tc.input);
+ });
+ });
+
+ it("should encode data URIs (issue 16)", function() {
+ var data = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAALAAABAAEAAAIBRAA7";
+ assert.equal(entities.decode(entities.encode(data)), data);
+ });
+});
+
+describe("Decode test", function() {
+ var testcases = [
+ { input: "&", output: "&" },
+ { input: "&", output: "&" },
+ { input: "&", output: "&" },
+ { input: "&", output: "&" },
+ { input: "&", output: "&" },
+ { input: "&", output: "&" },
+ { input: "&", output: "&" },
+ { input: ":", output: ":" },
+ { input: ":", output: ":" },
+ { input: ":", output: ":" },
+ { input: ":", output: ":" }
+ ];
+ testcases.forEach(function(tc) {
+ it("should XML decode " + tc.input, function() {
+ assert.equal(entities.decodeXML(tc.input), tc.output);
+ });
+ it("should HTML4 decode " + tc.input, function() {
+ assert.equal(entities.decodeHTML(tc.input), tc.output);
+ });
+ it("should HTML5 decode " + tc.input, function() {
+ assert.equal(entities.decodeHTML(tc.input), tc.output);
+ });
+ });
+});
+
+var levels = ["xml", "entities"];
+
+describe("Documents", function() {
+ levels
+ .map(function(n) {
+ return path.join("..", "maps", n);
+ })
+ .map(require)
+ .forEach(function(doc, i) {
+ describe("Decode", function() {
+ it(levels[i], function() {
+ Object.keys(doc).forEach(function(e) {
+ for (var l = i; l < levels.length; l++) {
+ assert.equal(entities.decode("&" + e + ";", l), doc[e]);
+ }
+ });
+ });
+ });
+
+ describe("Decode strict", function() {
+ it(levels[i], function() {
+ Object.keys(doc).forEach(function(e) {
+ for (var l = i; l < levels.length; l++) {
+ assert.equal(entities.decodeStrict("&" + e + ";", l), doc[e]);
+ }
+ });
+ });
+ });
+
+ describe("Encode", function() {
+ it(levels[i], function() {
+ Object.keys(doc).forEach(function(e) {
+ for (var l = i; l < levels.length; l++) {
+ assert.equal(entities.decode(entities.encode(doc[e], l), l), doc[e]);
+ }
+ });
+ });
+ });
+ });
+
+ var legacy = require("../maps/legacy.json");
+
+ describe("Legacy", function() {
+ it("should decode", runLegacy);
+ });
+
+ function runLegacy() {
+ Object.keys(legacy).forEach(function(e) {
+ assert.equal(entities.decodeHTML("&" + e), legacy[e]);
+ });
+ }
+});
+
+var astral = {
+ "1D306": "\uD834\uDF06",
+ "1D11E": "\uD834\uDD1E"
+};
+
+var astralSpecial = {
+ "80": "\u20AC",
+ "110000": "\uFFFD"
+};
+
+describe("Astral entities", function() {
+ Object.keys(astral).forEach(function(c) {
+ it("should decode " + astral[c], function() {
+ assert.equal(entities.decode("" + c + ";"), astral[c]);
+ });
+
+ it("should encode " + astral[c], function() {
+ assert.equal(entities.encode(astral[c]), "" + c + ";");
+ });
+
+ it("should escape " + astral[c], function() {
+ assert.equal(entities.escape(astral[c]), "" + c + ";");
+ });
+ });
+
+ Object.keys(astralSpecial).forEach(function(c) {
+ it("special should decode \\u" + c, function() {
+ assert.equal(entities.decode("" + c + ";"), astralSpecial[c]);
+ });
+ });
+});
+
+describe("Escape", function() {
+ it("should always decode ASCII chars", function() {
+ for (var i = 0; i < 0x7f; i++) {
+ var c = String.fromCharCode(i);
+ assert.equal(entities.decodeXML(entities.escape(c)), c);
+ }
+ });
+});
diff --git a/Nodejs/node_modules/es5-ext/.editorconfig b/Nodejs/node_modules/es5-ext/.editorconfig
new file mode 100644
index 0000000..bd6d81e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/.editorconfig
@@ -0,0 +1,16 @@
+# EditorConfig is awesome: http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = tab
+trim_trailing_whitespace = true
+
+[*.md]
+indent_size = 2
+indent_style = space
+trim_trailing_whitespace = false
diff --git a/Nodejs/node_modules/es5-ext/.github/FUNDING.yml b/Nodejs/node_modules/es5-ext/.github/FUNDING.yml
new file mode 100644
index 0000000..71426b0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/.github/FUNDING.yml
@@ -0,0 +1 @@
+tidelift: "npm/es5-ext"
diff --git a/Nodejs/node_modules/es5-ext/CHANGELOG.md b/Nodejs/node_modules/es5-ext/CHANGELOG.md
new file mode 100644
index 0000000..0c5801d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/CHANGELOG.md
@@ -0,0 +1,325 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+### [0.10.53](https://github.com/medikoo/es5-ext/compare/v0.10.52...v0.10.53) (2019-11-21)
+
+### [0.10.52](https://github.com/medikoo/es5-ext/compare/v0.10.51...v0.10.52) (2019-10-29)
+
+### Bug Fixes
+
+- Fix global resolution for Safari ([00731d2](https://github.com/medikoo/es5-ext/commit/00731d2))
+- Keep support for old Node.js versions ([2fa2a11](https://github.com/medikoo/es5-ext/commit/2fa2a11))
+
+### [0.10.51](https://github.com/medikoo/es5-ext/compare/v0.10.50...v0.10.51) (2019-08-30)
+
+### Bug Fixes
+
+- Ensure Function.isFunction recognizes async functions ([6f06e66](https://github.com/medikoo/es5-ext/commit/6f06e66))
+
+### Tests
+
+- Fix after prettification changes ([dd6fc3f](https://github.com/medikoo/es5-ext/commit/dd6fc3f))
+
+## [0.10.50](https://github.com/medikoo/es5-ext/compare/v0.10.49...v0.10.50) (2019-04-30)
+
+### Bug Fixes
+
+- maximum time value reference ([708202d](https://github.com/medikoo/es5-ext/commit/708202d))
+
+### Features
+
+- ensure global resolves in strict mode ([c6a19d7](https://github.com/medikoo/es5-ext/commit/c6a19d7)), closes [#86](https://github.com/medikoo/es5-ext/issues/86)
+
+## [0.10.49](https://github.com/medikoo/es5-ext/compare/v0.10.48...v0.10.49) (2019-03-11)
+
+### Features
+
+- allow plain function usage of fn.compose ([2bafef7](https://github.com/medikoo/es5-ext/commit/2bafef7))
+
+## [0.10.48](https://github.com/medikoo/es5-ext/compare/v0.10.47...v0.10.48) (2019-02-22)
+
+### Features
+
+- Object.ensurePlainObject util ([f48fbcf](https://github.com/medikoo/es5-ext/commit/f48fbcf))
+
+
+
+## [0.10.47](https://github.com/medikoo/es5-ext/compare/v0.10.46...v0.10.47) (2019-01-16)
+
+### Features
+
+- Promise.prototype.finally shim ([4dadbc7](https://github.com/medikoo/es5-ext/commit/4dadbc7))
+
+
+
+## [0.10.46](https://github.com/medikoo/es5-ext/compare/v0.10.45...v0.10.46) (2018-08-13)
+
+### Bug Fixes
+
+- assign-deep to not modify following arguments ([bf43d57](https://github.com/medikoo/es5-ext/commit/bf43d57))
+
+
+
+## [0.10.45](https://github.com/medikoo/es5-ext/compare/v0.10.44...v0.10.45) (2018-06-01)
+
+### Bug Fixes
+
+- improve error message readbility ([adc91b9](https://github.com/medikoo/es5-ext/commit/adc91b9))
+
+
+
+## [0.10.44](https://github.com/medikoo/es5-ext/compare/v0.10.43...v0.10.44) (2018-05-30)
+
+### Features
+
+- add Object.entries ([51d2f43](https://github.com/medikoo/es5-ext/commit/51d2f43))
+
+
+
+## [0.10.43](https://github.com/medikoo/es5-ext/compare/v0.10.42...v0.10.43) (2018-05-28)
+
+### Features
+
+- improve patch string ([6a25b10](https://github.com/medikoo/es5-ext/commit/6a25b10))
+
+
+
+## [0.10.42](https://github.com/medikoo/es5-ext/compare/v0.10.41...v0.10.42) (2018-03-28)
+
+### Bug Fixes
+
+- Date.isDate to exclude NaN dates ([3b61bc6](https://github.com/medikoo/es5-ext/commit/3b61bc6))
+
+### Features
+
+- improve non-coercible string representation ([20bfb78](https://github.com/medikoo/es5-ext/commit/20bfb78))
+- improve non-stringifiable string representation ([2e4512d](https://github.com/medikoo/es5-ext/commit/2e4512d))
+
+
+
+## [0.10.41](https://github.com/medikoo/es5-ext/compare/v0.10.40...v0.10.41) (2018-03-16)
+
+### Features
+
+- Add function.microtaskDelay method ([66481c0](https://github.com/medikoo/es5-ext/commit/66481c0))
+- Add Object.isThenable ([8d5a45c](https://github.com/medikoo/es5-ext/commit/8d5a45c))
+- Add promise.asCallback method ([dcc1451](https://github.com/medikoo/es5-ext/commit/dcc1451))
+- Object.ensurePlainFunction ([2682be6](https://github.com/medikoo/es5-ext/commit/2682be6))
+
+
+
+## [0.10.40](https://github.com/medikoo/es5-ext/compare/v0.10.39...v0.10.40) (2018-03-09)
+
+### Features
+
+- **math:** decimal round, floor and ceil ([39290c6](https://github.com/medikoo/es5-ext/commit/39290c6))
+- **object:** isInteger and ensureInteger ([a5f7d04](https://github.com/medikoo/es5-ext/commit/a5f7d04))
+
+
+
+## [0.10.39](https://github.com/medikoo/es5-ext/compare/v0.10.38...v0.10.39) (2018-02-16)
+
+### Features
+
+- Promise.lazy ([7a30a78](https://github.com/medikoo/es5-ext/commit/7a30a78))
+
+
+
+## [0.10.38](https://github.com/medikoo/es5-ext/compare/v0.10.37...v0.10.38) (2018-01-16)
+
+### Features
+
+- Object.isNaturalNumber an Object.isNaturalNumberValue ([66a40af](https://github.com/medikoo/es5-ext/commit/66a40af))
+
+
+
+## [0.10.37](https://github.com/medikoo/es5-ext/compare/v0.10.36...v0.10.37) (2017-11-23)
+
+### Features
+
+- String.random util ([7c28739](https://github.com/medikoo/es5-ext/commit/7c28739))
+
+
+
+## [0.10.36](https://github.com/medikoo/es5-ext/compare/v0.10.35...v0.10.36) (2017-11-23)
+
+### Features
+
+- **date:** isTimeValue and ensureTimeValue utils ([7659dc5](https://github.com/medikoo/es5-ext/commit/7659dc5))
+
+
+
+## [0.10.35](https://github.com/medikoo/es5-ext/compare/v0.10.34...v0.10.35) (2017-10-13)
+
+### Bug Fixes
+
+- **Object.copy:** do not upgrade primitives to objects ([dd4d88f](https://github.com/medikoo/es5-ext/commit/dd4d88f))
+
+
+
+## [0.10.34](https://github.com/medikoo/es5-ext/compare/v0.10.33...v0.10.34) (2017-10-13)
+
+### Features
+
+- **copyDeep:** duplicate only recursive instances ([bba529a](https://github.com/medikoo/es5-ext/commit/bba529a))
+
+
+
+## [0.10.33](https://github.com/medikoo/es5-ext/compare/v0.10.32...v0.10.33) (2017-10-13)
+
+### Bug Fixes
+
+- **Object.assignDeep:** relax input validation ([1baf57d](https://github.com/medikoo/es5-ext/commit/1baf57d))
+
+
+
+## [0.10.32](https://github.com/medikoo/es5-ext/compare/v0.10.31...v0.10.32) (2017-10-13)
+
+### Features
+
+- Object.assignDeep ([2345e0b](https://github.com/medikoo/es5-ext/commit/2345e0b))
+
+
+
+## [0.10.31](https://github.com/medikoo/es5-ext/compare/v0.10.30...v0.10.31) (2017-10-09)
+
+### Features
+
+- Object.isPlainFunction utility ([031be0a](https://github.com/medikoo/es5-ext/commit/031be0a))
+
+
+
+## [0.10.30](https://github.com/medikoo/es5-ext/compare/v0.10.29...v0.10.30) (2017-08-25)
+
+### Bug Fixes
+
+- value stringification for error message ([37bb96b](https://github.com/medikoo/es5-ext/commit/37bb96b))
+
+
+
+## [0.10.29](https://github.com/medikoo/es5-ext/compare/v0.10.28...v0.10.29) (2017-08-18)
+
+### Bug Fixes
+
+- string.repeat after recent regression ([b02fab4](https://github.com/medikoo/es5-ext/commit/b02fab4))
+
+
+
+## [0.10.28](https://github.com/medikoo/es5-ext/compare/v0.10.27...v0.10.28) (2017-08-18)
+
+### Features
+
+- array.isEmpty method ([b0cfbdd](https://github.com/medikoo/es5-ext/commit/b0cfbdd))
+- improve new lines representation ([860fe8b](https://github.com/medikoo/es5-ext/commit/860fe8b))
+- Object.ensureArray util ([595c341](https://github.com/medikoo/es5-ext/commit/595c341))
+- toShortStringRepresentation util ([6842d06](https://github.com/medikoo/es5-ext/commit/6842d06))
+
+
+
+## [0.10.27](https://github.com/medikoo/es5-ext/compare/v0.10.26...v0.10.27) (2017-08-11)
+
+### Bug Fixes
+
+- isNumberValue should not crash on non-coercible values ([0db765e](https://github.com/medikoo/es5-ext/commit/0db765e))
+
+### Features
+
+- add Object.ensureFiniteNumber util ([11c67f5](https://github.com/medikoo/es5-ext/commit/11c67f5))
+- add Object.isFiniteNumber util ([fe5b55a](https://github.com/medikoo/es5-ext/commit/fe5b55a))
+
+
+
+## [0.10.26](https://github.com/medikoo/es5-ext/compare/v0.10.25...v0.10.26) (2017-08-02)
+
+### Bug Fixes
+
+- **general:** ensure optionalChaining in index ([3df879a](https://github.com/medikoo/es5-ext/commit/3df879a))
+
+
+
+## [0.10.25](https://github.com/medikoo/es5-ext/compare/v0.10.24...v0.10.25) (2017-08-02)
+
+### Features
+
+- **general:** optionalChaining utility ([26332b5](https://github.com/medikoo/es5-ext/commit/26332b5))
+
+
+
+## [0.10.24](https://github.com/medikoo/es5-ext/compare/v0.10.23...v0.10.24) (2017-07-10)
+
+### Features
+
+- resolve global with CSP safe method ([d386449](https://github.com/medikoo/es5-ext/commit/d386449))
+
+
+
+## [0.10.23](https://github.com/medikoo/es5-ext/compare/v0.10.22...v0.10.23) (2017-06-05)
+
+### Bug Fixes
+
+- **Error.custom:** allow non-string code ([e8db3a0](https://github.com/medikoo/es5-ext/commit/e8db3a0))
+- **Error.custom:** improve `ext` argument detection ([0edbfbc](https://github.com/medikoo/es5-ext/commit/0edbfbc))
+
+
+
+## [0.10.22](https://github.com/medikoo/es5-ext/compare/v0.10.21...v0.10.22) (2017-05-31)
+
+### Bug Fixes
+
+- ensure proper symbols stringification in early implementations ([ce51900](https://github.com/medikoo/es5-ext/commit/ce51900))
+
+
+
+## [0.10.21](https://github.com/medikoo/es5-ext/compare/v0.10.20...v0.10.21) (2017-05-22)
+
+### Features
+
+- support arrow functions in Function/#/to-tring-tokens.js ([ad3de1e](https://github.com/medikoo/es5-ext/commit/ad3de1e))
+
+
+
+## [0.10.20](https://github.com/medikoo/es5-ext/compare/v0.10.19...v0.10.20) (2017-05-17)
+
+### Features
+
+- if listed copy not only if own property ([d7e7cef](https://github.com/medikoo/es5-ext/commit/d7e7cef))
+- support `ensure` option in Object.copy ([295326f](https://github.com/medikoo/es5-ext/commit/295326f))
+
+
+
+## [0.10.19](https://github.com/medikoo/es5-ext/compare/v0.10.18...v0.10.19) (2017-05-17)
+
+### Features
+
+- support propertyNames option in Object.copy ([5442279](https://github.com/medikoo/es5-ext/commit/5442279))
+
+
+
+## [0.10.18](https://github.com/medikoo/es5-ext/compare/v0.10.17...v0.10.18) (2017-05-15)
+
+### Bug Fixes
+
+- take all changes in safeToString ([3c5cd12](https://github.com/medikoo/es5-ext/commit/3c5cd12))
+
+
+
+## [0.10.17](https://github.com/medikoo/es5-ext/compare/v0.10.16...v0.10.17) (2017-05-15)
+
+### Features
+
+- introduce Object.ensurePromise ([46a2f45](https://github.com/medikoo/es5-ext/commit/46a2f45))
+- introduce Object.isPromise ([27aecc8](https://github.com/medikoo/es5-ext/commit/27aecc8))
+- introduce safeToString ([0cc6a7b](https://github.com/medikoo/es5-ext/commit/0cc6a7b))
+
+
+
+## [0.10.16](https://github.com/medikoo/es5-ext/compare/v0.10.15...v0.10.16) (2017-05-09)
+
+### Features
+
+- add String.prototype.count ([2e53241](https://github.com/medikoo/es5-ext/commit/2e53241))
+
+## Changelog for previous versions
+
+See `CHANGES` file
diff --git a/Nodejs/node_modules/es5-ext/CHANGES b/Nodejs/node_modules/es5-ext/CHANGES
new file mode 100644
index 0000000..bb84bab
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/CHANGES
@@ -0,0 +1,650 @@
+For recent changelog see CHANGELOG.md
+
+-----
+
+v0.10.15 -- 2017.03.20
+* Fix Object.isValue (it was actually isNotValue)
+
+v0.10.14 -- 2017.03.15
+* Object.isValue util
+
+v0.10.13 -- 2017.03.13
+* Introduce JSON.safeStringify
+* Improve message handling in error/custom
+* Fix Array#concat shim
+* Improve Array#flatten algorithm so it's stack trace friendly
+* Make Object.isObject ES3 compatible
+
+v0.10.12 -- 2016.07.01
+* Ensure symbols are copied in Object.mixin
+* Prevent RangeError errors in array#flatten
+* Do not validate invalidate dates in validDate
+
+v0.10.11 -- 2015.12.18
+* Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens)
+
+v0.10.10 -- 2015.12.11
+* Add Object.isNumberValue util
+
+v0.10.9 -- 2015.12.01
+* Add Object.ensureNaturalNumber and Object.ensureNaturalNumberValue
+
+v0.10.8 -- 2015.10.02
+* Add Number.isNatural
+* Add Object.find and Object.findKey
+* Support arrays in Object.copyDeep
+* Fix iteration issue in forEachRight and someRight
+* Fix detection of native sinh
+* Depend on es6-symbol v3
+
+v0.10.7 -- 2015.04.22
+* New utlitities. They're convention differs from v0.10, as they were supposed to land in v1.
+ Still they're non breaking and start the conventions to be used in v1
+ * Object.validateArrayLike
+ * Object.validateArrayLikeObject
+ * Object.validateStringifiable
+ * Object.validateStringifiableValue
+ * Universal utilities for array-like/iterable objects
+ * Iterable.is
+ * Iterable.validate
+ * Iterable.validateObject
+ * Iterable.forEach
+* Fix camelToHyphen resolution, it must be absolutely reversable by hyphenToCamel
+* Fix calculations of large numbers in Math.tanh
+* Fix algorithm of Math.sinh
+* Fix indexes to not use real symbols
+* Fix length of String.fromCodePoint
+* Fix tests of Array#copyWithin
+* Update Travis CI configuration
+
+v0.10.6 -- 2015.02.02
+* Fix handling of infinite values in Math.trunc
+* Fix handling of getters in Object.normalizeOptions
+
+v0.10.5 -- 2015.01.20
+* Add Function#toStringTokens
+* Add Object.serialize and Object.unserialize
+* Add String.randomUniq
+* Fix Strin#camelToHyphen issue with tokens that end with digit
+* Optimise Number.isInteger logic
+* Improve documentation
+* Configure lint scripts
+* Fix spelling of LICENSE
+
+v0.10.4 -- 2014.04.30
+* Assure maximum spec compliance of Array.of and Array.from (thanks @mathiasbynens)
+* Improve documentations
+
+v0.10.3 -- 2014.04.29
+Provide accurate iterators handling:
+* Array.from improvements:
+ * Assure right unicode symbols resolution when processing strings in Array.from
+ * Rely on ES6 symbol shim and use native @@iterator Symbol if provided by environment
+* Add methods:
+ * Array.prototype.entries
+ * Array.prototype.keys
+ * Array.prototype.values
+ * Array.prototype[@@iterator]
+ * String.prototype[@@iterator]
+
+Improve documentation
+
+v0.10.2 -- 2014.04.24
+- Simplify and deprecate `isCallable`. It seems in ES5 based engines there are
+ no callable objects which are `typeof obj !== 'function'`
+- Update Array.from map callback signature (up to latest resolution of TC39)
+- Improve documentation
+
+v0.10.1 -- 2014.04.14
+Bump version for npm
+(Workaround for accidental premature publish & unpublish of v0.10.0 a while ago)
+
+v0.10.0 -- 2014.04.13
+Major update:
+- All methods and function specified for ECMAScript 6 are now introduced as
+ shims accompanied with functions through which (optionally) they can be
+ implementend on native objects
+- Filename convention was changed to shorter and strictly lower case names. e.g.
+ `lib/String/prototype/starts-with` became `string/#/starts-with`
+- Generated functions are guaranteed to have expected length
+- Objects with null prototype (created via `Object.create(null)`) are widely
+ supported (older version have crashed due to implied `obj.hasOwnProperty` and
+ related invocations)
+- Support array subclasses
+- When handling lists do not limit its length to Uint32 range
+- Use newly introduced `Object.eq` for strict equality in place of `Object.is`
+- Iteration of Object have been improved so properties that were hidden or
+ removed after iteration started are not iterated.
+
+Additions:
+- `Array.isPlainArray`
+- `Array.validArray`
+- `Array.prototype.concat` (as updated with ES6)
+- `Array.prototype.copyWithin` (as introduced with ES6)
+- `Array.prototype.fill` (as introduced with ES6)
+- `Array.prototype.filter` (as updated with ES6)
+- `Array.prototype.findIndex` (as introduced with ES6)
+- `Array.prototype.map` (as updated with ES6)
+- `Array.prototype.separate`
+- `Array.prototype.slice` (as updated with ES6)
+- `Array.prototype.splice` (as updated with ES6)
+- `Function.prototype.copy`
+- `Math.acosh` (as introduced with ES6)
+- `Math.atanh` (as introduced with ES6)
+- `Math.cbrt` (as introduced with ES6)
+- `Math.clz32` (as introduced with ES6)
+- `Math.cosh` (as introduced with ES6)
+- `Math.expm1` (as introduced with ES6)
+- `Math.fround` (as introduced with ES6)
+- `Math.hypot` (as introduced with ES6)
+- `Math.imul` (as introduced with ES6)
+- `Math.log2` (as introduced with ES6)
+- `Math.log10` (as introduced with ES6)
+- `Math.log1p` (as introduced with ES6)
+- `Math.sinh` (as introduced with ES6)
+- `Math.tanh` (as introduced with ES6)
+- `Math.trunc` (as introduced with ES6)
+- `Number.EPSILON` (as introduced with ES6)
+- `Number.MIN_SAFE_INTEGER` (as introduced with ES6)
+- `Number.MAX_SAFE_INTEGER` (as introduced with ES6)
+- `Number.isFinite` (as introduced with ES6)
+- `Number.isInteger` (as introduced with ES6)
+- `Number.isSafeInteger` (as introduced with ES6)
+- `Object.create` (with fix for V8 issue which disallows prototype turn of
+ objects derived from null
+- `Object.eq` - Less restrictive version of `Object.is` based on SameValueZero
+ algorithm
+- `Object.firstKey`
+- `Object.keys` (as updated with ES6)
+- `Object.mixinPrototypes`
+- `Object.primitiveSet`
+- `Object.setPrototypeOf` (as introduced with ES6)
+- `Object.validObject`
+- `RegExp.escape`
+- `RegExp.prototype.match` (as introduced with ES6)
+- `RegExp.prototype.replace` (as introduced with ES6)
+- `RegExp.prototype.search` (as introduced with ES6)
+- `RegExp.prototype.split` (as introduced with ES6)
+- `RegExp.prototype.sticky` (as introduced with ES6)
+- `RegExp.prototype.unicode` (as introduced with ES6)
+- `String.fromCodePoint` (as introduced with ES6)
+- `String.raw` (as introduced with ES6)
+- `String.prototype.at`
+- `String.prototype.codePointAt` (as introduced with ES6)
+- `String.prototype.normalize` (as introduced with ES6)
+- `String.prototype.plainReplaceAll`
+
+Removals:
+- `reserved` set
+- `Array.prototype.commonLeft`
+- `Function.insert`
+- `Function.remove`
+- `Function.prototype.silent`
+- `Function.prototype.wrap`
+- `Object.descriptor` Move to external `d` project.
+ See: https://github.com/medikoo/d
+- `Object.diff`
+- `Object.extendDeep`
+- `Object.reduce`
+- `Object.values`
+- `String.prototype.trimCommonLeft`
+
+Renames:
+- `Function.i` into `Function.identity`
+- `Function.k` into `Function.constant`
+- `Number.toInt` into `Number.toInteger`
+- `Number.toUint` into `Number.toPosInteger`
+- `Object.extend` into `Object.assign` (as introduced in ES 6)
+- `Object.extendProperties` into `Object.mixin`, with improved internal
+ handling, so it matches temporarily specified `Object.mixin` for ECMAScript 6
+- `Object.isList` into `Object.isArrayLike`
+- `Object.mapToArray` into `Object.toArray` (with fixed function length)
+- `Object.toPlainObject` into `Object.normalizeOptions` (as this is the real
+ use case where we use this function)
+- `Function.prototype.chain` into `Function.prototype.compose`
+- `Function.prototype.match` into `Function.prototype.spread`
+- `String.prototype.format` into `String.formatMethod`
+
+Improvements & Fixes:
+- Remove workaround for primitive values handling in object iterators
+- `Array.from`: Update so it follows ES 6 spec
+- `Array.prototype.compact`: filters just null and undefined values
+ (not all falsies)
+- `Array.prototype.eIndexOf` and `Array.prototype.eLastIndexOf`: fix position
+ handling, improve internals
+- `Array.prototype.find`: return undefined not null, in case of not found
+ (follow ES 6)
+- `Array.prototype.remove` fix function length
+- `Error.custom`: simplify, Custom class case is addressed by outer
+ `error-create` project -> https://github.com/medikoo/error-create
+- `Error.isError` true only for Error instances (remove detection of host
+ Exception objects)
+- `Number.prototype.pad`: Normalize negative pad
+- `Object.clear`: Handle errors same way as in `Object.assign`
+- `Object.compact`: filters just null and undefined values (not all falsies)
+- `Object.compare`: Take into account NaN values
+- `Object.copy`: Split into `Object.copy` and `Object.copyDeep`
+- `Object.isCopy`: Separate into `Object.isCopy` and `Object.isCopyDeep`, where
+ `isCopyDeep` handles nested plain objects and plain arrays only
+- `String.prototype.endsWith`: Adjust up to ES6 specification
+- `String.prototype.repeat`: Adjust up to ES6 specification and improve algorithm
+- `String.prototype.simpleReplace`: Rename into `String.prototype.plainReplace`
+- `String.prototype.startsWith`: Adjust up to ES6 specification
+- Update lint rules, and adjust code to that
+- Update Travis CI configuration
+- Remove Makefile (it's cross-env utility)
+
+v0.9.2 -- 2013.03.11
+Added:
+* Array.prototype.isCopy
+* Array.prototype.isUniq
+* Error.CustomError
+* Function.validFunction
+* Object.extendDeep
+* Object.descriptor.binder
+* Object.safeTraverse
+* RegExp.validRegExp
+* String.prototype.capitalize
+* String.prototype.simpleReplace
+
+Fixed:
+* Fix Array.prototype.diff for sparse arrays
+* Accept primitive objects as input values in Object iteration methods and
+ Object.clear, Object.count, Object.diff, Object.extend,
+ Object.getPropertyNames, Object.values
+* Pass expected arguments to callbacks of Object.filter, Object.mapKeys,
+ Object.mapToArray, Object.map
+* Improve callable callback support in Object.mapToArray
+
+v0.9.1 -- 2012.09.17
+* Object.reduce - reduce for hash-like collections
+* Accapt any callable object as callback in Object.filter, mapKeys and map
+* Convention cleanup
+
+v0.9.0 -- 2012.09.13
+We're getting to real solid API
+
+Removed:
+* Function#memoize - it's grown up to be external package, to be soon published
+ as 'memoizee'
+* String.guid - it doesn't fit es5-ext (extensions) concept, will be provided as
+ external package
+# Function.arguments - obsolete
+# Function.context - obsolete
+# Function#flip - not readable when used, so it was never used
+# Object.clone - obsolete and confusing
+
+Added:
+* String#camelToHyphen - String format convertion
+
+Renamed:
+* String#dashToCamelCase -> String#hyphenToCamel
+
+Fixes:
+* Object.isObject - Quote names in literals that match reserved keywords
+ (older implementations crashed on that)
+* String#repeat - Do not accept negative values (coerce them to 1)
+
+Improvements:
+* Array#remove - Accepts many arguments, we can now remove many values at once
+* Object iterators (forEach, map, some) - Compare function invoked with scope
+ object bound to this
+* Function#curry - Algorithm cleanup
+* Object.isCopy - Support for all types, not just plain objects
+* Object.isPlainObject - Support for cross-frame objects
+* Do not memoize any of the functions, it shouldn't be decided internally
+* Remove Object.freeze calls in reserved, it's not up to convention
+* Improved documentation
+* Better linting (hard-core approach using both JSLint mod and JSHint)
+* Optional arguments are now documented in funtions signature
+
+v0.8.2 -- 2012.06.22
+Fix errors in Array's intersection and exclusion methods, related to improper
+usage of contains method
+
+v0.8.1 -- 2012.06.13
+Reorganized internal logic of Function.prototype.memoize. So it's more safe now
+and clears cache properly. Additionally preventCache option was provided.
+
+v0.8.0 -- 2012.05.28
+Again, major overhaul. Probably last experimental stuff was trashed, all API
+looks more like standard extensions now.
+
+Changes:
+* Turn all Object.prototype extensions into functions and move them to Object
+namespace. We learned that extending Object.prototype is bad idea in any case.
+* Rename Function.prototype.curry into Function.prototype.partial. This function
+ is really doing partial application while currying is slightly different
+ concept.
+* Convert Function.prototype.ncurry to new implementation of
+ Function.prototype.curry, it now serves real curry concept additionaly it
+ covers use cases for aritize and hold, which were removed.
+* Rename Array's peek to last, and provide support for sparse arrays in it
+* Rename Date's monthDaysCount into daysInMonth
+* Simplify object iterators, now order of iteration can be configured with just
+ compareFn argument (no extra byKeys option)
+* Rename Object.isDuplicate to Object.isCopy
+* Rename Object.isEqual to Object.is which is compatible with future 'is'
+ keyword
+* Function.memoize is now Function.prototype.memoize. Additionally clear cache
+ functionality is added, and access to original arguments object.
+* Rename validation functions: assertNotNull to validValue, assertCallable to
+ validCallable. validValue was moved to Object namespace. On success they now
+ return validated value instead of true, it supports better composition.
+ Additionally created Date.validDate and Error.validError
+* All documentation is now held in README.md not in code files.
+* Move guid to String namespace. All guids now start with numbers.
+* Array.generate: fill argument is now optional
+* Object.toArray is now Array.from (as new ES6 specification draft suggests)
+* All methods that rely on indexOf or lastIndexOf, now rely on egal (Object.is)
+ versions of them (eIndexOf, eLastIndexOf)
+* Turn all get* functions that returned methods into actuall methods (get*
+ functionality can still be achieved with help of Function.prototype.partial).
+ So: Date.getFormat is now Date.prototype.format,
+ Number.getPad is now Number.prototype.pad,
+ String.getFormat is now String.prototype.format,
+ String.getIndent is now String.prototype.indent,
+ String.getPad is now String.prototype.pad
+* Refactored Object.descriptor, it is now just two functions, main one and
+ main.gs, main is for describing values, and gs for describing getters and
+ setters. Configuration is passed with first argument as string e.g. 'ce' for
+ configurable and enumerable. If no configuration string is provided then by
+ default it returns configurable and writable but not enumerable for value or
+ configurable but not enumerable for getter/setter
+* Function.prototype.silent now returns prepared function (it was
+ expected to be fixed for 0.7)
+* Reserved keywords map (reserved) is now array not hash.
+* Object.merge is now Object.extend (while former Object.extend was completely
+ removed) - 'extend' implies that we change object, not creating new one (as
+ 'merge' may imply). Similarily Object.mergeProperties was renamed to
+ Object.extendProperties
+* Position argument support in Array.prototype.contains and
+ String.prototype.contains (so it follows ES6 specification draft)
+* endPosition argument support in String.prototype.endsWith and fromPosition
+ argument support in String.prototype.startsWith (so it follows ES6
+ specification draft)
+* Better and cleaner String.prototype.indent implementation. No default value
+ for indent string argument, optional nest value (defaults to 1), remove
+ nostart argument
+* Correct length values for most methods (so they reflect length of similar
+ methods in standard)
+* Length argument is now optional in number and string pad methods.
+* Improve arguments validation in general, so it adheres to standard conventions
+* Fixed format of package.json
+
+Removed methods and functions:
+* Object.prototype.slice - Object is not ordered collection, so slice doesn't
+ make sense.
+* Function's rcurry, rncurry, s - too cumbersome for JS, not many use cases for
+ that
+* Function.prototype.aritize and Function.prototype.hold - same functionality
+ can be achieved with new Function.prototype.curry
+* Function.prototype.log - provided more generic Function.prototype.wrap for
+ same use case
+* getNextIdGenerator - no use case for that (String.guid should be used if
+ needed)
+* Object.toObject - Can be now acheived with Object(validValue(x))
+* Array.prototype.someValue - no real use case (personally used once and
+ case was already controversial)
+* Date.prototype.duration - moved to external package
+* Number.getAutoincrement - No real use case
+* Object.prototype.extend, Object.prototype.override,
+ Object.prototype.plainCreate, Object.prototype.plainExtend - It was probably
+ too complex, same should be achieved just with Object.create,
+ Object.descriptor and by saving references to super methods in local scope.
+* Object.getCompareBy - Functions should be created individually for each use
+ case
+* Object.get, Object.getSet, Object.set, Object.unset - Not many use cases and
+ same can be easily achieved with simple inline function
+* String.getPrefixWith - Not real use case for something that can be easily
+ achieved with '+' operator
+* Object.isPrimitive - It's just negation of Object.isObject
+* Number.prototype.isLess, Number.prototype.isLessOrEqual - they shouldn't be in
+ Number namespace and should rather be addressed with simple inline functions.
+* Number.prototype.subtract - Should rather be addressed with simple inline
+ function
+
+New methods and functions:
+* Array.prototype.lastIndex - Returns last declared index in array
+* String.prototype.last - last for strings
+* Function.prototype.wrap - Wrap function with other, it allows to specify
+ before and after behavior transform return value or prevent original function
+ from being called.
+* Math.sign - Returns sign of a number (already in ES6 specification draft)
+* Number.toInt - Converts value to integer (already in ES6 specification draft)
+* Number.isNaN - Returns true if value is NaN (already in ES6 specification
+ draft)
+* Number.toUint - Converts value to unsigned integer
+* Number.toUint32 - Converts value to 32bit unsigned integer
+* Array.prototype.eIndexOf, eLastIndexOf - Egal version (that uses Object.is) of
+ standard methods (all methods that were using native indexOf or lastIndexOf
+ now uses eIndexOf and elastIndexOf respectively)
+* Array.of - as it's specified for ES6
+
+Fixes:
+* Fixed binarySearch so it always returns valid list index
+* Object.isList - it failed on lists that are callable (e.g. NodeList in Nitro
+ engine)
+* Object.map now supports third argument for callback
+
+v0.7.1 -- 2012.01.05
+New methods:
+* Array.prototype.firstIndex - returns first valid index of array (for
+ sparse arrays it may not be '0'
+
+Improvements:
+* Array.prototype.first - now returns value for index returned by firstIndex
+* Object.prototype.mapToArray - can be called without callback, then array of
+ key-value pairs is returned
+
+Fixes
+* Array.prototype.forEachRight, object's length read through UInt32 conversion
+
+v0.7.0 -- 2011.12.27
+Major update.
+Stepped back from experimental ideas and introduced more standard approach
+taking example from how ES5 methods and functions are designed. One exceptions
+is that, we don’t refrain from declaring methods for Object.prototype - it’s up
+to developer whether how he decides to use it in his context (as function or as
+method).
+
+In general:
+* Removed any method 'functionalization' and functionalize method itself.
+ es5-ext declares plain methods, which can be configured to work as functions
+ with call.bind(method) - see documentation.
+* Removed separation of Object methods for ES5 (with descriptors) and
+ ES3 (plain) - we're following ES5 idea on that, some methods are intended just
+ for enumerable properties and some are for all properties, all are declared
+ for Object.prototype
+* Removed separation of Array generic (collected in List folder) and not generic
+ methods (collected in Array folder). Now all methods are generic and are in
+ Array/prototype folder. This separation also meant, that methods in Array are
+ usually destructive. We don’t do that separation now, there’s generally no use
+ case for destructive iterators, we should be fine with one version of each
+ method, (same as ES5 is fine with e.g. one, non destructive 'filter' method)
+* Folder structure resembles tree of native ES5 Objects
+* All methods are written with ES5 conventions in mind, it means that most
+ methods are generic and can be run on any object. In more detail:
+ ** Array.prototype and Object.prototype methods can be run on any object (any
+ not null or undefined value),
+ ** Date.prototype methods should be called only on Date instances.
+ ** Function.prototype methods can be called on any callable objects (not
+ necessarily functions)
+ ** Number.prototype & String.prototype methods can be called on any value, in
+ case of Number it it’ll be degraded to number, in case of string it’ll be
+ degraded to string.
+* Travis CI support (only for Node v0.6 branch, as v0.4 has buggy V8 version)
+
+Improvements for existing functions and methods:
+* Function.memoize (was Function.cache) is now fully generic, can operate on any
+ type of arguments and it’s NaN safe (all NaN objects are considered equal)
+* Method properties passed to Object.prototype.extend or
+ Object.prototype.override can aside of _super optionally take prototype object
+ via _proto argument
+* Object iterators: forEach, mapToArray and every can now iterate in specified
+ order
+* pluck, invoke and other functions that return reusable functions or methods
+ have now their results memoized.
+
+New methods:
+* Global: assertNotNull, getNextIdGenerator, guid, isEqual, isPrimitive,
+ toObject
+* Array: generate
+* Array.prototype: binarySearch, clear, contains, diff, exclusion, find, first,
+ forEachRight, group, indexesOf, intersection, remove, someRight, someValue
+* Boolean: isBoolean
+* Date: isDate
+* Function: arguments, context, insert, isArguments, remove
+* Function.prototype: not, silent
+* Number: getAutoincrement, isNumber
+* Number.prototype: isLessOrEqual, isLess, subtract
+* Object: assertCallable, descriptor (functions for clean descriptors),
+ getCompareBy, isCallable, isObject
+* Object.prototype: clone (real clone), compact, count, diff, empty,
+ getPropertyNames, get, keyOf, mapKeys, override, plainCreate, plainExtend,
+ slice, some, unset
+* RegExp: isRegExp
+* String: getPrefixWith, isString
+* String.prototype: caseInsensitiveCompare, contains, isNumeric
+
+Renamed methods:
+* Date.clone -> Date.prototype.copy
+* Date.format -> Date.getFormat
+* Date/day/floor -> Date.prototype.floorDay
+* Date/month/floor -> Date.prototype.floorMonth
+* Date/month/year -> Date.prototype.floorYear
+* Function.cache -> Function.memoize
+* Function.getApplyArg -> Function.prototype.match
+* Function.sequence -> Function.prototype.chain
+* List.findSameStartLength -> Array.prototype.commonLeft
+* Number.pad -> Number.getPad
+* Object/plain/clone -> Object.prototype.copy
+* Object/plain/elevate -> Object.prototype.flatten
+* Object/plain/same -> Object.prototype.isDuplicate
+* Object/plain/setValue -> Object.getSet
+* String.format -> String.getFormat
+* String.indent -> String.getIndent
+* String.pad -> String.getPad
+* String.trimLeftStr -> String.prototype.trimCommonLeft
+* Object.merge -> Object.prototype.mergeProperties
+* Object/plain/pluck -> Object.prototype.get
+* Array.clone is now Array.prototype.copy and can be used also on any array-like
+ objects
+* List.isList -> Object.isList
+* List.toArray -> Object.prototype.toArray
+* String/convert/dashToCamelCase -> String.prototype.dashToCamelCase
+
+Removed methods:
+* Array.compact - removed destructive version (that operated on same array), we
+ have now non destructive version as Array.prototype.compact.
+* Function.applyBind -> use apply.bind directly
+* Function.bindBind -> use bind.bind directly
+* Function.callBind -> use call.bind directly
+* Fuction.clone -> no valid use case
+* Function.dscope -> controversial approach, shouldn’t be considered seriously
+* Function.functionalize -> It was experimental but standards are standards
+* List/sort/length -> It can be easy obtained by Object.getCompareBy(‘length’)
+* List.concat -> Concat’s for array-like’s makes no sense, just convert to array
+ first
+* List.every -> Use Array.prototype.every directly
+* List.filter -> Use Array.prototype.filter directly
+* List.forEach -> User Array.prototype.forEach directly
+* List.isListObject -> No valid use case, do: isList(list) && (typeof list ===
+ 'object’)
+* List.map -> Use Array.prototype.map directly
+* List.reduce -> Use Array.prototype.reduce directly
+* List.shiftSame -> Use Array.prototype.commonLeft and do slice
+* List.slice -> Use Array.prototype.slice directly
+* List.some -> Use Array.prototype.some directly
+* Object.bindMethods -> it was version that considered descriptors, we have now
+ Object.prototype.bindMethods which operates only on enumerable properties
+* Object.every -> version that considered all properties, we have now
+ Object.prototype.every which iterates only enumerables
+* Object.invoke -> no use case
+* Object.mergeDeep -> no use case
+* Object.pluck -> no use case
+* Object.same -> it considered descriptors, now there’s only Object.isDuplicate
+ which compares only enumerable properties
+* Object.sameType -> no use case
+* Object.toDescriptor and Object.toDescriptors -> replaced by much nicer
+ Object.descriptor functions
+* Object/plain/link -> no use case (it was used internally only by
+ Object/plain/merge)
+* Object/plain/setTrue -> now easily configurable by more universal
+ Object.getSet(true)
+* String.trimRightStr -> Eventually String.prototype.trimCommonRight will be
+ added
+
+v0.6.3 -- 2011.12.12
+* Cleared npm warning for misnamed property in package.json
+
+v0.6.2 -- 2011.08.12
+* Calling String.indent without scope (global scope then) now treated as calling
+ it with null scope, it allows more direct invocations when using default nest
+ string: indent().call(str, nest)
+
+v0.6.1 -- 2011.08.08
+* Added TAD test suite to devDependencies, configured test commands.
+ Tests can be run with 'make test' or 'npm test'
+
+v0.6.0 -- 2011.08.07
+New methods:
+* Array: clone, compact (in place)
+* Date: format, duration, clone, monthDaysCount, day.floor, month.floor,
+ year.floor
+* Function: getApplyArg, , ncurry, rncurry, hold, cache, log
+* List: findSameStartLength, shiftSame, peek, isListObject
+* Number: pad
+* Object: sameType, toString, mapToArray, mergeDeep, toDescriptor,
+ toDescriptors, invoke
+* String: startsWith, endsWith, indent, trimLeftStr, trimRightStr, pad, format
+
+Fixed:
+* Object.extend does now prototypal extend as exptected
+* Object.merge now tries to overwrite only configurable properties
+* Function.flip
+
+Improved:
+* Faster List.toArray
+* Better global retrieval
+* Functionalized all Function methods
+* Renamed bindApply and bindCall to applyBind and callBind
+* Removed Function.inherit (as it's unintuitive curry clone)
+* Straightforward logic in Function.k
+* Fixed naming of some tests files (letter case issue)
+* Renamed Function.saturate into Function.lock
+* String.dashToCamelCase digits support
+* Strings now considered as List objects
+* Improved List.compact
+* Concise logic for List.concat
+* Test wit TAD in clean ES5 context
+
+v0.5.1 -- 2011.07.11
+* Function's bindBind, bindCall and bindApply now more versatile
+
+v0.5.0 -- 2011.07.07
+* Removed Object.is and List.apply
+* Renamed Object.plain.is to Object.plain.isPlainObject (keep naming convention
+ consistent)
+* Improved documentation
+
+v0.4.0 -- 2011.07.05
+* Take most functions on Object to Object.plain to keep them away from object
+ descriptors
+* Object functions with ES5 standard in mind (object descriptors)
+
+v0.3.0 -- 2011.06.24
+* New functions
+* Consistent file naming (dash instead of camelCase)
+
+v0.2.1 -- 2011.05.28
+* Renamed Functions.K and Function.S to to lowercase versions (use consistent
+ naming)
+
+v0.2.0 -- 2011.05.28
+* Renamed Array folder to List (as its generic functions for array-like objects)
+* Added Makefile
+* Added various functions
+
+v0.1.0 -- 2011.05.24
+* Initial version
diff --git a/Nodejs/node_modules/es5-ext/LICENSE b/Nodejs/node_modules/es5-ext/LICENSE
new file mode 100644
index 0000000..89a96ea
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/LICENSE
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2011-2019, Mariusz Nowak, @medikoo, medikoo.com
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff --git a/Nodejs/node_modules/es5-ext/README.md b/Nodejs/node_modules/es5-ext/README.md
new file mode 100644
index 0000000..c7f09cd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/README.md
@@ -0,0 +1,1039 @@
+[![Build status][nix-build-image]][nix-build-url]
+[![Windows status][win-build-image]][win-build-url]
+![Transpilation status][transpilation-image]
+[![npm version][npm-image]][npm-url]
+
+# es5-ext
+
+## ECMAScript 5 extensions
+
+### (with respect to ECMAScript 6 standard)
+
+Shims for upcoming ES6 standard and other goodies implemented strictly with ECMAScript conventions in mind.
+
+It's designed to be used in compliant ECMAScript 5 or ECMAScript 6 environments. Older environments are not supported, although most of the features should work with correct ECMAScript 5 shim on board.
+
+When used in ECMAScript 6 environment, native implementation (if valid) takes precedence over shims.
+
+### Installation
+
+ $ npm install es5-ext
+
+To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
+
+### Usage
+
+#### ECMAScript 6 features
+
+You can force ES6 features to be implemented in your environment, e.g. following will assign `from` function to `Array` (only if it's not implemented already).
+
+```javascript
+require("es5-ext/array/from/implement");
+Array.from("foo"); // ['f', 'o', 'o']
+```
+
+You can also access shims directly, without fixing native objects. Following will return native `Array.from` if it's available and fallback to shim if it's not.
+
+```javascript
+var aFrom = require("es5-ext/array/from");
+aFrom("foo"); // ['f', 'o', 'o']
+```
+
+If you want to use shim unconditionally (even if native implementation exists) do:
+
+```javascript
+var aFrom = require("es5-ext/array/from/shim");
+aFrom("foo"); // ['f', 'o', 'o']
+```
+
+##### List of ES6 shims
+
+It's about properties introduced with ES6 and those that have been updated in new spec.
+
+- `Array.from` -> `require('es5-ext/array/from')`
+- `Array.of` -> `require('es5-ext/array/of')`
+- `Array.prototype.concat` -> `require('es5-ext/array/#/concat')`
+- `Array.prototype.copyWithin` -> `require('es5-ext/array/#/copy-within')`
+- `Array.prototype.entries` -> `require('es5-ext/array/#/entries')`
+- `Array.prototype.fill` -> `require('es5-ext/array/#/fill')`
+- `Array.prototype.filter` -> `require('es5-ext/array/#/filter')`
+- `Array.prototype.find` -> `require('es5-ext/array/#/find')`
+- `Array.prototype.findIndex` -> `require('es5-ext/array/#/find-index')`
+- `Array.prototype.keys` -> `require('es5-ext/array/#/keys')`
+- `Array.prototype.map` -> `require('es5-ext/array/#/map')`
+- `Array.prototype.slice` -> `require('es5-ext/array/#/slice')`
+- `Array.prototype.splice` -> `require('es5-ext/array/#/splice')`
+- `Array.prototype.values` -> `require('es5-ext/array/#/values')`
+- `Array.prototype[@@iterator]` -> `require('es5-ext/array/#/@@iterator')`
+- `Math.acosh` -> `require('es5-ext/math/acosh')`
+- `Math.asinh` -> `require('es5-ext/math/asinh')`
+- `Math.atanh` -> `require('es5-ext/math/atanh')`
+- `Math.cbrt` -> `require('es5-ext/math/cbrt')`
+- `Math.clz32` -> `require('es5-ext/math/clz32')`
+- `Math.cosh` -> `require('es5-ext/math/cosh')`
+- `Math.exmp1` -> `require('es5-ext/math/expm1')`
+- `Math.fround` -> `require('es5-ext/math/fround')`
+- `Math.hypot` -> `require('es5-ext/math/hypot')`
+- `Math.imul` -> `require('es5-ext/math/imul')`
+- `Math.log1p` -> `require('es5-ext/math/log1p')`
+- `Math.log2` -> `require('es5-ext/math/log2')`
+- `Math.log10` -> `require('es5-ext/math/log10')`
+- `Math.sign` -> `require('es5-ext/math/sign')`
+- `Math.signh` -> `require('es5-ext/math/signh')`
+- `Math.tanh` -> `require('es5-ext/math/tanh')`
+- `Math.trunc` -> `require('es5-ext/math/trunc')`
+- `Number.EPSILON` -> `require('es5-ext/number/epsilon')`
+- `Number.MAX_SAFE_INTEGER` -> `require('es5-ext/number/max-safe-integer')`
+- `Number.MIN_SAFE_INTEGER` -> `require('es5-ext/number/min-safe-integer')`
+- `Number.isFinite` -> `require('es5-ext/number/is-finite')`
+- `Number.isInteger` -> `require('es5-ext/number/is-integer')`
+- `Number.isNaN` -> `require('es5-ext/number/is-nan')`
+- `Number.isSafeInteger` -> `require('es5-ext/number/is-safe-integer')`
+- `Object.assign` -> `require('es5-ext/object/assign')`
+- `Object.keys` -> `require('es5-ext/object/keys')`
+- `Object.setPrototypeOf` -> `require('es5-ext/object/set-prototype-of')`
+- `Promise.prototype.finally` -> `require('es5-ext/promise/#/finally')`
+- `RegExp.prototype.match` -> `require('es5-ext/reg-exp/#/match')`
+- `RegExp.prototype.replace` -> `require('es5-ext/reg-exp/#/replace')`
+- `RegExp.prototype.search` -> `require('es5-ext/reg-exp/#/search')`
+- `RegExp.prototype.split` -> `require('es5-ext/reg-exp/#/split')`
+- `RegExp.prototype.sticky` -> Implement with `require('es5-ext/reg-exp/#/sticky/implement')`, use as function with `require('es5-ext/reg-exp/#/is-sticky')`
+- `RegExp.prototype.unicode` -> Implement with `require('es5-ext/reg-exp/#/unicode/implement')`, use as function with `require('es5-ext/reg-exp/#/is-unicode')`
+- `String.fromCodePoint` -> `require('es5-ext/string/from-code-point')`
+- `String.raw` -> `require('es5-ext/string/raw')`
+- `String.prototype.codePointAt` -> `require('es5-ext/string/#/code-point-at')`
+- `String.prototype.contains` -> `require('es5-ext/string/#/contains')`
+- `String.prototype.endsWith` -> `require('es5-ext/string/#/ends-with')`
+- `String.prototype.normalize` -> `require('es5-ext/string/#/normalize')`
+- `String.prototype.repeat` -> `require('es5-ext/string/#/repeat')`
+- `String.prototype.startsWith` -> `require('es5-ext/string/#/starts-with')`
+- `String.prototype[@@iterator]` -> `require('es5-ext/string/#/@@iterator')`
+
+#### Non ECMAScript standard features
+
+**es5-ext** provides also other utils, and implements them as if they were proposed for a standard. It mostly offers methods (not functions) which can directly be assigned to native prototypes:
+
+```javascript
+Object.defineProperty(Function.prototype, "partial", {
+ value: require("es5-ext/function/#/partial"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+});
+Object.defineProperty(Array.prototype, "flatten", {
+ value: require("es5-ext/array/#/flatten"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+});
+Object.defineProperty(String.prototype, "capitalize", {
+ value: require("es5-ext/string/#/capitalize"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+});
+```
+
+See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you.
+
+**Important:** Remember to **not** extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine **only** if you're the _owner_ of the global scope, so e.g. in final project you lead development of.
+
+When you're in situation when native extensions are not good idea, then you should use methods indirectly:
+
+```javascript
+var flatten = require("es5-ext/array/#/flatten");
+
+flatten.call([1, [2, [3, 4]]]); // [1, 2, 3, 4]
+```
+
+for better convenience you can turn methods into functions:
+
+```javascript
+var call = Function.prototype.call;
+var flatten = call.bind(require("es5-ext/array/#/flatten"));
+
+flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
+```
+
+You can configure custom toolkit (like [underscorejs](http://underscorejs.org/)), and use it throughout your application
+
+```javascript
+var util = {};
+util.partial = call.bind(require("es5-ext/function/#/partial"));
+util.flatten = call.bind(require("es5-ext/array/#/flatten"));
+util.startsWith = call.bind(require("es5-ext/string/#/starts-with"));
+
+util.flatten([1, [2, [3, 4]]]); // [1, 2, 3, 4]
+```
+
+As with native ones most methods are generic and can be run on any type of object.
+
+## API
+
+### Global extensions
+
+#### global _(es5-ext/global)_
+
+Object that represents global scope
+
+### Array Constructor extensions
+
+#### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from).
+Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned.
+
+#### generate([length[, …fill]]) _(es5-ext/array/generate)_
+
+Generate an array of pre-given _length_ built of repeated arguments.
+
+#### isPlainArray(x) _(es5-ext/array/is-plain-array)_
+
+Returns true if object is plain array (not instance of one of the Array's extensions).
+
+#### of([…items]) _(es5-ext/array/of)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of).
+Create an array from given arguments.
+
+#### toArray(obj) _(es5-ext/array/to-array)_
+
+Returns array representation of `obj`. If `obj` is already an array, `obj` is returned back.
+
+#### validArray(obj) _(es5-ext/array/valid-array)_
+
+Returns `obj` if it's an array, otherwise throws `TypeError`
+
+### Array Prototype extensions
+
+#### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_
+
+In **sorted** list search for index of item for which _compareFn_ returns value closest to _0_.
+It's variant of binary search algorithm
+
+#### arr.clear() _(es5-ext/array/#/clear)_
+
+Clears the array
+
+#### arr.compact() _(es5-ext/array/#/compact)_
+
+Returns a copy of the context with all non-values (`null` or `undefined`) removed.
+
+#### arr.concat() _(es5-ext/array/#/concat)_
+
+[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat).
+ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context.
+
+#### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_
+
+Whether list contains the given value.
+
+#### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin).
+
+#### arr.diff(other) _(es5-ext/array/#/diff)_
+
+Returns the array of elements that are present in context list but not present in other list.
+
+#### arr.eIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-index-of)_
+
+_egal_ version of `indexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
+
+#### arr.eLastIndexOf(searchElement[, fromIndex]) _(es5-ext/array/#/e-last-index-of)_
+
+_egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) logic is used for comparision
+
+#### arr.entries() _(es5-ext/array/#/entries)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries).
+Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value.
+
+#### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_
+
+Returns the array of elements that are found only in one of the lists (either context list or list provided in arguments).
+
+#### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill).
+
+#### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_
+
+[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter).
+ES6's version of `filter`, returns array of same type as the context.
+
+#### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find).
+Return first element for which given function returns true
+
+#### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex).
+Return first index for which given function returns true
+
+#### arr.first() _(es5-ext/array/#/first)_
+
+Returns value for first defined index
+
+#### arr.firstIndex() _(es5-ext/array/#/first-index)_
+
+Returns first declared index of the array
+
+#### arr.flatten() _(es5-ext/array/#/flatten)_
+
+Returns flattened version of the array
+
+#### arr.forEachRight(cb[, thisArg]) _(es5-ext/array/#/for-each-right)_
+
+`forEach` starting from last element
+
+#### arr.group(cb[, thisArg]) _(es5-ext/array/#/group)_
+
+Group list elements by value returned by _cb_ function
+
+#### arr.indexesOf(searchElement[, fromIndex]) _(es5-ext/array/#/indexes-of)_
+
+Returns array of all indexes of given value
+
+#### arr.intersection([…lists]) _(es5-ext/array/#/intersection)_
+
+Computes the array of values that are the intersection of all lists (context list and lists given in arguments)
+
+#### arr.isCopy(other) _(es5-ext/array/#/is-copy)_
+
+Returns true if both context and _other_ lists have same content
+
+#### arr.isUniq() _(es5-ext/array/#/is-uniq)_
+
+Returns true if all values in array are unique
+
+#### arr.keys() _(es5-ext/array/#/keys)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys).
+Returns iterator object, which traverses all array indexes.
+
+#### arr.last() _(es5-ext/array/#/last)_
+
+Returns value of last defined index
+
+#### arr.lastIndex() _(es5-ext/array/#/last)_
+
+Returns last defined index of the array
+
+#### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_
+
+[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map).
+ES6's version of `map`, returns array of same type as the context.
+
+#### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_
+
+Remove values from the array
+
+#### arr.separate(sep) _(es5-ext/array/#/separate)_
+
+Returns array with items separated with `sep` value
+
+#### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_
+
+[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice).
+ES6's version of `slice`, returns array of same type as the context.
+
+#### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_
+
+`some` starting from last element
+
+#### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_
+
+[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice).
+ES6's version of `splice`, returns array of same type as the context.
+
+#### arr.uniq() _(es5-ext/array/#/uniq)_
+
+Returns duplicate-free version of the array
+
+#### arr.values() _(es5-ext/array/#/values)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values).
+Returns iterator object which traverses all array values.
+
+#### arr[@@iterator] _(es5-ext/array/#/@@iterator)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator).
+Returns iterator object which traverses all array values.
+
+### Boolean Constructor extensions
+
+#### isBoolean(x) _(es5-ext/boolean/is-boolean)_
+
+Whether value is boolean
+
+### Date Constructor extensions
+
+#### isDate(x) _(es5-ext/date/is-date)_
+
+Whether value is date instance
+
+#### validDate(x) _(es5-ext/date/valid-date)_
+
+If given object is not date throw TypeError in other case return it.
+
+### Date Prototype extensions
+
+#### date.copy(date) _(es5-ext/date/#/copy)_
+
+Returns a copy of the date object
+
+#### date.daysInMonth() _(es5-ext/date/#/days-in-month)_
+
+Returns number of days of date's month
+
+#### date.floorDay() _(es5-ext/date/#/floor-day)_
+
+Sets the date time to 00:00:00.000
+
+#### date.floorMonth() _(es5-ext/date/#/floor-month)_
+
+Sets date day to 1 and date time to 00:00:00.000
+
+#### date.floorYear() _(es5-ext/date/#/floor-year)_
+
+Sets date month to 0, day to 1 and date time to 00:00:00.000
+
+#### date.format(pattern) _(es5-ext/date/#/format)_
+
+Formats date up to given string. Supported patterns:
+
+- `%Y` - Year with century, 1999, 2003
+- `%y` - Year without century, 99, 03
+- `%m` - Month, 01..12
+- `%d` - Day of the month 01..31
+- `%H` - Hour (24-hour clock), 00..23
+- `%M` - Minute, 00..59
+- `%S` - Second, 00..59
+- `%L` - Milliseconds, 000..999
+
+### Error Constructor extensions
+
+#### custom(message/_, code, ext_/) _(es5-ext/error/custom)_
+
+Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object)
+
+#### isError(x) _(es5-ext/error/is-error)_
+
+Whether value is an error (instance of `Error`).
+
+#### validError(x) _(es5-ext/error/valid-error)_
+
+If given object is not error throw TypeError in other case return it.
+
+### Error Prototype extensions
+
+#### err.throw() _(es5-ext/error/#/throw)_
+
+Throws error
+
+### Function Constructor extensions
+
+Some of the functions were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
+
+#### constant(x) _(es5-ext/function/constant)_
+
+Returns a constant function that returns pregiven argument
+
+_k(x)(y) =def x_
+
+#### identity(x) _(es5-ext/function/identity)_
+
+Identity function. Returns first argument
+
+_i(x) =def x_
+
+#### invoke(name[, …args]) _(es5-ext/function/invoke)_
+
+Returns a function that takes an object as an argument, and applies object's
+_name_ method to arguments.
+_name_ can be name of the method or method itself.
+
+_invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_
+
+#### isArguments(x) _(es5-ext/function/is-arguments)_
+
+Whether value is arguments object
+
+#### isFunction(arg) _(es5-ext/function/is-function)_
+
+Whether value is instance of function
+
+#### noop() _(es5-ext/function/noop)_
+
+No operation function
+
+#### pluck(name) _(es5-ext/function/pluck)_
+
+Returns a function that takes an object, and returns the value of its _name_
+property
+
+_pluck(name)(obj) =def obj[name]_
+
+#### validFunction(arg) _(es5-ext/function/valid-function)_
+
+If given object is not function throw TypeError in other case return it.
+
+### Function Prototype extensions
+
+Some of the methods were inspired by [Functional JavaScript](http://osteele.com/sources/javascript/functional/) project by Olivier Steele
+
+#### fn.compose([…fns]) _(es5-ext/function/#/compose)_
+
+Applies the functions in reverse argument-list order.
+
+_f1.compose(f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_
+
+`compose` can also be used in plain function form as:
+
+_compose(f1, f2, f3, f4)(…args) =def f1(f2(f3(f4(…arg))))_
+
+#### fn.copy() _(es5-ext/function/#/copy)_
+
+Produces copy of given function
+
+#### fn.curry([n]) _(es5-ext/function/#/curry)_
+
+Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function.
+If _n_ is not provided then it defaults to context function length
+
+_f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_
+
+#### fn.lock([…args]) _(es5-ext/function/#/lock)_
+
+Returns a function that applies the underlying function to _args_, and ignores its own arguments.
+
+_f.lock(…args)(…args2) =def f(…args)_
+
+_Named after it's counterpart in Google Closure_
+
+#### fn.not() _(es5-ext/function/#/not)_
+
+Returns a function that returns boolean negation of value returned by underlying function.
+
+_f.not()(…args) =def !f(…args)_
+
+#### fn.partial([…args]) _(es5-ext/function/#/partial)_
+
+Returns a function that when called will behave like context function called with initially passed arguments. If more arguments are suplilied, they are appended to initial args.
+
+_f.partial(…args1)(…args2) =def f(…args1, …args2)_
+
+#### fn.spread() _(es5-ext/function/#/spread)_
+
+Returns a function that applies underlying function with first list argument
+
+_f.match()(args) =def f.apply(null, args)_
+
+#### fn.toStringTokens() _(es5-ext/function/#/to-string-tokens)_
+
+Serializes function into two (arguments and body) string tokens. Result is plain object with `args` and `body` properties.
+
+### Math extensions
+
+#### acosh(x) _(es5-ext/math/acosh)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh).
+
+#### asinh(x) _(es5-ext/math/asinh)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh).
+
+#### atanh(x) _(es5-ext/math/atanh)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh).
+
+#### cbrt(x) _(es5-ext/math/cbrt)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt).
+
+#### clz32(x) _(es5-ext/math/clz32)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32).
+
+#### cosh(x) _(es5-ext/math/cosh)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh).
+
+#### expm1(x) _(es5-ext/math/expm1)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1).
+
+#### fround(x) _(es5-ext/math/fround)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround).
+
+#### hypot([…values]) _(es5-ext/math/hypot)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot).
+
+#### imul(x, y) _(es5-ext/math/imul)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul).
+
+#### log1p(x) _(es5-ext/math/log1p)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p).
+
+#### log2(x) _(es5-ext/math/log2)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2).
+
+#### log10(x) _(es5-ext/math/log10)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10).
+
+#### sign(x) _(es5-ext/math/sign)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign).
+
+#### sinh(x) _(es5-ext/math/sinh)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh).
+
+#### tanh(x) _(es5-ext/math/tanh)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh).
+
+#### trunc(x) _(es5-ext/math/trunc)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc).
+
+### Number Constructor extensions
+
+#### EPSILON _(es5-ext/number/epsilon)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon).
+
+The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16.
+
+#### isFinite(x) _(es5-ext/number/is-finite)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite).
+Whether value is finite. Differs from global isNaN that it doesn't do type coercion.
+
+#### isInteger(x) _(es5-ext/number/is-integer)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger).
+Whether value is integer.
+
+#### isNaN(x) _(es5-ext/number/is-nan)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan).
+Whether value is NaN. Differs from global isNaN that it doesn't do type coercion.
+
+#### isNumber(x) _(es5-ext/number/is-number)_
+
+Whether given value is number
+
+#### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger).
+
+#### MAX*SAFE_INTEGER *(es5-ext/number/max-safe-integer)\_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger).
+The value of Number.MAX_SAFE_INTEGER is 9007199254740991.
+
+#### MIN*SAFE_INTEGER *(es5-ext/number/min-safe-integer)\_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger).
+The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1).
+
+#### toInteger(x) _(es5-ext/number/to-integer)_
+
+Converts value to integer
+
+#### toPosInteger(x) _(es5-ext/number/to-pos-integer)_
+
+Converts value to positive integer. If provided value is less than 0, then 0 is returned
+
+#### toUint32(x) _(es5-ext/number/to-uint32)_
+
+Converts value to unsigned 32 bit integer. This type is used for array lengths.
+See: http://www.2ality.com/2012/02/js-integers.html
+
+### Number Prototype extensions
+
+#### num.pad(length[, precision]) _(es5-ext/number/#/pad)_
+
+Pad given number with zeros. Returns string
+
+### Object Constructor extensions
+
+#### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign).
+Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten.
+
+#### clear(obj) _(es5-ext/object/clear)_
+
+Remove all enumerable own properties of the object
+
+#### compact(obj) _(es5-ext/object/compact)_
+
+Returns copy of the object with all enumerable properties that have no falsy values
+
+#### compare(obj1, obj2) _(es5-ext/object/compare)_
+
+Universal cross-type compare function. To be used for e.g. array sort.
+
+#### copy(obj) _(es5-ext/object/copy)_
+
+Returns copy of the object with all enumerable properties.
+
+#### copyDeep(obj) _(es5-ext/object/copy-deep)_
+
+Returns deep copy of the object with all enumerable properties.
+
+#### count(obj) _(es5-ext/object/count)_
+
+Counts number of enumerable own properties on object
+
+#### create(obj[, properties]) _(es5-ext/object/create)_
+
+`Object.create` alternative that provides workaround for [V8 issue](http://code.google.com/p/v8/issues/detail?id=2804).
+
+When `null` is provided as a prototype, it's substituted with specially prepared object that derives from Object.prototype but has all Object.prototype properties shadowed with undefined.
+
+It's quirky solution that allows us to have plain objects with no truthy properties but with turnable prototype.
+
+Use only for objects that you plan to switch prototypes of and be aware of limitations of this workaround.
+
+#### eq(x, y) _(es5-ext/object/eq)_
+
+Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
+
+#### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_
+
+Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function.
+Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
+
+#### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_
+
+Analogous to Array.prototype.filter. Returns new object with properites for which _cb_ function returned truthy value.
+
+#### firstKey(obj) _(es5-ext/object/first-key)_
+
+Returns first enumerable key of the object, as keys are unordered by specification, it can be any key of an object.
+
+#### flatten(obj) _(es5-ext/object/flatten)_
+
+Returns new object, with flatten properties of input object
+
+_flatten({ a: { b: 1 }, c: { d: 1 } }) =def { b: 1, d: 1 }_
+
+#### forEach(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/for-each)_
+
+Analogous to Array.prototype.forEach. Calls a function for each key-value pair found in object
+Optionally _compareFn_ can be provided which assures that properties are iterated in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
+
+#### getPropertyNames() _(es5-ext/object/get-property-names)_
+
+Get all (not just own) property names of the object
+
+#### is(x, y) _(es5-ext/object/is)_
+
+Whether two values are equal, using [_SameValue_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) algorithm.
+
+#### isArrayLike(x) _(es5-ext/object/is-array-like)_
+
+Whether object is array-like object
+
+#### isCopy(x, y) _(es5-ext/object/is-copy)_
+
+Two values are considered a copy of same value when all of their own enumerable properties have same values.
+
+#### isCopyDeep(x, y) _(es5-ext/object/is-copy-deep)_
+
+Deep comparision of objects
+
+#### isEmpty(obj) _(es5-ext/object/is-empty)_
+
+True if object doesn't have any own enumerable property
+
+#### isObject(arg) _(es5-ext/object/is-object)_
+
+Whether value is not primitive
+
+#### isPlainObject(arg) _(es5-ext/object/is-plain-object)_
+
+Whether object is plain object, its protototype should be Object.prototype and it cannot be host object.
+
+#### keyOf(obj, searchValue) _(es5-ext/object/key-of)_
+
+Search object for value
+
+#### keys(obj) _(es5-ext/object/keys)_
+
+[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys).
+ES6's version of `keys`, doesn't throw on primitive input
+
+#### map(obj, cb[, thisArg]) _(es5-ext/object/map)_
+
+Analogous to Array.prototype.map. Creates a new object with properties which values are results of calling a provided function on every key-value pair in this object.
+
+#### mapKeys(obj, cb[, thisArg]) _(es5-ext/object/map-keys)_
+
+Create new object with same values, but remapped keys
+
+#### mixin(target, source) _(es5-ext/object/mixin)_
+
+Extend _target_ by all own properties of other objects. Properties found in both objects will be overwritten (unless they're not configurable and cannot be overwritten).
+_It was for a moment part of ECMAScript 6 draft._
+
+#### mixinPrototypes(target, …source]) _(es5-ext/object/mixin-prototypes)_
+
+Extends _target_, with all source and source's prototype properties.
+Useful as an alternative for `setPrototypeOf` in environments in which it cannot be shimmed (no `__proto__` support).
+
+#### normalizeOptions(options) _(es5-ext/object/normalize-options)_
+
+Normalizes options object into flat plain object.
+
+Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use.
+
+- It never returns input `options` object back (always a copy is created)
+- `options` can be undefined in such case empty plain object is returned.
+- Copies all enumerable properties found down prototype chain.
+
+#### primitiveSet([…names]) _(es5-ext/object/primitive-set)_
+
+Creates `null` prototype based plain object, and sets on it all property names provided in arguments to true.
+
+#### safeTraverse(obj[, …names]) _(es5-ext/object/safe-traverse)_
+
+Safe navigation of object properties. See http://wiki.ecmascript.org/doku.php?id=strawman:existential_operator
+
+#### serialize(value) _(es5-ext/object/serialize)_
+
+Serialize value into string. Differs from [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) that it serializes also dates, functions and regular expresssions.
+
+#### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof).
+If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed.
+
+#### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_
+
+Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided
+testing function.
+Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
+
+#### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_
+
+Creates an array of results of calling a provided function on every key-value pair in this object.
+Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key).
+
+#### unserialize(str) _(es5-ext/object/unserialize)_
+
+Userializes value previously serialized with [serialize](#serializevalue-es5-extobjectserialize)
+
+#### validCallable(x) _(es5-ext/object/valid-callable)_
+
+If given object is not callable throw TypeError in other case return it.
+
+#### validObject(x) _(es5-ext/object/valid-object)_
+
+Throws error if given value is not an object, otherwise it is returned.
+
+#### validValue(x) _(es5-ext/object/valid-value)_
+
+Throws error if given value is `null` or `undefined`, otherwise returns value.
+
+### Promise Prototype extensions
+
+#### promise.finally(onFinally) _(es5-ext/promise/#/finally)_
+
+[_Introduced with ECMAScript 2018_](https://tc39.github.io/ecma262/#sec-promise.prototype.finally).
+
+### RegExp Constructor extensions
+
+#### escape(str) _(es5-ext/reg-exp/escape)_
+
+Escapes string to be used in regular expression
+
+#### isRegExp(x) _(es5-ext/reg-exp/is-reg-exp)_
+
+Whether object is regular expression
+
+#### validRegExp(x) _(es5-ext/reg-exp/valid-reg-exp)_
+
+If object is regular expression it is returned, otherwise TypeError is thrown.
+
+### RegExp Prototype extensions
+
+#### re.isSticky(x) _(es5-ext/reg-exp/#/is-sticky)_
+
+Whether regular expression has `sticky` flag.
+
+It's to be used as counterpart to [regExp.sticky](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.sticky) if it's not implemented.
+
+#### re.isUnicode(x) _(es5-ext/reg-exp/#/is-unicode)_
+
+Whether regular expression has `unicode` flag.
+
+It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode) if it's not implemented.
+
+#### re.match(string) _(es5-ext/reg-exp/#/match)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match).
+
+#### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace).
+
+#### re.search(string) _(es5-ext/reg-exp/#/search)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search).
+
+#### re.split(string) _(es5-ext/reg-exp/#/search)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split).
+
+#### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky).
+It's a getter, so only `implement` and `is-implemented` modules are provided.
+
+#### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode).
+It's a getter, so only `implement` and `is-implemented` modules are provided.
+
+### String Constructor extensions
+
+#### formatMethod(fMap) _(es5-ext/string/format-method)_
+
+Creates format method. It's used e.g. to create `Date.prototype.format` method
+
+#### fromCodePoint([…codePoints]) _(es5-ext/string/from-code-point)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.fromcodepoint)
+
+#### isString(x) _(es5-ext/string/is-string)_
+
+Whether object is string
+
+#### randomUniq() _(es5-ext/string/random-uniq)_
+
+Returns randomly generated id, with guarantee of local uniqueness (no same id will be returned twice)
+
+#### raw(callSite[, …substitutions]) _(es5-ext/string/raw)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.raw)
+
+### String Prototype extensions
+
+#### str.at(pos) _(es5-ext/string/#/at)_
+
+_Proposed for ECMAScript 6/7 standard, but not (yet) in a draft_
+
+Returns a string at given position in Unicode-safe manner.
+Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.at).
+
+#### str.camelToHyphen() _(es5-ext/string/#/camel-to-hyphen)_
+
+Convert camelCase string to hyphen separated, e.g. one-two-three -> oneTwoThree.
+Useful when converting names from js property convention into filename convention.
+
+#### str.capitalize() _(es5-ext/string/#/capitalize)_
+
+Capitalize first character of a string
+
+#### str.caseInsensitiveCompare(str) _(es5-ext/string/#/case-insensitive-compare)_
+
+Case insensitive compare
+
+#### str.codePointAt(pos) _(es5-ext/string/#/code-point-at)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat)
+
+Based on [implementation by Mathias Bynens](https://github.com/mathiasbynens/String.prototype.codePointAt).
+
+#### str.contains(searchString[, position]) _(es5-ext/string/#/contains)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.contains)
+
+Whether string contains given string.
+
+#### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith).
+Whether strings ends with given string
+
+#### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_
+
+Convert hyphen separated string to camelCase, e.g. one-two-three -> oneTwoThree.
+Useful when converting names from filename convention to js property name convention.
+
+#### str.indent(str[, count]) _(es5-ext/string/#/indent)_
+
+Indents each line with provided _str_ (if _count_ given then _str_ is repeated _count_ times).
+
+#### str.last() _(es5-ext/string/#/last)_
+
+Return last character
+
+#### str.normalize([form]) _(es5-ext/string/#/normalize)_
+
+[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize).
+Returns the Unicode Normalization Form of a given string.
+Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js)
+
+#### str.pad(fill[, length]) _(es5-ext/string/#/pad)_
+
+Pad string with _fill_.
+If _length_ si given than _fill_ is reapated _length_ times.
+If _length_ is negative then pad is applied from right.
+
+#### str.repeat(n) _(es5-ext/string/#/repeat)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat).
+Repeat given string _n_ times
+
+#### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_
+
+Simple `replace` version. Doesn't support regular expressions. Replaces just first occurrence of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case).
+
+#### str.plainReplaceAll(search, replace) _(es5-ext/string/#/plain-replace-all)_
+
+Simple `replace` version. Doesn't support regular expressions. Replaces all occurrences of search string. Doesn't support insert patterns, therefore it is safe to replace text with text obtained programmatically (there's no need for additional _\$_ characters escape in such case).
+
+#### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith).
+Whether strings starts with given string
+
+#### str[@@iterator] _(es5-ext/string/#/@@iterator)_
+
+[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator).
+Returns iterator object which traverses all string characters (with respect to unicode symbols)
+
+### Tests
+
+ $ npm test
+
+## Security contact information
+
+To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
+
+## es5-ext for enterprise
+
+Available as part of the Tidelift Subscription
+
+The maintainers of es5-ext and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-es5-ext?utm_source=npm-es5-ext&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
+
+[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/es5-ext/branches/master/shields_badge.svg
+[nix-build-url]: https://semaphoreci.com/medikoo-org/es5-ext
+[win-build-image]: https://ci.appveyor.com/api/projects/status/3jox67ksw3p8hkwh/branch/master?svg=true
+[win-build-url]: https://ci.appveyor.com/project/medikoo/es5-ext
+[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg
+[npm-image]: https://img.shields.io/npm/v/es5-ext.svg
+[npm-url]: https://www.npmjs.com/package/es5-ext
diff --git a/Nodejs/node_modules/es5-ext/array/#/@@iterator/implement.js b/Nodejs/node_modules/es5-ext/array/#/@@iterator/implement.js
new file mode 100644
index 0000000..8073f2b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/@@iterator/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, require("es6-symbol").iterator, {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/@@iterator/index.js b/Nodejs/node_modules/es5-ext/array/#/@@iterator/index.js
new file mode 100644
index 0000000..1d0a389
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/@@iterator/index.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = require("./is-implemented")()
+ ? Array.prototype[require("es6-symbol").iterator]
+ : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/@@iterator/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/@@iterator/is-implemented.js
new file mode 100644
index 0000000..6445c04
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/@@iterator/is-implemented.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function () {
+ var arr = ["foo", 1], iterator, result;
+ if (typeof arr[iteratorSymbol] !== "function") return false;
+ iterator = arr[iteratorSymbol]();
+ if (!iterator) return false;
+ if (typeof iterator.next !== "function") return false;
+ result = iterator.next();
+ if (!result) return false;
+ if (result.value !== "foo") return false;
+ if (result.done !== false) return false;
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/@@iterator/shim.js b/Nodejs/node_modules/es5-ext/array/#/@@iterator/shim.js
new file mode 100644
index 0000000..307b1c0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/@@iterator/shim.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("../values/shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/_compare-by-length.js b/Nodejs/node_modules/es5-ext/array/#/_compare-by-length.js
new file mode 100644
index 0000000..db5a040
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/_compare-by-length.js
@@ -0,0 +1,7 @@
+// Used internally to sort array of lists by length
+
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer");
+
+module.exports = function (arr1, arr2) { return toPosInt(arr1.length) - toPosInt(arr2.length); };
diff --git a/Nodejs/node_modules/es5-ext/array/#/binary-search.js b/Nodejs/node_modules/es5-ext/array/#/binary-search.js
new file mode 100644
index 0000000..bdabe27
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/binary-search.js
@@ -0,0 +1,27 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , callable = require("../../object/valid-callable")
+ , value = require("../../object/valid-value")
+ , floor = Math.floor;
+
+module.exports = function (compareFn) {
+ var length, low, high, middle;
+
+ value(this);
+ callable(compareFn);
+
+ length = toPosInt(this.length);
+ low = 0;
+ high = length - 1;
+
+ while (low <= high) {
+ middle = floor((low + high) / 2);
+ if (compareFn(this[middle]) < 0) high = middle - 1;
+ else low = middle + 1;
+ }
+
+ if (high < 0) return 0;
+ if (high >= length) return length - 1;
+ return high;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/clear.js b/Nodejs/node_modules/es5-ext/array/#/clear.js
new file mode 100644
index 0000000..fd539c9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/clear.js
@@ -0,0 +1,12 @@
+// Inspired by Google Closure:
+// http://closure-library.googlecode.com/svn/docs/
+// closure_goog_array_array.js.html#goog.array.clear
+
+"use strict";
+
+var value = require("../../object/valid-value");
+
+module.exports = function () {
+ value(this).length = 0;
+ return this;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/compact.js b/Nodejs/node_modules/es5-ext/array/#/compact.js
new file mode 100644
index 0000000..462e100
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/compact.js
@@ -0,0 +1,11 @@
+// Inspired by: http://documentcloud.github.com/underscore/#compact
+
+"use strict";
+
+var isValue = require("../../object/is-value");
+
+var filter = Array.prototype.filter;
+
+module.exports = function () {
+ return filter.call(this, function (val) { return isValue(val); });
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/concat/implement.js b/Nodejs/node_modules/es5-ext/array/#/concat/implement.js
new file mode 100644
index 0000000..714a3c1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/concat/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "concat", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/concat/index.js b/Nodejs/node_modules/es5-ext/array/#/concat/index.js
new file mode 100644
index 0000000..deac0ee
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/concat/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.concat : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/concat/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/concat/is-implemented.js
new file mode 100644
index 0000000..ba5a154
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/concat/is-implemented.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var SubArray = require("../../_sub-array-dummy-safe");
+
+module.exports = function () { return new SubArray().concat("foo") instanceof SubArray; };
diff --git a/Nodejs/node_modules/es5-ext/array/#/concat/shim.js b/Nodejs/node_modules/es5-ext/array/#/concat/shim.js
new file mode 100644
index 0000000..7e00f27
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/concat/shim.js
@@ -0,0 +1,44 @@
+"use strict";
+
+var isPlainArray = require("../../is-plain-array")
+ , toPosInt = require("../../../number/to-pos-integer")
+ , isObject = require("../../../object/is-object")
+ , isConcatSpreadable = require("es6-symbol").isConcatSpreadable
+ , isArray = Array.isArray
+ , concat = Array.prototype.concat
+ , forEach = Array.prototype.forEach
+ , isSpreadable;
+
+isSpreadable = function (value) {
+ if (!value) return false;
+ if (!isObject(value)) return false;
+ if (value[isConcatSpreadable] !== undefined) {
+ return Boolean(value[isConcatSpreadable]);
+ }
+ return isArray(value);
+};
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (item/*, …items*/) {
+ var result;
+ if (!this || !isArray(this) || isPlainArray(this)) {
+ return concat.apply(this, arguments);
+ }
+ result = new this.constructor();
+ if (isSpreadable(this)) {
+ forEach.call(this, function (val, i) { result[i] = val; });
+ } else {
+ result[0] = this;
+ }
+ forEach.call(arguments, function (arg) {
+ var base;
+ if (isSpreadable(arg)) {
+ base = result.length;
+ result.length += toPosInt(arg.length);
+ forEach.call(arg, function (val, i) { result[base + i] = val; });
+ return;
+ }
+ result.push(arg);
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/contains.js b/Nodejs/node_modules/es5-ext/array/#/contains.js
new file mode 100644
index 0000000..cde6850
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/contains.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var indexOf = require("./e-index-of");
+
+module.exports = function (searchElement/*, position*/) {
+ return indexOf.call(this, searchElement, arguments[1]) > -1;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/copy-within/implement.js b/Nodejs/node_modules/es5-ext/array/#/copy-within/implement.js
new file mode 100644
index 0000000..4658fcb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/copy-within/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "copyWithin", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/copy-within/index.js b/Nodejs/node_modules/es5-ext/array/#/copy-within/index.js
new file mode 100644
index 0000000..37db0ec
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/copy-within/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.copyWithin : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/copy-within/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/copy-within/is-implemented.js
new file mode 100644
index 0000000..40c499e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/copy-within/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var arr = [1, 2, 3, 4, 5];
+ if (typeof arr.copyWithin !== "function") return false;
+ return String(arr.copyWithin(1, 3)) === "1,4,5,4,5";
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/copy-within/shim.js b/Nodejs/node_modules/es5-ext/array/#/copy-within/shim.js
new file mode 100644
index 0000000..6ed7e44
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/copy-within/shim.js
@@ -0,0 +1,45 @@
+// Taken from: https://github.com/paulmillr/es6-shim/
+
+"use strict";
+
+var toInteger = require("../../../number/to-integer")
+ , toPosInt = require("../../../number/to-pos-integer")
+ , validValue = require("../../../object/valid-value")
+ , objHasOwnProperty = Object.prototype.hasOwnProperty
+ , max = Math.max
+ , min = Math.min;
+
+module.exports = function (target, start/*, end*/) {
+ var arr = validValue(this)
+ , end = arguments[2]
+ , length = toPosInt(arr.length)
+ , to
+ , from
+ , fin
+ , count
+ , direction;
+
+ target = toInteger(target);
+ start = toInteger(start);
+ end = end === undefined ? length : toInteger(end);
+
+ to = target < 0 ? max(length + target, 0) : min(target, length);
+ from = start < 0 ? max(length + start, 0) : min(start, length);
+ fin = end < 0 ? max(length + end, 0) : min(end, length);
+ count = min(fin - from, length - to);
+ direction = 1;
+
+ if (from < to && to < from + count) {
+ direction = -1;
+ from += count - 1;
+ to += count - 1;
+ }
+ while (count > 0) {
+ if (objHasOwnProperty.call(arr, from)) arr[to] = arr[from];
+ else delete arr[from];
+ from += direction;
+ to += direction;
+ count -= 1;
+ }
+ return arr;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/diff.js b/Nodejs/node_modules/es5-ext/array/#/diff.js
new file mode 100644
index 0000000..002e6a3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/diff.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var value = require("../../object/valid-value")
+ , contains = require("./contains")
+ , filter = Array.prototype.filter;
+
+module.exports = function (other) {
+ value(this);
+ value(other);
+ return filter.call(this, function (item) { return !contains.call(other, item); });
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/e-index-of.js b/Nodejs/node_modules/es5-ext/array/#/e-index-of.js
new file mode 100644
index 0000000..e3ed14e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/e-index-of.js
@@ -0,0 +1,28 @@
+"use strict";
+
+var numberIsNaN = require("../../number/is-nan")
+ , toPosInt = require("../../number/to-pos-integer")
+ , value = require("../../object/valid-value")
+ , indexOf = Array.prototype.indexOf
+ , objHasOwnProperty = Object.prototype.hasOwnProperty
+ , abs = Math.abs
+ , floor = Math.floor;
+
+module.exports = function (searchElement/*, fromIndex*/) {
+ var i, length, fromIndex, val;
+ if (!numberIsNaN(searchElement)) return indexOf.apply(this, arguments);
+
+ length = toPosInt(value(this).length);
+ fromIndex = arguments[1];
+ if (isNaN(fromIndex)) fromIndex = 0;
+ else if (fromIndex >= 0) fromIndex = floor(fromIndex);
+ else fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
+
+ for (i = fromIndex; i < length; ++i) {
+ if (objHasOwnProperty.call(this, i)) {
+ val = this[i];
+ if (numberIsNaN(val)) return i; // Jslint: ignore
+ }
+ }
+ return -1;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/e-last-index-of.js b/Nodejs/node_modules/es5-ext/array/#/e-last-index-of.js
new file mode 100644
index 0000000..2f6a38a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/e-last-index-of.js
@@ -0,0 +1,31 @@
+"use strict";
+
+var numberIsNaN = require("../../number/is-nan")
+ , toPosInt = require("../../number/to-pos-integer")
+ , value = require("../../object/valid-value")
+ , lastIndexOf = Array.prototype.lastIndexOf
+ , objHasOwnProperty = Object.prototype.hasOwnProperty
+ , abs = Math.abs
+ , floor = Math.floor;
+
+module.exports = function (searchElement/*, fromIndex*/) {
+ var i, fromIndex, val;
+ if (!numberIsNaN(searchElement)) {
+ // Jslint: ignore
+ return lastIndexOf.apply(this, arguments);
+ }
+
+ value(this);
+ fromIndex = arguments[1];
+ if (isNaN(fromIndex)) fromIndex = toPosInt(this.length) - 1;
+ else if (fromIndex >= 0) fromIndex = floor(fromIndex);
+ else fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
+
+ for (i = fromIndex; i >= 0; --i) {
+ if (objHasOwnProperty.call(this, i)) {
+ val = this[i];
+ if (numberIsNaN(val)) return i; // Jslint: ignore
+ }
+ }
+ return -1;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/entries/implement.js b/Nodejs/node_modules/es5-ext/array/#/entries/implement.js
new file mode 100644
index 0000000..b89ce44
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/entries/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "entries", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/entries/index.js b/Nodejs/node_modules/es5-ext/array/#/entries/index.js
new file mode 100644
index 0000000..e7588f7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/entries/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.entries : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/entries/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/entries/is-implemented.js
new file mode 100644
index 0000000..335f1c2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/entries/is-implemented.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function () {
+ var arr = [1, "foo"], iterator, result;
+ if (typeof arr.entries !== "function") return false;
+ iterator = arr.entries();
+ if (!iterator) return false;
+ if (typeof iterator.next !== "function") return false;
+ result = iterator.next();
+ if (!result || !result.value) return false;
+ if (result.value[0] !== 0) return false;
+ if (result.value[1] !== 1) return false;
+ if (result.done !== false) return false;
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/entries/shim.js b/Nodejs/node_modules/es5-ext/array/#/entries/shim.js
new file mode 100644
index 0000000..f47af86
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/entries/shim.js
@@ -0,0 +1,4 @@
+"use strict";
+
+var ArrayIterator = require("es6-iterator/array");
+module.exports = function () { return new ArrayIterator(this, "key+value"); };
diff --git a/Nodejs/node_modules/es5-ext/array/#/exclusion.js b/Nodejs/node_modules/es5-ext/array/#/exclusion.js
new file mode 100644
index 0000000..4e9e71d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/exclusion.js
@@ -0,0 +1,25 @@
+"use strict";
+
+var value = require("../../object/valid-value")
+ , aFrom = require("../from")
+ , toArray = require("../to-array")
+ , contains = require("./contains")
+ , byLength = require("./_compare-by-length")
+ , filter = Array.prototype.filter
+ , push = Array.prototype.push;
+
+module.exports = function (/* …lists*/) {
+ var lists, seen, result;
+ if (!arguments.length) return aFrom(this);
+ push.apply((lists = [this]), arguments);
+ lists.forEach(value);
+ seen = [];
+ result = [];
+ lists.sort(byLength).forEach(function (list) {
+ result = result
+ .filter(function (item) { return !contains.call(list, item); })
+ .concat(filter.call(list, function (item) { return !contains.call(seen, item); }));
+ push.apply(seen, toArray(list));
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/fill/implement.js b/Nodejs/node_modules/es5-ext/array/#/fill/implement.js
new file mode 100644
index 0000000..0efad16
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/fill/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "fill", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/fill/index.js b/Nodejs/node_modules/es5-ext/array/#/fill/index.js
new file mode 100644
index 0000000..6a66ae1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/fill/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.fill : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/fill/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/fill/is-implemented.js
new file mode 100644
index 0000000..5d6d02e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/fill/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var arr = [1, 2, 3, 4, 5, 6];
+ if (typeof arr.fill !== "function") return false;
+ return String(arr.fill(-1, -3)) === "1,2,3,-1,-1,-1";
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/fill/shim.js b/Nodejs/node_modules/es5-ext/array/#/fill/shim.js
new file mode 100644
index 0000000..2327d35
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/fill/shim.js
@@ -0,0 +1,25 @@
+// Taken from: https://github.com/paulmillr/es6-shim/
+
+"use strict";
+
+var toInteger = require("../../../number/to-integer")
+ , toPosInt = require("../../../number/to-pos-integer")
+ , validValue = require("../../../object/valid-value")
+ , max = Math.max
+ , min = Math.min;
+
+module.exports = function (value/*, start, end*/) {
+ var arr = validValue(this)
+ , start = arguments[1]
+ , end = arguments[2]
+ , length = toPosInt(arr.length)
+ , relativeStart
+ , i;
+
+ start = start === undefined ? 0 : toInteger(start);
+ end = end === undefined ? length : toInteger(end);
+
+ relativeStart = start < 0 ? max(length + start, 0) : min(start, length);
+ for (i = relativeStart; i < length && i < end; ++i) arr[i] = value;
+ return arr;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/filter/implement.js b/Nodejs/node_modules/es5-ext/array/#/filter/implement.js
new file mode 100644
index 0000000..76f4a5e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/filter/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "filter", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/filter/index.js b/Nodejs/node_modules/es5-ext/array/#/filter/index.js
new file mode 100644
index 0000000..9a25c9b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/filter/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.filter : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/filter/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/filter/is-implemented.js
new file mode 100644
index 0000000..6082513
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/filter/is-implemented.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var SubArray = require("../../_sub-array-dummy-safe")
+ , pass = function () { return true; };
+
+module.exports = function () { return new SubArray().filter(pass) instanceof SubArray; };
diff --git a/Nodejs/node_modules/es5-ext/array/#/filter/shim.js b/Nodejs/node_modules/es5-ext/array/#/filter/shim.js
new file mode 100644
index 0000000..d4ca0cd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/filter/shim.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var isPlainArray = require("../../is-plain-array")
+ , callable = require("../../../object/valid-callable")
+ , isArray = Array.isArray
+ , filter = Array.prototype.filter
+ , forEach = Array.prototype.forEach
+ , call = Function.prototype.call;
+
+module.exports = function (callbackFn/*, thisArg*/) {
+ var result, thisArg, i;
+ if (!this || !isArray(this) || isPlainArray(this)) {
+ return filter.apply(this, arguments);
+ }
+ callable(callbackFn);
+ thisArg = arguments[1];
+ result = new this.constructor();
+ i = 0;
+ forEach.call(this, function (val, j, self) {
+ if (call.call(callbackFn, thisArg, val, j, self)) result[i++] = val;
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/find-index/implement.js b/Nodejs/node_modules/es5-ext/array/#/find-index/implement.js
new file mode 100644
index 0000000..4e14e29
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find-index/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "findIndex", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/find-index/index.js b/Nodejs/node_modules/es5-ext/array/#/find-index/index.js
new file mode 100644
index 0000000..5e07d8d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find-index/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.findIndex : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/find-index/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/find-index/is-implemented.js
new file mode 100644
index 0000000..72aa28f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find-index/is-implemented.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var fn = function (value) { return value > 3; };
+
+module.exports = function () {
+ var arr = [1, 2, 3, 4, 5, 6];
+ if (typeof arr.findIndex !== "function") return false;
+ return arr.findIndex(fn) === 3;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/find-index/shim.js b/Nodejs/node_modules/es5-ext/array/#/find-index/shim.js
new file mode 100644
index 0000000..7db9bef
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find-index/shim.js
@@ -0,0 +1,26 @@
+"use strict";
+
+var callable = require("../../../object/valid-callable")
+ , ensureValue = require("../../../object/valid-value")
+ , some = Array.prototype.some
+ , apply = Function.prototype.apply;
+
+module.exports = function (predicate/*, thisArg*/) {
+ var k, self;
+ self = Object(ensureValue(this));
+ callable(predicate);
+
+ return some.call(
+ self,
+ function (value, index) {
+ if (apply.call(predicate, this, arguments)) {
+ k = index;
+ return true;
+ }
+ return false;
+ },
+ arguments[1]
+ )
+ ? k
+ : -1;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/find/implement.js b/Nodejs/node_modules/es5-ext/array/#/find/implement.js
new file mode 100644
index 0000000..66035a5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "find", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/find/index.js b/Nodejs/node_modules/es5-ext/array/#/find/index.js
new file mode 100644
index 0000000..2f9d0d6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.find : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/find/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/find/is-implemented.js
new file mode 100644
index 0000000..8fdacb1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find/is-implemented.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var fn = function (value) { return value > 3; };
+
+module.exports = function () {
+ var arr = [1, 2, 3, 4, 5, 6];
+ if (typeof arr.find !== "function") return false;
+ return arr.find(fn) === 4;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/find/shim.js b/Nodejs/node_modules/es5-ext/array/#/find/shim.js
new file mode 100644
index 0000000..bbb0442
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/find/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var findIndex = require("../find-index/shim");
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (predicate/*, thisArg*/) {
+ var index = findIndex.apply(this, arguments);
+ return index === -1 ? undefined : this[index];
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/first-index.js b/Nodejs/node_modules/es5-ext/array/#/first-index.js
new file mode 100644
index 0000000..19bff54
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/first-index.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , value = require("../../object/valid-value")
+ , objHasOwnProperty = Object.prototype.hasOwnProperty;
+
+module.exports = function () {
+ var i, length;
+ if (!(length = toPosInt(value(this).length))) return null;
+ i = 0;
+ while (!objHasOwnProperty.call(this, i)) {
+ if (++i === length) return null;
+ }
+ return i;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/first.js b/Nodejs/node_modules/es5-ext/array/#/first.js
new file mode 100644
index 0000000..ca76833
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/first.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var firstIndex = require("./first-index");
+
+module.exports = function () {
+ var i;
+ if ((i = firstIndex.call(this)) !== null) return this[i];
+ return undefined;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/flatten.js b/Nodejs/node_modules/es5-ext/array/#/flatten.js
new file mode 100644
index 0000000..4016727
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/flatten.js
@@ -0,0 +1,40 @@
+// Stack grow safe implementation
+
+"use strict";
+
+var ensureValue = require("../../object/valid-value")
+ , isArray = Array.isArray
+ , objHasOwnProperty = Object.prototype.hasOwnProperty;
+
+module.exports = function () {
+ var input = ensureValue(this), index = 0, remaining, remainingIndexes, length, i, result = [];
+ // Jslint: ignore
+ main: while (input) {
+ length = input.length;
+ for (i = index; i < length; ++i) {
+ if (!objHasOwnProperty.call(input, i)) continue;
+ if (isArray(input[i])) {
+ if (i < length - 1) {
+ // eslint-disable-next-line max-depth
+ if (!remaining) {
+ remaining = [];
+ remainingIndexes = [];
+ }
+ remaining.push(input);
+ remainingIndexes.push(i + 1);
+ }
+ input = input[i];
+ index = 0;
+ continue main;
+ }
+ result.push(input[i]);
+ }
+ if (remaining) {
+ input = remaining.pop();
+ index = remainingIndexes.pop();
+ } else {
+ input = null;
+ }
+ }
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/for-each-right.js b/Nodejs/node_modules/es5-ext/array/#/for-each-right.js
new file mode 100644
index 0000000..1c6bccc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/for-each-right.js
@@ -0,0 +1,19 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , callable = require("../../object/valid-callable")
+ , value = require("../../object/valid-value")
+ , objHasOwnProperty = Object.prototype.hasOwnProperty
+ , call = Function.prototype.call;
+
+module.exports = function (cb/*, thisArg*/) {
+ var i, self, thisArg;
+
+ self = Object(value(this));
+ callable(cb);
+ thisArg = arguments[1];
+
+ for (i = toPosInt(self.length) - 1; i >= 0; --i) {
+ if (objHasOwnProperty.call(self, i)) call.call(cb, thisArg, self[i], i, self);
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/group.js b/Nodejs/node_modules/es5-ext/array/#/group.js
new file mode 100644
index 0000000..7f40e8a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/group.js
@@ -0,0 +1,28 @@
+// Inspired by Underscore's groupBy:
+// http://documentcloud.github.com/underscore/#groupBy
+
+"use strict";
+
+var callable = require("../../object/valid-callable")
+ , value = require("../../object/valid-value")
+ , forEach = Array.prototype.forEach
+ , apply = Function.prototype.apply;
+
+module.exports = function (cb/*, thisArg*/) {
+ var result;
+
+ value(this);
+ callable(cb);
+
+ result = Object.create(null);
+ forEach.call(
+ this,
+ function (item) {
+ var key = apply.call(cb, this, arguments);
+ if (!result[key]) result[key] = [];
+ result[key].push(item);
+ },
+ arguments[1]
+ );
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/index.js b/Nodejs/node_modules/es5-ext/array/#/index.js
new file mode 100644
index 0000000..596e83b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/index.js
@@ -0,0 +1,41 @@
+"use strict";
+
+module.exports = {
+ "@@iterator": require("./@@iterator"),
+ "binarySearch": require("./binary-search"),
+ "clear": require("./clear"),
+ "compact": require("./compact"),
+ "concat": require("./concat"),
+ "contains": require("./contains"),
+ "copyWithin": require("./copy-within"),
+ "diff": require("./diff"),
+ "eIndexOf": require("./e-index-of"),
+ "eLastIndexOf": require("./e-last-index-of"),
+ "entries": require("./entries"),
+ "exclusion": require("./exclusion"),
+ "fill": require("./fill"),
+ "filter": require("./filter"),
+ "find": require("./find"),
+ "findIndex": require("./find-index"),
+ "first": require("./first"),
+ "firstIndex": require("./first-index"),
+ "flatten": require("./flatten"),
+ "forEachRight": require("./for-each-right"),
+ "keys": require("./keys"),
+ "group": require("./group"),
+ "indexesOf": require("./indexes-of"),
+ "intersection": require("./intersection"),
+ "isCopy": require("./is-copy"),
+ "isEmpty": require("./is-empty"),
+ "isUniq": require("./is-uniq"),
+ "last": require("./last"),
+ "lastIndex": require("./last-index"),
+ "map": require("./map"),
+ "remove": require("./remove"),
+ "separate": require("./separate"),
+ "slice": require("./slice"),
+ "someRight": require("./some-right"),
+ "splice": require("./splice"),
+ "uniq": require("./uniq"),
+ "values": require("./values")
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/indexes-of.js b/Nodejs/node_modules/es5-ext/array/#/indexes-of.js
new file mode 100644
index 0000000..1b92132
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/indexes-of.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var indexOf = require("./e-index-of");
+
+module.exports = function (value/*, fromIndex*/) {
+ var result = [], i, fromIndex = arguments[1];
+ while ((i = indexOf.call(this, value, fromIndex)) !== -1) {
+ result.push(i);
+ fromIndex = i + 1;
+ }
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/intersection.js b/Nodejs/node_modules/es5-ext/array/#/intersection.js
new file mode 100644
index 0000000..7dca9dc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/intersection.js
@@ -0,0 +1,19 @@
+"use strict";
+
+var value = require("../../object/valid-value")
+ , contains = require("./contains")
+ , byLength = require("./_compare-by-length")
+ , filter = Array.prototype.filter
+ , push = Array.prototype.push
+ , slice = Array.prototype.slice;
+
+module.exports = function (/* …list*/) {
+ var lists;
+ if (!arguments.length) slice.call(this);
+ push.apply((lists = [this]), arguments);
+ lists.forEach(value);
+ lists.sort(byLength);
+ return lists.reduce(function (list1, list2) {
+ return filter.call(list1, function (item) { return contains.call(list2, item); });
+ });
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/is-copy.js b/Nodejs/node_modules/es5-ext/array/#/is-copy.js
new file mode 100644
index 0000000..1413b95
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/is-copy.js
@@ -0,0 +1,21 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , eq = require("../../object/eq")
+ , value = require("../../object/valid-value")
+ , objHasOwnProperty = Object.prototype.hasOwnProperty;
+
+module.exports = function (other) {
+ var i, length;
+ value(this);
+ value(other);
+ length = toPosInt(this.length);
+ if (length !== toPosInt(other.length)) return false;
+ for (i = 0; i < length; ++i) {
+ if (objHasOwnProperty.call(this, i) !== objHasOwnProperty.call(other, i)) {
+ return false;
+ }
+ if (!eq(this[i], other[i])) return false;
+ }
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/is-empty.js b/Nodejs/node_modules/es5-ext/array/#/is-empty.js
new file mode 100644
index 0000000..9b336fe
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/is-empty.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var ensureArray = require("../../object/ensure-array")
+ , firstIndex = require("./first-index");
+
+module.exports = function () { return firstIndex.call(ensureArray(this)) === null; };
diff --git a/Nodejs/node_modules/es5-ext/array/#/is-uniq.js b/Nodejs/node_modules/es5-ext/array/#/is-uniq.js
new file mode 100644
index 0000000..75f7734
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/is-uniq.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var indexOf = require("./e-index-of")
+ , every = Array.prototype.every
+ , isFirst;
+
+isFirst = function (value, index) { return indexOf.call(this, value) === index; };
+
+module.exports = function () { return every.call(this, isFirst, this); };
diff --git a/Nodejs/node_modules/es5-ext/array/#/keys/implement.js b/Nodejs/node_modules/es5-ext/array/#/keys/implement.js
new file mode 100644
index 0000000..101a5e3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/keys/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "keys", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/keys/index.js b/Nodejs/node_modules/es5-ext/array/#/keys/index.js
new file mode 100644
index 0000000..c8753e5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/keys/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.keys : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/keys/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/keys/is-implemented.js
new file mode 100644
index 0000000..70a171f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/keys/is-implemented.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function () {
+ var arr = [1, "foo"], iterator, result;
+ if (typeof arr.keys !== "function") return false;
+ iterator = arr.keys();
+ if (!iterator) return false;
+ if (typeof iterator.next !== "function") return false;
+ result = iterator.next();
+ if (!result) return false;
+ if (result.value !== 0) return false;
+ if (result.done !== false) return false;
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/keys/shim.js b/Nodejs/node_modules/es5-ext/array/#/keys/shim.js
new file mode 100644
index 0000000..8136cdc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/keys/shim.js
@@ -0,0 +1,4 @@
+"use strict";
+
+var ArrayIterator = require("es6-iterator/array");
+module.exports = function () { return new ArrayIterator(this, "key"); };
diff --git a/Nodejs/node_modules/es5-ext/array/#/last-index.js b/Nodejs/node_modules/es5-ext/array/#/last-index.js
new file mode 100644
index 0000000..74aaba4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/last-index.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , value = require("../../object/valid-value")
+ , objHasOwnProperty = Object.prototype.hasOwnProperty;
+
+module.exports = function () {
+ var i, length;
+ if (!(length = toPosInt(value(this).length))) return null;
+ i = length - 1;
+ while (!objHasOwnProperty.call(this, i)) {
+ if (--i === -1) return null;
+ }
+ return i;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/last.js b/Nodejs/node_modules/es5-ext/array/#/last.js
new file mode 100644
index 0000000..38bb359
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/last.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var lastIndex = require("./last-index");
+
+module.exports = function () {
+ var i;
+ if ((i = lastIndex.call(this)) !== null) return this[i];
+ return undefined;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/map/implement.js b/Nodejs/node_modules/es5-ext/array/#/map/implement.js
new file mode 100644
index 0000000..42e0b47
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/map/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "map", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/map/index.js b/Nodejs/node_modules/es5-ext/array/#/map/index.js
new file mode 100644
index 0000000..49e0267
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/map/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.map : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/map/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/map/is-implemented.js
new file mode 100644
index 0000000..f09bd7d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/map/is-implemented.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var identity = require("../../../function/identity")
+ , SubArray = require("../../_sub-array-dummy-safe");
+
+module.exports = function () { return new SubArray().map(identity) instanceof SubArray; };
diff --git a/Nodejs/node_modules/es5-ext/array/#/map/shim.js b/Nodejs/node_modules/es5-ext/array/#/map/shim.js
new file mode 100644
index 0000000..288be93
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/map/shim.js
@@ -0,0 +1,22 @@
+"use strict";
+
+var isPlainArray = require("../../is-plain-array")
+ , callable = require("../../../object/valid-callable")
+ , isArray = Array.isArray
+ , map = Array.prototype.map
+ , forEach = Array.prototype.forEach
+ , call = Function.prototype.call;
+
+module.exports = function (callbackFn/*, thisArg*/) {
+ var result, thisArg;
+ if (!this || !isArray(this) || isPlainArray(this)) {
+ return map.apply(this, arguments);
+ }
+ callable(callbackFn);
+ thisArg = arguments[1];
+ result = new this.constructor(this.length);
+ forEach.call(this, function (val, i, self) {
+ result[i] = call.call(callbackFn, thisArg, val, i, self);
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/remove.js b/Nodejs/node_modules/es5-ext/array/#/remove.js
new file mode 100644
index 0000000..7e12664
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/remove.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var indexOf = require("./e-index-of")
+ , forEach = Array.prototype.forEach
+ , splice = Array.prototype.splice;
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (itemToRemove/*, …item*/) {
+ forEach.call(
+ arguments,
+ function (item) {
+ var index = indexOf.call(this, item);
+ if (index !== -1) splice.call(this, index, 1);
+ },
+ this
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/separate.js b/Nodejs/node_modules/es5-ext/array/#/separate.js
new file mode 100644
index 0000000..248662f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/separate.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var forEach = Array.prototype.forEach;
+
+module.exports = function (sep) {
+ var result = [];
+ forEach.call(this, function (val) { result.push(val, sep); });
+ result.pop();
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/slice/implement.js b/Nodejs/node_modules/es5-ext/array/#/slice/implement.js
new file mode 100644
index 0000000..113d34d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/slice/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "slice", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/slice/index.js b/Nodejs/node_modules/es5-ext/array/#/slice/index.js
new file mode 100644
index 0000000..716b7e0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/slice/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.slice : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/slice/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/slice/is-implemented.js
new file mode 100644
index 0000000..4c83bfa
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/slice/is-implemented.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var SubArray = require("../../_sub-array-dummy-safe");
+
+module.exports = function () { return new SubArray().slice() instanceof SubArray; };
diff --git a/Nodejs/node_modules/es5-ext/array/#/slice/shim.js b/Nodejs/node_modules/es5-ext/array/#/slice/shim.js
new file mode 100644
index 0000000..ff13085
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/slice/shim.js
@@ -0,0 +1,36 @@
+"use strict";
+
+var toInteger = require("../../../number/to-integer")
+ , toPosInt = require("../../../number/to-pos-integer")
+ , isPlainArray = require("../../is-plain-array")
+ , isArray = Array.isArray
+ , slice = Array.prototype.slice
+ , objHasOwnProperty = Object.prototype.hasOwnProperty
+ , max = Math.max;
+
+module.exports = function (start, end) {
+ var length, result, i;
+ if (!this || !isArray(this) || isPlainArray(this)) {
+ return slice.apply(this, arguments);
+ }
+ length = toPosInt(this.length);
+ start = toInteger(start);
+ if (start < 0) start = max(length + start, 0);
+ else if (start > length) start = length;
+ if (end === undefined) {
+ end = length;
+ } else {
+ end = toInteger(end);
+ if (end < 0) end = max(length + end, 0);
+ else if (end > length) end = length;
+ }
+ if (start > end) start = end;
+ result = new this.constructor(end - start);
+ i = 0;
+ while (start !== end) {
+ if (objHasOwnProperty.call(this, start)) result[i] = this[start];
+ ++i;
+ ++start;
+ }
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/some-right.js b/Nodejs/node_modules/es5-ext/array/#/some-right.js
new file mode 100644
index 0000000..3baaf76
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/some-right.js
@@ -0,0 +1,21 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , callable = require("../../object/valid-callable")
+ , value = require("../../object/valid-value")
+ , objHasOwnProperty = Object.prototype.hasOwnProperty
+ , call = Function.prototype.call;
+
+module.exports = function (cb/*, thisArg*/) {
+ var i, self, thisArg;
+ self = Object(value(this));
+ callable(cb);
+ thisArg = arguments[1];
+
+ for (i = toPosInt(self.length) - 1; i >= 0; --i) {
+ if (objHasOwnProperty.call(self, i) && call.call(cb, thisArg, self[i], i, self)) {
+ return true;
+ }
+ }
+ return false;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/splice/implement.js b/Nodejs/node_modules/es5-ext/array/#/splice/implement.js
new file mode 100644
index 0000000..236b1cb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/splice/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "splice", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/splice/index.js b/Nodejs/node_modules/es5-ext/array/#/splice/index.js
new file mode 100644
index 0000000..cd5c3ec
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/splice/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.splice : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/splice/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/splice/is-implemented.js
new file mode 100644
index 0000000..085cba5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/splice/is-implemented.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var SubArray = require("../../_sub-array-dummy-safe");
+
+module.exports = function () { return new SubArray().splice(0) instanceof SubArray; };
diff --git a/Nodejs/node_modules/es5-ext/array/#/splice/shim.js b/Nodejs/node_modules/es5-ext/array/#/splice/shim.js
new file mode 100644
index 0000000..a9c53ea
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/splice/shim.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var isPlainArray = require("../../is-plain-array")
+ , isArray = Array.isArray
+ , splice = Array.prototype.splice
+ , forEach = Array.prototype.forEach;
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (start, deleteCount/*, …items*/) {
+ var arr = splice.apply(this, arguments), result;
+ if (!this || !isArray(this) || isPlainArray(this)) return arr;
+ result = new this.constructor(arr.length);
+ forEach.call(arr, function (val, i) { result[i] = val; });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/uniq.js b/Nodejs/node_modules/es5-ext/array/#/uniq.js
new file mode 100644
index 0000000..2d28bf5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/uniq.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var indexOf = require("./e-index-of")
+ , filter = Array.prototype.filter
+ , isFirst;
+
+isFirst = function (value, index) { return indexOf.call(this, value) === index; };
+
+module.exports = function () { return filter.call(this, isFirst, this); };
diff --git a/Nodejs/node_modules/es5-ext/array/#/values/implement.js b/Nodejs/node_modules/es5-ext/array/#/values/implement.js
new file mode 100644
index 0000000..dce17ac
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/values/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array.prototype, "values", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/#/values/index.js b/Nodejs/node_modules/es5-ext/array/#/values/index.js
new file mode 100644
index 0000000..30a50ba
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/values/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.prototype.values : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/#/values/is-implemented.js b/Nodejs/node_modules/es5-ext/array/#/values/is-implemented.js
new file mode 100644
index 0000000..8b72568
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/values/is-implemented.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function () {
+ var arr = ["foo", 1], iterator, result;
+ if (typeof arr.values !== "function") return false;
+ iterator = arr.values();
+ if (!iterator) return false;
+ if (typeof iterator.next !== "function") return false;
+ result = iterator.next();
+ if (!result) return false;
+ if (result.value !== "foo") return false;
+ if (result.done !== false) return false;
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/#/values/shim.js b/Nodejs/node_modules/es5-ext/array/#/values/shim.js
new file mode 100644
index 0000000..5d013ab
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/#/values/shim.js
@@ -0,0 +1,4 @@
+"use strict";
+
+var ArrayIterator = require("es6-iterator/array");
+module.exports = function () { return new ArrayIterator(this, "value"); };
diff --git a/Nodejs/node_modules/es5-ext/array/_is-extensible.js b/Nodejs/node_modules/es5-ext/array/_is-extensible.js
new file mode 100644
index 0000000..c475711
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/_is-extensible.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = (function () {
+ var SubArray = require("./_sub-array-dummy")
+ , arr;
+
+ if (!SubArray) return false;
+ arr = new SubArray();
+ if (!Array.isArray(arr)) return false;
+ if (!(arr instanceof SubArray)) return false;
+
+ arr[34] = "foo";
+ return arr.length === 35;
+})();
diff --git a/Nodejs/node_modules/es5-ext/array/_sub-array-dummy-safe.js b/Nodejs/node_modules/es5-ext/array/_sub-array-dummy-safe.js
new file mode 100644
index 0000000..bef50be
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/_sub-array-dummy-safe.js
@@ -0,0 +1,22 @@
+"use strict";
+
+var setPrototypeOf = require("../object/set-prototype-of")
+ , isExtensible = require("./_is-extensible");
+
+module.exports = (function () {
+ var SubArray;
+
+ if (isExtensible) return require("./_sub-array-dummy");
+
+ if (!setPrototypeOf) return null;
+ SubArray = function () {
+ var arr = Array.apply(this, arguments);
+ setPrototypeOf(arr, SubArray.prototype);
+ return arr;
+ };
+ setPrototypeOf(SubArray, Array);
+ SubArray.prototype = Object.create(Array.prototype, {
+ constructor: { value: SubArray, enumerable: false, writable: true, configurable: true }
+ });
+ return SubArray;
+})();
diff --git a/Nodejs/node_modules/es5-ext/array/_sub-array-dummy.js b/Nodejs/node_modules/es5-ext/array/_sub-array-dummy.js
new file mode 100644
index 0000000..5969309
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/_sub-array-dummy.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var setPrototypeOf = require("../object/set-prototype-of");
+
+module.exports = (function () {
+ var SubArray;
+
+ if (!setPrototypeOf) return null;
+ SubArray = function () { Array.apply(this, arguments); };
+ setPrototypeOf(SubArray, Array);
+ SubArray.prototype = Object.create(Array.prototype, {
+ constructor: { value: SubArray, enumerable: false, writable: true, configurable: true }
+ });
+ return SubArray;
+})();
diff --git a/Nodejs/node_modules/es5-ext/array/from/implement.js b/Nodejs/node_modules/es5-ext/array/from/implement.js
new file mode 100644
index 0000000..c08d407
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/from/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array, "from", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/from/index.js b/Nodejs/node_modules/es5-ext/array/from/index.js
new file mode 100644
index 0000000..81cf8d9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/from/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.from : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/from/is-implemented.js b/Nodejs/node_modules/es5-ext/array/from/is-implemented.js
new file mode 100644
index 0000000..a786c76
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/from/is-implemented.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function () {
+ var from = Array.from, arr, result;
+ if (typeof from !== "function") return false;
+ arr = ["raz", "dwa"];
+ result = from(arr);
+ return Boolean(result && result !== arr && result[1] === "dwa");
+};
diff --git a/Nodejs/node_modules/es5-ext/array/from/shim.js b/Nodejs/node_modules/es5-ext/array/from/shim.js
new file mode 100644
index 0000000..4a2a59a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/from/shim.js
@@ -0,0 +1,119 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator
+ , isArguments = require("../../function/is-arguments")
+ , isFunction = require("../../function/is-function")
+ , toPosInt = require("../../number/to-pos-integer")
+ , callable = require("../../object/valid-callable")
+ , validValue = require("../../object/valid-value")
+ , isValue = require("../../object/is-value")
+ , isString = require("../../string/is-string")
+ , isArray = Array.isArray
+ , call = Function.prototype.call
+ , desc = { configurable: true, enumerable: true, writable: true, value: null }
+ , defineProperty = Object.defineProperty;
+
+// eslint-disable-next-line complexity, max-lines-per-function
+module.exports = function (arrayLike/*, mapFn, thisArg*/) {
+ var mapFn = arguments[1]
+ , thisArg = arguments[2]
+ , Context
+ , i
+ , j
+ , arr
+ , length
+ , code
+ , iterator
+ , result
+ , getIterator
+ , value;
+
+ arrayLike = Object(validValue(arrayLike));
+
+ if (isValue(mapFn)) callable(mapFn);
+ if (!this || this === Array || !isFunction(this)) {
+ // Result: Plain array
+ if (!mapFn) {
+ if (isArguments(arrayLike)) {
+ // Source: Arguments
+ length = arrayLike.length;
+ if (length !== 1) return Array.apply(null, arrayLike);
+ arr = new Array(1);
+ arr[0] = arrayLike[0];
+ return arr;
+ }
+ if (isArray(arrayLike)) {
+ // Source: Array
+ arr = new Array((length = arrayLike.length));
+ for (i = 0; i < length; ++i) arr[i] = arrayLike[i];
+ return arr;
+ }
+ }
+ arr = [];
+ } else {
+ // Result: Non plain array
+ Context = this;
+ }
+
+ if (!isArray(arrayLike)) {
+ if ((getIterator = arrayLike[iteratorSymbol]) !== undefined) {
+ // Source: Iterator
+ iterator = callable(getIterator).call(arrayLike);
+ if (Context) arr = new Context();
+ result = iterator.next();
+ i = 0;
+ while (!result.done) {
+ value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
+ if (Context) {
+ desc.value = value;
+ defineProperty(arr, i, desc);
+ } else {
+ arr[i] = value;
+ }
+ result = iterator.next();
+ ++i;
+ }
+ length = i;
+ } else if (isString(arrayLike)) {
+ // Source: String
+ length = arrayLike.length;
+ if (Context) arr = new Context();
+ for (i = 0, j = 0; i < length; ++i) {
+ value = arrayLike[i];
+ if (i + 1 < length) {
+ code = value.charCodeAt(0);
+ // eslint-disable-next-line max-depth
+ if (code >= 0xd800 && code <= 0xdbff) value += arrayLike[++i];
+ }
+ value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
+ if (Context) {
+ desc.value = value;
+ defineProperty(arr, j, desc);
+ } else {
+ arr[j] = value;
+ }
+ ++j;
+ }
+ length = j;
+ }
+ }
+ if (length === undefined) {
+ // Source: array or array-like
+ length = toPosInt(arrayLike.length);
+ if (Context) arr = new Context(length);
+ for (i = 0; i < length; ++i) {
+ value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
+ if (Context) {
+ desc.value = value;
+ defineProperty(arr, i, desc);
+ } else {
+ arr[i] = value;
+ }
+ }
+ }
+ if (Context) {
+ desc.value = null;
+ arr.length = length;
+ }
+ return arr;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/generate.js b/Nodejs/node_modules/es5-ext/array/generate.js
new file mode 100644
index 0000000..b99160e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/generate.js
@@ -0,0 +1,18 @@
+"use strict";
+
+var toPosInt = require("../number/to-pos-integer")
+ , value = require("../object/valid-value")
+ , slice = Array.prototype.slice;
+
+module.exports = function (length/*, …fill*/) {
+ var arr, currentLength;
+ length = toPosInt(value(length));
+ if (length === 0) return [];
+
+ arr = arguments.length < 2 ? [undefined] : slice.call(arguments, 1, 1 + length);
+
+ while ((currentLength = arr.length) < length) {
+ arr = arr.concat(arr.slice(0, length - currentLength));
+ }
+ return arr;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/index.js b/Nodejs/node_modules/es5-ext/array/index.js
new file mode 100644
index 0000000..49ff58e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/index.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = {
+ "#": require("./#"),
+ "from": require("./from"),
+ "generate": require("./generate"),
+ "isPlainArray": require("./is-plain-array"),
+ "of": require("./of"),
+ "toArray": require("./to-array"),
+ "validArray": require("./valid-array")
+};
diff --git a/Nodejs/node_modules/es5-ext/array/is-plain-array.js b/Nodejs/node_modules/es5-ext/array/is-plain-array.js
new file mode 100644
index 0000000..ca3d25b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/is-plain-array.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var isArray = Array.isArray, getPrototypeOf = Object.getPrototypeOf;
+
+module.exports = function (obj) {
+ var proto;
+ if (!obj || !isArray(obj)) return false;
+ proto = getPrototypeOf(obj);
+ if (!isArray(proto)) return false;
+ return !isArray(getPrototypeOf(proto));
+};
diff --git a/Nodejs/node_modules/es5-ext/array/of/implement.js b/Nodejs/node_modules/es5-ext/array/of/implement.js
new file mode 100644
index 0000000..6665c77
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/of/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Array, "of", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/array/of/index.js b/Nodejs/node_modules/es5-ext/array/of/index.js
new file mode 100644
index 0000000..503c749
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/of/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Array.of : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/array/of/is-implemented.js b/Nodejs/node_modules/es5-ext/array/of/is-implemented.js
new file mode 100644
index 0000000..3f232ca
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/of/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function () {
+ var of = Array.of, result;
+ if (typeof of !== "function") return false;
+ result = of("foo", "bar");
+ return Boolean(result && result[1] === "bar");
+};
diff --git a/Nodejs/node_modules/es5-ext/array/of/shim.js b/Nodejs/node_modules/es5-ext/array/of/shim.js
new file mode 100644
index 0000000..0202a8a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/of/shim.js
@@ -0,0 +1,19 @@
+"use strict";
+
+var isFunction = require("../../function/is-function")
+ , slice = Array.prototype.slice
+ , defineProperty = Object.defineProperty
+ , desc = { configurable: true, enumerable: true, writable: true, value: null };
+
+module.exports = function (/* …items*/) {
+ var result, i, length;
+ if (!this || this === Array || !isFunction(this)) return slice.call(arguments);
+ result = new this((length = arguments.length));
+ for (i = 0; i < length; ++i) {
+ desc.value = arguments[i];
+ defineProperty(result, i, desc);
+ }
+ desc.value = null;
+ result.length = length;
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/array/to-array.js b/Nodejs/node_modules/es5-ext/array/to-array.js
new file mode 100644
index 0000000..2515e02
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/to-array.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var from = require("./from")
+ , isArray = Array.isArray;
+
+module.exports = function (arrayLike) { return isArray(arrayLike) ? arrayLike : from(arrayLike); };
diff --git a/Nodejs/node_modules/es5-ext/array/valid-array.js b/Nodejs/node_modules/es5-ext/array/valid-array.js
new file mode 100644
index 0000000..1e58c39
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/array/valid-array.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isArray = Array.isArray;
+
+module.exports = function (value) {
+ if (isArray(value)) return value;
+ throw new TypeError(value + " is not an array");
+};
diff --git a/Nodejs/node_modules/es5-ext/boolean/index.js b/Nodejs/node_modules/es5-ext/boolean/index.js
new file mode 100644
index 0000000..3513642
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/boolean/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = { isBoolean: require("./is-boolean") };
diff --git a/Nodejs/node_modules/es5-ext/boolean/is-boolean.js b/Nodejs/node_modules/es5-ext/boolean/is-boolean.js
new file mode 100644
index 0000000..394845f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/boolean/is-boolean.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var objToString = Object.prototype.toString, id = objToString.call(true);
+
+module.exports = function (value) {
+ return (
+ typeof value === "boolean" ||
+ (typeof value === "object" && (value instanceof Boolean || objToString.call(value) === id))
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/date/#/copy.js b/Nodejs/node_modules/es5-ext/date/#/copy.js
new file mode 100644
index 0000000..1262ae0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/#/copy.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var getTime = Date.prototype.getTime;
+
+module.exports = function () { return new Date(getTime.call(this)); };
diff --git a/Nodejs/node_modules/es5-ext/date/#/days-in-month.js b/Nodejs/node_modules/es5-ext/date/#/days-in-month.js
new file mode 100644
index 0000000..731d4d5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/#/days-in-month.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var getMonth = Date.prototype.getMonth;
+
+module.exports = function () {
+ switch (getMonth.call(this)) {
+ case 1:
+ return this.getFullYear() % 4 ? 28 : 29;
+ case 3:
+ case 5:
+ case 8:
+ case 10:
+ return 30;
+ default:
+ return 31;
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/date/#/floor-day.js b/Nodejs/node_modules/es5-ext/date/#/floor-day.js
new file mode 100644
index 0000000..db696d3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/#/floor-day.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var setHours = Date.prototype.setHours;
+
+module.exports = function () {
+ setHours.call(this, 0, 0, 0, 0);
+ return this;
+};
diff --git a/Nodejs/node_modules/es5-ext/date/#/floor-month.js b/Nodejs/node_modules/es5-ext/date/#/floor-month.js
new file mode 100644
index 0000000..c9c0460
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/#/floor-month.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var floorDay = require("./floor-day");
+
+module.exports = function () {
+ floorDay.call(this).setDate(1);
+ return this;
+};
diff --git a/Nodejs/node_modules/es5-ext/date/#/floor-year.js b/Nodejs/node_modules/es5-ext/date/#/floor-year.js
new file mode 100644
index 0000000..e9b6f0f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/#/floor-year.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var floorMonth = require("./floor-month");
+
+module.exports = function () {
+ floorMonth.call(this).setMonth(0);
+ return this;
+};
diff --git a/Nodejs/node_modules/es5-ext/date/#/format.js b/Nodejs/node_modules/es5-ext/date/#/format.js
new file mode 100644
index 0000000..8474dbb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/#/format.js
@@ -0,0 +1,20 @@
+/* eslint id-length: "off" */
+
+"use strict";
+
+var pad = require("../../number/#/pad")
+ , date = require("../valid-date")
+ , format;
+
+format = require("../../string/format-method")({
+ Y: function () { return String(this.getFullYear()); },
+ y: function () { return String(this.getFullYear()).slice(-2); },
+ m: function () { return pad.call(this.getMonth() + 1, 2); },
+ d: function () { return pad.call(this.getDate(), 2); },
+ H: function () { return pad.call(this.getHours(), 2); },
+ M: function () { return pad.call(this.getMinutes(), 2); },
+ S: function () { return pad.call(this.getSeconds(), 2); },
+ L: function () { return pad.call(this.getMilliseconds(), 3); }
+});
+
+module.exports = function (pattern) { return format.call(date(this), pattern); };
diff --git a/Nodejs/node_modules/es5-ext/date/#/index.js b/Nodejs/node_modules/es5-ext/date/#/index.js
new file mode 100644
index 0000000..1781e21
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/#/index.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = {
+ copy: require("./copy"),
+ daysInMonth: require("./days-in-month"),
+ floorDay: require("./floor-day"),
+ floorMonth: require("./floor-month"),
+ floorYear: require("./floor-year"),
+ format: require("./format")
+};
diff --git a/Nodejs/node_modules/es5-ext/date/ensure-time-value.js b/Nodejs/node_modules/es5-ext/date/ensure-time-value.js
new file mode 100644
index 0000000..09f5afc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/ensure-time-value.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var safeToString = require("../safe-to-string")
+ , toInteger = require("../number/to-integer")
+ , isTimeValue = require("./is-time-value");
+
+module.exports = function (value) {
+ if (isTimeValue(value)) return toInteger(value);
+ throw new TypeError(safeToString(value) + " is not a valid time value");
+};
diff --git a/Nodejs/node_modules/es5-ext/date/index.js b/Nodejs/node_modules/es5-ext/date/index.js
new file mode 100644
index 0000000..c143149
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/index.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = {
+ "#": require("./#"),
+ "ensureTimeValue": require("./ensure-time-value"),
+ "isDate": require("./is-date"),
+ "isTimeValue": require("./is-time-value"),
+ "validDate": require("./valid-date")
+};
diff --git a/Nodejs/node_modules/es5-ext/date/is-date.js b/Nodejs/node_modules/es5-ext/date/is-date.js
new file mode 100644
index 0000000..f45bde4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/is-date.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var objToString = Object.prototype.toString, id = objToString.call(new Date());
+
+module.exports = function (value) {
+ return (
+ (value && !isNaN(value) && (value instanceof Date || objToString.call(value) === id)) ||
+ false
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/date/is-time-value.js b/Nodejs/node_modules/es5-ext/date/is-time-value.js
new file mode 100644
index 0000000..0deb0b9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/is-time-value.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (value) {
+ try { value = Number(value); }
+ catch (e) { return false; }
+ if (isNaN(value)) return false;
+ if (Math.abs(value) > 8.64e15) return false;
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/date/valid-date.js b/Nodejs/node_modules/es5-ext/date/valid-date.js
new file mode 100644
index 0000000..0c73dc5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/date/valid-date.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isDate = require("./is-date");
+
+module.exports = function (value) {
+ if (!isDate(value)) throw new TypeError(value + " is not valid Date object");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/error/#/index.js b/Nodejs/node_modules/es5-ext/error/#/index.js
new file mode 100644
index 0000000..973a9d4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/error/#/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = { throw: require("./throw") };
diff --git a/Nodejs/node_modules/es5-ext/error/#/throw.js b/Nodejs/node_modules/es5-ext/error/#/throw.js
new file mode 100644
index 0000000..3eb196d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/error/#/throw.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var error = require("../valid-error");
+
+module.exports = function () { throw error(this); };
diff --git a/Nodejs/node_modules/es5-ext/error/custom.js b/Nodejs/node_modules/es5-ext/error/custom.js
new file mode 100644
index 0000000..416d571
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/error/custom.js
@@ -0,0 +1,20 @@
+"use strict";
+
+var assign = require("../object/assign")
+ , isObject = require("../object/is-object")
+ , isValue = require("../object/is-value")
+ , captureStackTrace = Error.captureStackTrace;
+
+module.exports = function (message/*, code, ext*/) {
+ var err = new Error(message), code = arguments[1], ext = arguments[2];
+ if (!isValue(ext)) {
+ if (isObject(code)) {
+ ext = code;
+ code = null;
+ }
+ }
+ if (isValue(ext)) assign(err, ext);
+ if (isValue(code)) err.code = code;
+ if (captureStackTrace) captureStackTrace(err, module.exports);
+ return err;
+};
diff --git a/Nodejs/node_modules/es5-ext/error/index.js b/Nodejs/node_modules/es5-ext/error/index.js
new file mode 100644
index 0000000..cb7054a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/error/index.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = {
+ "#": require("./#"),
+ "custom": require("./custom"),
+ "isError": require("./is-error"),
+ "validError": require("./valid-error")
+};
diff --git a/Nodejs/node_modules/es5-ext/error/is-error.js b/Nodejs/node_modules/es5-ext/error/is-error.js
new file mode 100644
index 0000000..aad67ed
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/error/is-error.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var objToString = Object.prototype.toString, id = objToString.call(new Error());
+
+module.exports = function (value) {
+ return (value && (value instanceof Error || objToString.call(value) === id)) || false;
+};
diff --git a/Nodejs/node_modules/es5-ext/error/valid-error.js b/Nodejs/node_modules/es5-ext/error/valid-error.js
new file mode 100644
index 0000000..432f7ba
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/error/valid-error.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isError = require("./is-error");
+
+module.exports = function (value) {
+ if (!isError(value)) throw new TypeError(value + " is not an Error object");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/compose.js b/Nodejs/node_modules/es5-ext/function/#/compose.js
new file mode 100644
index 0000000..c1d37b4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/compose.js
@@ -0,0 +1,20 @@
+"use strict";
+
+var isValue = require("../../object/is-value")
+ , callable = require("../../object/valid-callable")
+ , aFrom = require("../../array/from");
+
+var apply = Function.prototype.apply
+ , call = Function.prototype.call
+ , callFn = function (arg, fn) { return call.call(fn, this, arg); };
+
+module.exports = function (fnIgnored/*, …fnn*/) {
+ var fns, first;
+ var args = aFrom(arguments);
+ fns = isValue(this) ? [this].concat(args) : args;
+ fns.forEach(callable);
+ fns = fns.reverse();
+ first = fns[0];
+ fns = fns.slice(1);
+ return function (argIgnored) { return fns.reduce(callFn, apply.call(first, this, arguments)); };
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/copy.js b/Nodejs/node_modules/es5-ext/function/#/copy.js
new file mode 100644
index 0000000..81ae783
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/copy.js
@@ -0,0 +1,22 @@
+"use strict";
+
+var mixin = require("../../object/mixin")
+ , validFunction = require("../valid-function")
+ , re = /^\s*function\s*([\0-')-\uffff]+)*\s*\(([\0-(*-\uffff]*)\)\s*\{/;
+
+module.exports = function () {
+ var match = String(validFunction(this)).match(re), fn;
+
+ // eslint-disable-next-line no-new-func
+ fn = new Function(
+ "fn",
+ "return function " +
+ match[1].trim() +
+ "(" +
+ match[2] +
+ ") { return fn.apply(this, arguments); };"
+ )(this);
+ try { mixin(fn, this); }
+ catch (ignore) {}
+ return fn;
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/curry.js b/Nodejs/node_modules/es5-ext/function/#/curry.js
new file mode 100644
index 0000000..9296458
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/curry.js
@@ -0,0 +1,25 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , callable = require("../../object/valid-callable")
+ , defineLength = require("../_define-length")
+ , slice = Array.prototype.slice
+ , apply = Function.prototype.apply
+ , curry;
+
+curry = function self(fn, length, preArgs) {
+ return defineLength(
+ function () {
+ var args = preArgs
+ ? preArgs.concat(slice.call(arguments, 0, length - preArgs.length))
+ : slice.call(arguments, 0, length);
+ return args.length === length ? apply.call(fn, this, args) : self(fn, length, args);
+ },
+ preArgs ? length - preArgs.length : length
+ );
+};
+
+module.exports = function (/* Length*/) {
+ var length = arguments[0];
+ return curry(callable(this), isNaN(length) ? toPosInt(this.length) : toPosInt(length));
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/index.js b/Nodejs/node_modules/es5-ext/function/#/index.js
new file mode 100644
index 0000000..02ae9f4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/index.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = {
+ compose: require("./compose"),
+ copy: require("./copy"),
+ curry: require("./curry"),
+ lock: require("./lock"),
+ microtaskDelay: require("./microtask-delay"),
+ not: require("./not"),
+ partial: require("./partial"),
+ spread: require("./spread"),
+ toStringTokens: require("./to-string-tokens")
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/lock.js b/Nodejs/node_modules/es5-ext/function/#/lock.js
new file mode 100644
index 0000000..afd83b9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/lock.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var callable = require("../../object/valid-callable")
+ , apply = Function.prototype.apply;
+
+module.exports = function (/* …args*/) {
+ var fn = callable(this), args = arguments;
+
+ return function () { return apply.call(fn, this, args); };
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/microtask-delay.js b/Nodejs/node_modules/es5-ext/function/#/microtask-delay.js
new file mode 100644
index 0000000..3741ebe
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/microtask-delay.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var ensurePlainFunction = require("../../object/ensure-plain-function")
+ , defineLength = require("../_define-length")
+ , nextTick = require("next-tick");
+
+var apply = Function.prototype.apply;
+
+module.exports = function () {
+ var src = ensurePlainFunction(this);
+ return defineLength(function () { nextTick(apply.bind(src, this, arguments)); }, this.length);
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/not.js b/Nodejs/node_modules/es5-ext/function/#/not.js
new file mode 100644
index 0000000..b3b7d62
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/not.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var callable = require("../../object/valid-callable")
+ , defineLength = require("../_define-length")
+ , apply = Function.prototype.apply;
+
+module.exports = function () {
+ var fn = callable(this);
+
+ return defineLength(function () { return !apply.call(fn, this, arguments); }, fn.length);
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/partial.js b/Nodejs/node_modules/es5-ext/function/#/partial.js
new file mode 100644
index 0000000..8f09c4f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/partial.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var callable = require("../../object/valid-callable")
+ , aFrom = require("../../array/from")
+ , defineLength = require("../_define-length")
+ , apply = Function.prototype.apply;
+
+module.exports = function (/* …args*/) {
+ var fn = callable(this), args = aFrom(arguments);
+
+ return defineLength(function () {
+ return apply.call(fn, this, args.concat(aFrom(arguments)));
+ }, fn.length - args.length);
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/spread.js b/Nodejs/node_modules/es5-ext/function/#/spread.js
new file mode 100644
index 0000000..555d991
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/spread.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var callable = require("../../object/valid-callable")
+ , apply = Function.prototype.apply;
+
+module.exports = function () {
+ var fn = callable(this);
+ return function (args) { return apply.call(fn, this, args); };
+};
diff --git a/Nodejs/node_modules/es5-ext/function/#/to-string-tokens.js b/Nodejs/node_modules/es5-ext/function/#/to-string-tokens.js
new file mode 100644
index 0000000..4ce026a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/#/to-string-tokens.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var validFunction = require("../valid-function");
+
+var re1 = /^\s*function[\0-')-\uffff]*\(([\0-(*-\uffff]*)\)\s*\{([\0-\uffff]*)\}\s*$/
+ , re2 = /^\s*\(?([\0-'*-\uffff]*)\)?\s*=>\s*(\{?[\0-\uffff]*\}?)\s*$/;
+
+module.exports = function () {
+ var str = String(validFunction(this)), data = str.match(re1);
+ if (!data) {
+ data = str.match(re2);
+ if (!data) throw new Error("Unrecognized string format");
+ data[1] = data[1].trim();
+ if (data[2][0] === "{") data[2] = data[2].trim().slice(1, -1);
+ }
+ return { args: data[1], body: data[2] };
+};
diff --git a/Nodejs/node_modules/es5-ext/function/_define-length.js b/Nodejs/node_modules/es5-ext/function/_define-length.js
new file mode 100644
index 0000000..d77a433
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/_define-length.js
@@ -0,0 +1,54 @@
+"use strict";
+
+var toPosInt = require("../number/to-pos-integer");
+
+var test = function (arg1, arg2) { return arg2; };
+
+var desc, defineProperty, generate, mixin;
+
+try {
+ Object.defineProperty(test, "length", {
+ configurable: true,
+ writable: false,
+ enumerable: false,
+ value: 1
+ });
+}
+catch (ignore) {}
+
+if (test.length === 1) {
+ // ES6
+ desc = { configurable: true, writable: false, enumerable: false };
+ defineProperty = Object.defineProperty;
+ module.exports = function (fn, length) {
+ length = toPosInt(length);
+ if (fn.length === length) return fn;
+ desc.value = length;
+ return defineProperty(fn, "length", desc);
+ };
+} else {
+ mixin = require("../object/mixin");
+ generate = (function () {
+ var cache = [];
+ return function (length) {
+ var args, i = 0;
+ if (cache[length]) return cache[length];
+ args = [];
+ while (length--) args.push("a" + (++i).toString(36));
+ // eslint-disable-next-line no-new-func
+ return new Function(
+ "fn",
+ "return function (" + args.join(", ") + ") { return fn.apply(this, arguments); };"
+ );
+ };
+ })();
+ module.exports = function (src, length) {
+ var target;
+ length = toPosInt(length);
+ if (src.length === length) return src;
+ target = generate(length)(src);
+ try { mixin(target, src); }
+ catch (ignore) {}
+ return target;
+ };
+}
diff --git a/Nodejs/node_modules/es5-ext/function/constant.js b/Nodejs/node_modules/es5-ext/function/constant.js
new file mode 100644
index 0000000..79d81e4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/constant.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = function (value) {
+ return function () { return value; };
+};
diff --git a/Nodejs/node_modules/es5-ext/function/identity.js b/Nodejs/node_modules/es5-ext/function/identity.js
new file mode 100644
index 0000000..cde213f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/identity.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (value) { return value; };
diff --git a/Nodejs/node_modules/es5-ext/function/index.js b/Nodejs/node_modules/es5-ext/function/index.js
new file mode 100644
index 0000000..1574fbb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/index.js
@@ -0,0 +1,15 @@
+// Export all modules.
+
+"use strict";
+
+module.exports = {
+ "#": require("./#"),
+ "constant": require("./constant"),
+ "identity": require("./identity"),
+ "invoke": require("./invoke"),
+ "isArguments": require("./is-arguments"),
+ "isFunction": require("./is-function"),
+ "noop": require("./noop"),
+ "pluck": require("./pluck"),
+ "validFunction": require("./valid-function")
+};
diff --git a/Nodejs/node_modules/es5-ext/function/invoke.js b/Nodejs/node_modules/es5-ext/function/invoke.js
new file mode 100644
index 0000000..fcec0a7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/invoke.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var isCallable = require("../object/is-callable")
+ , value = require("../object/valid-value")
+ , slice = Array.prototype.slice
+ , apply = Function.prototype.apply;
+
+module.exports = function (name/*, …args*/) {
+ var args = slice.call(arguments, 1), isFn = isCallable(name);
+ return function (obj) {
+ value(obj);
+ return apply.call(isFn ? name : obj[name], obj, args.concat(slice.call(arguments, 1)));
+ };
+};
diff --git a/Nodejs/node_modules/es5-ext/function/is-arguments.js b/Nodejs/node_modules/es5-ext/function/is-arguments.js
new file mode 100644
index 0000000..833a747
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/is-arguments.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var objToString = Object.prototype.toString
+ , id = objToString.call((function () { return arguments; })());
+
+module.exports = function (value) { return objToString.call(value) === id; };
diff --git a/Nodejs/node_modules/es5-ext/function/is-function.js b/Nodejs/node_modules/es5-ext/function/is-function.js
new file mode 100644
index 0000000..0d7cab3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/is-function.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var objToString = Object.prototype.toString
+ , isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
+
+module.exports = function (value) {
+ return typeof value === "function" && isFunctionStringTag(objToString.call(value));
+};
diff --git a/Nodejs/node_modules/es5-ext/function/noop.js b/Nodejs/node_modules/es5-ext/function/noop.js
new file mode 100644
index 0000000..6174f03
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/noop.js
@@ -0,0 +1,4 @@
+"use strict";
+
+// eslint-disable-next-line no-empty-function
+module.exports = function () {};
diff --git a/Nodejs/node_modules/es5-ext/function/pluck.js b/Nodejs/node_modules/es5-ext/function/pluck.js
new file mode 100644
index 0000000..432cd46
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/pluck.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var value = require("../object/valid-value");
+
+module.exports = function (name) {
+ return function (obj) { return value(obj)[name]; };
+};
diff --git a/Nodejs/node_modules/es5-ext/function/valid-function.js b/Nodejs/node_modules/es5-ext/function/valid-function.js
new file mode 100644
index 0000000..060bd64
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/function/valid-function.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isFunction = require("./is-function");
+
+module.exports = function (value) {
+ if (!isFunction(value)) throw new TypeError(value + " is not a function");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/global.js b/Nodejs/node_modules/es5-ext/global.js
new file mode 100644
index 0000000..61071e6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/global.js
@@ -0,0 +1,35 @@
+var naiveFallback = function () {
+ if (typeof self === "object" && self) return self;
+ if (typeof window === "object" && window) return window;
+ throw new Error("Unable to resolve global `this`");
+};
+
+module.exports = (function () {
+ if (this) return this;
+
+ // Unexpected strict mode (may happen if e.g. bundled into ESM module)
+
+ // Fallback to standard globalThis if available
+ if (typeof globalThis === "object" && globalThis) return globalThis;
+
+ // Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis
+ // In all ES5+ engines global object inherits from Object.prototype
+ // (if you approached one that doesn't please report)
+ try {
+ Object.defineProperty(Object.prototype, "__global__", {
+ get: function () { return this; },
+ configurable: true
+ });
+ } catch (error) {
+ // Unfortunate case of updates to Object.prototype being restricted
+ // via preventExtensions, seal or freeze
+ return naiveFallback();
+ }
+ try {
+ // Safari case (window.__global__ works, but __global__ does not)
+ if (!__global__) return naiveFallback();
+ return __global__;
+ } finally {
+ delete Object.prototype.__global__;
+ }
+})();
diff --git a/Nodejs/node_modules/es5-ext/index.js b/Nodejs/node_modules/es5-ext/index.js
new file mode 100644
index 0000000..0919764
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/index.js
@@ -0,0 +1,22 @@
+"use strict";
+
+module.exports = {
+ global: require("./global"),
+ optionalChaining: require("./optional-chaining"),
+ safeToString: require("./safe-to-string"),
+ toShortStringRepresentation: require("./to-short-string-representation"),
+
+ array: require("./array"),
+ boolean: require("./boolean"),
+ date: require("./date"),
+ error: require("./error"),
+ function: require("./function"),
+ iterable: require("./iterable"),
+ json: require("./json"),
+ math: require("./math"),
+ number: require("./number"),
+ object: require("./object"),
+ promise: require("./promise"),
+ regExp: require("./reg-exp"),
+ string: require("./string")
+};
diff --git a/Nodejs/node_modules/es5-ext/iterable/for-each.js b/Nodejs/node_modules/es5-ext/iterable/for-each.js
new file mode 100644
index 0000000..6063822
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/iterable/for-each.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var forOf = require("es6-iterator/for-of")
+ , isIterable = require("es6-iterator/is-iterable")
+ , iterable = require("./validate")
+ , forEach = Array.prototype.forEach;
+
+module.exports = function (target, cb/*, thisArg*/) {
+ if (isIterable(iterable(target))) forOf(target, cb, arguments[2]);
+ else forEach.call(target, cb, arguments[2]);
+};
diff --git a/Nodejs/node_modules/es5-ext/iterable/index.js b/Nodejs/node_modules/es5-ext/iterable/index.js
new file mode 100644
index 0000000..4b898fc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/iterable/index.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = {
+ forEach: require("./for-each"),
+ is: require("./is"),
+ validate: require("./validate"),
+ validateObject: require("./validate-object")
+};
diff --git a/Nodejs/node_modules/es5-ext/iterable/is.js b/Nodejs/node_modules/es5-ext/iterable/is.js
new file mode 100644
index 0000000..aa5a9b9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/iterable/is.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator
+ , isValue = require("../object/is-value")
+ , isArrayLike = require("../object/is-array-like");
+
+module.exports = function (value) {
+ if (!isValue(value)) return false;
+ if (typeof value[iteratorSymbol] === "function") return true;
+ return isArrayLike(value);
+};
diff --git a/Nodejs/node_modules/es5-ext/iterable/validate-object.js b/Nodejs/node_modules/es5-ext/iterable/validate-object.js
new file mode 100644
index 0000000..26e622b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/iterable/validate-object.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var isObject = require("../object/is-object")
+ , is = require("./is");
+
+module.exports = function (value) {
+ if (is(value) && isObject(value)) return value;
+ throw new TypeError(value + " is not an iterable or array-like object");
+};
diff --git a/Nodejs/node_modules/es5-ext/iterable/validate.js b/Nodejs/node_modules/es5-ext/iterable/validate.js
new file mode 100644
index 0000000..94a91c4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/iterable/validate.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var is = require("./is");
+
+module.exports = function (value) {
+ if (is(value)) return value;
+ throw new TypeError(value + " is not an iterable or array-like");
+};
diff --git a/Nodejs/node_modules/es5-ext/json/index.js b/Nodejs/node_modules/es5-ext/json/index.js
new file mode 100644
index 0000000..d26ac56
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/json/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = { safeStringify: require("./safe-stringify") };
diff --git a/Nodejs/node_modules/es5-ext/json/safe-stringify.js b/Nodejs/node_modules/es5-ext/json/safe-stringify.js
new file mode 100644
index 0000000..b996a62
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/json/safe-stringify.js
@@ -0,0 +1,37 @@
+"use strict";
+
+var compact = require("../array/#/compact")
+ , isObject = require("../object/is-object")
+ , toArray = require("../object/to-array")
+ , isArray = Array.isArray
+ , stringify = JSON.stringify;
+
+module.exports = function self(value/*, replacer, space*/) {
+ var replacer = arguments[1], space = arguments[2];
+ try {
+ return stringify(value, replacer, space);
+ } catch (e) {
+ if (!isObject(value)) return null;
+ if (typeof value.toJSON === "function") return null;
+ if (isArray(value)) {
+ return (
+ "[" +
+ compact.call(value.map(function (item) { return self(item, replacer, space); })) +
+ "]"
+ );
+ }
+ return (
+ "{" +
+ compact
+ .call(
+ toArray(value, function (item, key) {
+ item = self(item, replacer, space);
+ if (!item) return null;
+ return stringify(key) + ":" + item;
+ })
+ )
+ .join(",") +
+ "}"
+ );
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/math/_decimal-adjust.js b/Nodejs/node_modules/es5-ext/math/_decimal-adjust.js
new file mode 100644
index 0000000..fd0b002
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/_decimal-adjust.js
@@ -0,0 +1,29 @@
+// Credit:
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
+// #Decimal_rounding
+
+"use strict";
+
+var isValue = require("../object/is-value")
+ , ensureInteger = require("../object/ensure-integer");
+
+var split = String.prototype.split;
+
+module.exports = function (type) {
+ return function (value/*, exp*/) {
+ value = Number(value);
+ var exp = arguments[1];
+ if (isValue(exp)) exp = ensureInteger(exp);
+ if (!value) return value;
+ if (!exp) return Math[type](value);
+ if (!isFinite(value)) return value;
+
+ // Shift
+ var tokens = split.call(value, "e");
+ value = Math[type](tokens[0] + "e" + ((tokens[1] || 0) - exp));
+
+ // Shift back
+ tokens = value.toString().split("e");
+ return Number(tokens[0] + "e" + (Number(tokens[1] || 0) + exp));
+ };
+};
diff --git a/Nodejs/node_modules/es5-ext/math/_pack-ieee754.js b/Nodejs/node_modules/es5-ext/math/_pack-ieee754.js
new file mode 100644
index 0000000..b3edf8d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/_pack-ieee754.js
@@ -0,0 +1,88 @@
+/* eslint no-bitwise: "off" */
+// Credit: https://github.com/paulmillr/es6-shim/
+
+"use strict";
+
+var abs = Math.abs
+ , floor = Math.floor
+ , log = Math.log
+ , min = Math.min
+ , pow = Math.pow
+ , LN2 = Math.LN2
+ , roundToEven;
+
+roundToEven = function (num) {
+ var whole = floor(num), fraction = num - whole;
+ if (fraction < 0.5) return whole;
+ if (fraction > 0.5) return whole + 1;
+ return whole % 2 ? whole + 1 : whole;
+};
+
+// eslint-disable-next-line max-statements, max-lines-per-function
+module.exports = function (value, ebits, fbits) {
+ var bias = (1 << (ebits - 1)) - 1, sign, e, fraction, i, bits, str, bytes;
+
+ // Compute sign, exponent, fraction
+ if (isNaN(value)) {
+ // NaN
+ // http://dev.w3.org/2006/webapi/WebIDL/#es-type-mapping
+ e = (1 << ebits) - 1;
+ fraction = pow(2, fbits - 1);
+ sign = 0;
+ } else if (value === Infinity || value === -Infinity) {
+ e = (1 << ebits) - 1;
+ fraction = 0;
+ sign = value < 0 ? 1 : 0;
+ } else if (value === 0) {
+ e = 0;
+ fraction = 0;
+ sign = 1 / value === -Infinity ? 1 : 0;
+ } else {
+ sign = value < 0;
+ value = abs(value);
+
+ if (value >= pow(2, 1 - bias)) {
+ e = min(floor(log(value) / LN2), 1023);
+ fraction = roundToEven((value / pow(2, e)) * pow(2, fbits));
+ if (fraction / pow(2, fbits) >= 2) {
+ e += 1;
+ fraction = 1;
+ }
+ if (e > bias) {
+ // Overflow
+ e = (1 << ebits) - 1;
+ fraction = 0;
+ } else {
+ // Normal
+ e += bias;
+ fraction -= pow(2, fbits);
+ }
+ } else {
+ // Subnormal
+ e = 0;
+ fraction = roundToEven(value / pow(2, 1 - bias - fbits));
+ }
+ }
+
+ // Pack sign, exponent, fraction
+ bits = [];
+ for (i = fbits; i; i -= 1) {
+ bits.push(fraction % 2 ? 1 : 0);
+ fraction = floor(fraction / 2);
+ }
+ for (i = ebits; i; i -= 1) {
+ bits.push(e % 2 ? 1 : 0);
+ e = floor(e / 2);
+ }
+ bits.push(sign ? 1 : 0);
+ bits.reverse();
+ str = bits.join("");
+
+ // Bits to bytes
+ bytes = [];
+ while (str.length) {
+ bytes.push(parseInt(str.substring(0, 8), 2));
+ str = str.substring(8);
+ }
+ return bytes;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/_unpack-ieee754.js b/Nodejs/node_modules/es5-ext/math/_unpack-ieee754.js
new file mode 100644
index 0000000..83fa947
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/_unpack-ieee754.js
@@ -0,0 +1,33 @@
+/* eslint no-bitwise: "off" */
+// Credit: https://github.com/paulmillr/es6-shim/
+
+"use strict";
+
+var pow = Math.pow;
+
+module.exports = function (bytes, ebits, fbits) {
+ // Bytes to bits
+ var bits = [], i, j, bit, str, bias, sign, e, fraction;
+
+ for (i = bytes.length; i; i -= 1) {
+ bit = bytes[i - 1];
+ for (j = 8; j; j -= 1) {
+ bits.push(bit % 2 ? 1 : 0);
+ bit >>= 1;
+ }
+ }
+ bits.reverse();
+ str = bits.join("");
+
+ // Unpack sign, exponent, fraction
+ bias = (1 << (ebits - 1)) - 1;
+ sign = parseInt(str.substring(0, 1), 2) ? -1 : 1;
+ e = parseInt(str.substring(1, 1 + ebits), 2);
+ fraction = parseInt(str.substring(1 + ebits), 2);
+
+ // Produce number
+ if (e === (1 << ebits) - 1) return fraction === 0 ? sign * Infinity : NaN;
+ if (e > 0) return sign * pow(2, e - bias) * (1 + fraction / pow(2, fbits));
+ if (fraction !== 0) return sign * pow(2, -(bias - 1)) * (fraction / pow(2, fbits));
+ return sign < 0 ? -0 : 0;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/acosh/implement.js b/Nodejs/node_modules/es5-ext/math/acosh/implement.js
new file mode 100644
index 0000000..9e4582f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/acosh/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "acosh", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/acosh/index.js b/Nodejs/node_modules/es5-ext/math/acosh/index.js
new file mode 100644
index 0000000..da176cb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/acosh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.acosh : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/acosh/is-implemented.js b/Nodejs/node_modules/es5-ext/math/acosh/is-implemented.js
new file mode 100644
index 0000000..2e97301
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/acosh/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var acosh = Math.acosh;
+ if (typeof acosh !== "function") return false;
+ return acosh(2) === 1.3169578969248166;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/acosh/shim.js b/Nodejs/node_modules/es5-ext/math/acosh/shim.js
new file mode 100644
index 0000000..3e632ff
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/acosh/shim.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var log = Math.log, sqrt = Math.sqrt;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value < 1) return NaN;
+ if (value === 1) return 0;
+ if (value === Infinity) return value;
+ return log(value + sqrt(value * value - 1));
+};
diff --git a/Nodejs/node_modules/es5-ext/math/asinh/implement.js b/Nodejs/node_modules/es5-ext/math/asinh/implement.js
new file mode 100644
index 0000000..1c0d7e4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/asinh/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "asinh", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/asinh/index.js b/Nodejs/node_modules/es5-ext/math/asinh/index.js
new file mode 100644
index 0000000..8ca3026
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/asinh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.asinh : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/asinh/is-implemented.js b/Nodejs/node_modules/es5-ext/math/asinh/is-implemented.js
new file mode 100644
index 0000000..a7e0f20
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/asinh/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var asinh = Math.asinh;
+ if (typeof asinh !== "function") return false;
+ return asinh(2) === 1.4436354751788103;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/asinh/shim.js b/Nodejs/node_modules/es5-ext/math/asinh/shim.js
new file mode 100644
index 0000000..30ce2e4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/asinh/shim.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var log = Math.log, sqrt = Math.sqrt;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return value;
+ if (!isFinite(value)) return value;
+ if (value < 0) {
+ value = -value;
+ return -log(value + sqrt(value * value + 1));
+ }
+ return log(value + sqrt(value * value + 1));
+};
diff --git a/Nodejs/node_modules/es5-ext/math/atanh/implement.js b/Nodejs/node_modules/es5-ext/math/atanh/implement.js
new file mode 100644
index 0000000..53f5871
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/atanh/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "atanh", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/atanh/index.js b/Nodejs/node_modules/es5-ext/math/atanh/index.js
new file mode 100644
index 0000000..feff0a7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/atanh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.atanh : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/atanh/is-implemented.js b/Nodejs/node_modules/es5-ext/math/atanh/is-implemented.js
new file mode 100644
index 0000000..4787c4f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/atanh/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var atanh = Math.atanh;
+ if (typeof atanh !== "function") return false;
+ return Math.round(atanh(0.5) * 1e15) === 549306144334055;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/atanh/shim.js b/Nodejs/node_modules/es5-ext/math/atanh/shim.js
new file mode 100644
index 0000000..9383e97
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/atanh/shim.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var log = Math.log;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value < -1) return NaN;
+ if (value > 1) return NaN;
+ if (value === -1) return -Infinity;
+ if (value === 1) return Infinity;
+ if (value === 0) return value;
+ return 0.5 * log((1 + value) / (1 - value));
+};
diff --git a/Nodejs/node_modules/es5-ext/math/cbrt/implement.js b/Nodejs/node_modules/es5-ext/math/cbrt/implement.js
new file mode 100644
index 0000000..826314c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cbrt/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "cbrt", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/cbrt/index.js b/Nodejs/node_modules/es5-ext/math/cbrt/index.js
new file mode 100644
index 0000000..a6c71c6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cbrt/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.cbrt : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/cbrt/is-implemented.js b/Nodejs/node_modules/es5-ext/math/cbrt/is-implemented.js
new file mode 100644
index 0000000..a8ac0db
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cbrt/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var cbrt = Math.cbrt;
+ if (typeof cbrt !== "function") return false;
+ return cbrt(2) === 1.2599210498948732;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/cbrt/shim.js b/Nodejs/node_modules/es5-ext/math/cbrt/shim.js
new file mode 100644
index 0000000..8871c55
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cbrt/shim.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var pow = Math.pow;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return value;
+ if (!isFinite(value)) return value;
+ if (value < 0) return -pow(-value, 1 / 3);
+ return pow(value, 1 / 3);
+};
diff --git a/Nodejs/node_modules/es5-ext/math/ceil-10.js b/Nodejs/node_modules/es5-ext/math/ceil-10.js
new file mode 100644
index 0000000..351221f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/ceil-10.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./_decimal-adjust")("ceil");
diff --git a/Nodejs/node_modules/es5-ext/math/clz32/implement.js b/Nodejs/node_modules/es5-ext/math/clz32/implement.js
new file mode 100644
index 0000000..70562df
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/clz32/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "clz32", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/clz32/index.js b/Nodejs/node_modules/es5-ext/math/clz32/index.js
new file mode 100644
index 0000000..2380335
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/clz32/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.clz32 : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/clz32/is-implemented.js b/Nodejs/node_modules/es5-ext/math/clz32/is-implemented.js
new file mode 100644
index 0000000..ee6d882
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/clz32/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var clz32 = Math.clz32;
+ if (typeof clz32 !== "function") return false;
+ return clz32(1000) === 22;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/clz32/shim.js b/Nodejs/node_modules/es5-ext/math/clz32/shim.js
new file mode 100644
index 0000000..2b526c2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/clz32/shim.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (value) {
+ // eslint-disable-next-line no-bitwise
+ value >>>= 0;
+ return value ? 32 - value.toString(2).length : 32;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/cosh/implement.js b/Nodejs/node_modules/es5-ext/math/cosh/implement.js
new file mode 100644
index 0000000..74e7eea
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cosh/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "cosh", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/cosh/index.js b/Nodejs/node_modules/es5-ext/math/cosh/index.js
new file mode 100644
index 0000000..c7a7167
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cosh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.cosh : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/cosh/is-implemented.js b/Nodejs/node_modules/es5-ext/math/cosh/is-implemented.js
new file mode 100644
index 0000000..7173054
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cosh/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var cosh = Math.cosh;
+ if (typeof cosh !== "function") return false;
+ return cosh(1) === 1.5430806348152437;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/cosh/shim.js b/Nodejs/node_modules/es5-ext/math/cosh/shim.js
new file mode 100644
index 0000000..c762c84
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/cosh/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var exp = Math.exp;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return 1;
+ if (!isFinite(value)) return Infinity;
+ return (exp(value) + exp(-value)) / 2;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/expm1/implement.js b/Nodejs/node_modules/es5-ext/math/expm1/implement.js
new file mode 100644
index 0000000..9739bf5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/expm1/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "expm1", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/expm1/index.js b/Nodejs/node_modules/es5-ext/math/expm1/index.js
new file mode 100644
index 0000000..daf4395
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/expm1/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.expm1 : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/expm1/is-implemented.js b/Nodejs/node_modules/es5-ext/math/expm1/is-implemented.js
new file mode 100644
index 0000000..dfd056e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/expm1/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var expm1 = Math.expm1;
+ if (typeof expm1 !== "function") return false;
+ return expm1(1).toFixed(15) === "1.718281828459045";
+};
diff --git a/Nodejs/node_modules/es5-ext/math/expm1/shim.js b/Nodejs/node_modules/es5-ext/math/expm1/shim.js
new file mode 100644
index 0000000..6daf2bf
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/expm1/shim.js
@@ -0,0 +1,16 @@
+// Thanks: https://github.com/monolithed/ECMAScript-6
+
+"use strict";
+
+var exp = Math.exp;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return value;
+ if (value === Infinity) return Infinity;
+ if (value === -Infinity) return -1;
+
+ if (value > -1.0e-6 && value < 1.0e-6) return value + (value * value) / 2;
+ return exp(value) - 1;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/floor-10.js b/Nodejs/node_modules/es5-ext/math/floor-10.js
new file mode 100644
index 0000000..3cb0c11
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/floor-10.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./_decimal-adjust")("floor");
diff --git a/Nodejs/node_modules/es5-ext/math/fround/implement.js b/Nodejs/node_modules/es5-ext/math/fround/implement.js
new file mode 100644
index 0000000..9ce9cf2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/fround/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "fround", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/fround/index.js b/Nodejs/node_modules/es5-ext/math/fround/index.js
new file mode 100644
index 0000000..9f0dbc0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/fround/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.fround : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/fround/is-implemented.js b/Nodejs/node_modules/es5-ext/math/fround/is-implemented.js
new file mode 100644
index 0000000..ad2b705
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/fround/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var fround = Math.fround;
+ if (typeof fround !== "function") return false;
+ return fround(1.337) === 1.3370000123977661;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/fround/shim.js b/Nodejs/node_modules/es5-ext/math/fround/shim.js
new file mode 100644
index 0000000..b0dfaab
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/fround/shim.js
@@ -0,0 +1,33 @@
+/* global Float32Array */
+
+// Credit: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js
+
+"use strict";
+
+var toFloat32;
+
+if (typeof Float32Array === "undefined") {
+ toFloat32 = (function () {
+ var pack = require("../_pack-ieee754")
+ , unpack = require("../_unpack-ieee754");
+
+ return function (value) { return unpack(pack(value, 8, 23), 8, 23); };
+ })();
+} else {
+ toFloat32 = (function () {
+ var float32Array = new Float32Array(1);
+ return function (num) {
+ float32Array[0] = num;
+ return float32Array[0];
+ };
+ })();
+}
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return value;
+ if (!isFinite(value)) return value;
+
+ return toFloat32(value);
+};
diff --git a/Nodejs/node_modules/es5-ext/math/hypot/implement.js b/Nodejs/node_modules/es5-ext/math/hypot/implement.js
new file mode 100644
index 0000000..e051add
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/hypot/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "hypot", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/hypot/index.js b/Nodejs/node_modules/es5-ext/math/hypot/index.js
new file mode 100644
index 0000000..f8de46b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/hypot/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.hypot : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/hypot/is-implemented.js b/Nodejs/node_modules/es5-ext/math/hypot/is-implemented.js
new file mode 100644
index 0000000..d317bc7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/hypot/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var hypot = Math.hypot;
+ if (typeof hypot !== "function") return false;
+ return hypot(3, 4) === 5;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/hypot/shim.js b/Nodejs/node_modules/es5-ext/math/hypot/shim.js
new file mode 100644
index 0000000..201ba7a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/hypot/shim.js
@@ -0,0 +1,37 @@
+// Thanks for hints: https://github.com/paulmillr/es6-shim
+
+"use strict";
+
+var some = Array.prototype.some
+ , abs = Math.abs
+ , sqrt = Math.sqrt
+ , compare = function (val1, val2) { return val2 - val1; }
+ , divide = function (value) { return value / this; }
+ , add = function (sum, number) { return sum + number * number; };
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (val1, val2/*, …valn*/) {
+ var result, numbers;
+ if (!arguments.length) return 0;
+ some.call(arguments, function (val) {
+ if (isNaN(val)) {
+ result = NaN;
+ return false;
+ }
+ if (!isFinite(val)) {
+ result = Infinity;
+ return true;
+ }
+ if (result !== undefined) return false;
+ val = Number(val);
+ if (val === 0) return false;
+ if (numbers) numbers.push(abs(val));
+ else numbers = [abs(val)];
+ return false;
+ });
+ if (result !== undefined) return result;
+ if (!numbers) return 0;
+
+ numbers.sort(compare);
+ return numbers[0] * sqrt(numbers.map(divide, numbers[0]).reduce(add, 0));
+};
diff --git a/Nodejs/node_modules/es5-ext/math/imul/implement.js b/Nodejs/node_modules/es5-ext/math/imul/implement.js
new file mode 100644
index 0000000..3aff479
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/imul/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "imul", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/imul/index.js b/Nodejs/node_modules/es5-ext/math/imul/index.js
new file mode 100644
index 0000000..969124c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/imul/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.imul : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/imul/is-implemented.js b/Nodejs/node_modules/es5-ext/math/imul/is-implemented.js
new file mode 100644
index 0000000..0f32919
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/imul/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var imul = Math.imul;
+ if (typeof imul !== "function") return false;
+ return imul(-1, 8) === -8;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/imul/shim.js b/Nodejs/node_modules/es5-ext/math/imul/shim.js
new file mode 100644
index 0000000..7511707
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/imul/shim.js
@@ -0,0 +1,17 @@
+/* eslint no-bitwise: "off" */
+
+// Thanks: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
+// /Global_Objects/Math/imul
+
+"use strict";
+
+module.exports = function (val1, val2) {
+ var xh = (val1 >>> 16) & 0xffff
+ , xl = val1 & 0xffff
+ , yh = (val2 >>> 16) & 0xffff
+ , yl = val2 & 0xffff;
+
+ // The shift by 0 fixes the sign on the high part
+ // the final |0 converts the unsigned value into a signed value
+ return (xl * yl + (((xh * yl + xl * yh) << 16) >>> 0)) | 0;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/index.js b/Nodejs/node_modules/es5-ext/math/index.js
new file mode 100644
index 0000000..a59269c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/index.js
@@ -0,0 +1,24 @@
+"use strict";
+
+module.exports = {
+ acosh: require("./acosh"),
+ asinh: require("./asinh"),
+ atanh: require("./atanh"),
+ cbrt: require("./cbrt"),
+ ceil10: require("./ceil-10"),
+ clz32: require("./clz32"),
+ cosh: require("./cosh"),
+ expm1: require("./expm1"),
+ floor10: require("./floor-10"),
+ fround: require("./fround"),
+ hypot: require("./hypot"),
+ imul: require("./imul"),
+ log10: require("./log10"),
+ log2: require("./log2"),
+ log1p: require("./log1p"),
+ round10: require("./round-10"),
+ sign: require("./sign"),
+ sinh: require("./sinh"),
+ tanh: require("./tanh"),
+ trunc: require("./trunc")
+};
diff --git a/Nodejs/node_modules/es5-ext/math/log10/implement.js b/Nodejs/node_modules/es5-ext/math/log10/implement.js
new file mode 100644
index 0000000..f6153c1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log10/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "log10", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/log10/index.js b/Nodejs/node_modules/es5-ext/math/log10/index.js
new file mode 100644
index 0000000..abda55b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log10/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.log10 : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/log10/is-implemented.js b/Nodejs/node_modules/es5-ext/math/log10/is-implemented.js
new file mode 100644
index 0000000..f221759
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log10/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var log10 = Math.log10;
+ if (typeof log10 !== "function") return false;
+ return log10(2) === 0.3010299956639812;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/log10/shim.js b/Nodejs/node_modules/es5-ext/math/log10/shim.js
new file mode 100644
index 0000000..e8599a2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log10/shim.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var log = Math.log, LOG10E = Math.LOG10E;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value < 0) return NaN;
+ if (value === 0) return -Infinity;
+ if (value === 1) return 0;
+ if (value === Infinity) return Infinity;
+
+ return log(value) * LOG10E;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/log1p/implement.js b/Nodejs/node_modules/es5-ext/math/log1p/implement.js
new file mode 100644
index 0000000..21e94e6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log1p/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "log1p", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/log1p/index.js b/Nodejs/node_modules/es5-ext/math/log1p/index.js
new file mode 100644
index 0000000..76eacc5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log1p/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.log1p : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/log1p/is-implemented.js b/Nodejs/node_modules/es5-ext/math/log1p/is-implemented.js
new file mode 100644
index 0000000..7626ab4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log1p/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var log1p = Math.log1p;
+ if (typeof log1p !== "function") return false;
+ return log1p(1) === 0.6931471805599453;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/log1p/shim.js b/Nodejs/node_modules/es5-ext/math/log1p/shim.js
new file mode 100644
index 0000000..15f1182
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log1p/shim.js
@@ -0,0 +1,17 @@
+// Thanks: https://github.com/monolithed/ECMAScript-6/blob/master/ES6.js
+
+"use strict";
+
+var log = Math.log;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value < -1) return NaN;
+ if (value === -1) return -Infinity;
+ if (value === 0) return value;
+ if (value === Infinity) return Infinity;
+
+ if (value > -1.0e-8 && value < 1.0e-8) return value - (value * value) / 2;
+ return log(1 + value);
+};
diff --git a/Nodejs/node_modules/es5-ext/math/log2/implement.js b/Nodejs/node_modules/es5-ext/math/log2/implement.js
new file mode 100644
index 0000000..91c06b1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log2/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "log2", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/log2/index.js b/Nodejs/node_modules/es5-ext/math/log2/index.js
new file mode 100644
index 0000000..a561977
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log2/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.log2 : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/log2/is-implemented.js b/Nodejs/node_modules/es5-ext/math/log2/is-implemented.js
new file mode 100644
index 0000000..c70963f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log2/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var log2 = Math.log2;
+ if (typeof log2 !== "function") return false;
+ return log2(3).toFixed(15) === "1.584962500721156";
+};
diff --git a/Nodejs/node_modules/es5-ext/math/log2/shim.js b/Nodejs/node_modules/es5-ext/math/log2/shim.js
new file mode 100644
index 0000000..51fcdae
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/log2/shim.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var log = Math.log, LOG2E = Math.LOG2E;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value < 0) return NaN;
+ if (value === 0) return -Infinity;
+ if (value === 1) return 0;
+ if (value === Infinity) return Infinity;
+
+ return log(value) * LOG2E;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/round-10.js b/Nodejs/node_modules/es5-ext/math/round-10.js
new file mode 100644
index 0000000..228c235
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/round-10.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./_decimal-adjust")("round");
diff --git a/Nodejs/node_modules/es5-ext/math/sign/implement.js b/Nodejs/node_modules/es5-ext/math/sign/implement.js
new file mode 100644
index 0000000..daf1769
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sign/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "sign", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/sign/index.js b/Nodejs/node_modules/es5-ext/math/sign/index.js
new file mode 100644
index 0000000..d2659cb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sign/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.sign : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/sign/is-implemented.js b/Nodejs/node_modules/es5-ext/math/sign/is-implemented.js
new file mode 100644
index 0000000..4318cf2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sign/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var sign = Math.sign;
+ if (typeof sign !== "function") return false;
+ return sign(10) === 1 && sign(-20) === -1;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/sign/shim.js b/Nodejs/node_modules/es5-ext/math/sign/shim.js
new file mode 100644
index 0000000..9acb495
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sign/shim.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (value) {
+ value = Number(value);
+ if (isNaN(value) || value === 0) return value;
+ return value > 0 ? 1 : -1;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/sinh/implement.js b/Nodejs/node_modules/es5-ext/math/sinh/implement.js
new file mode 100644
index 0000000..4655f6b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sinh/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "sinh", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/sinh/index.js b/Nodejs/node_modules/es5-ext/math/sinh/index.js
new file mode 100644
index 0000000..107ef2e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sinh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.sinh : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/sinh/is-implemented.js b/Nodejs/node_modules/es5-ext/math/sinh/is-implemented.js
new file mode 100644
index 0000000..aad22b0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sinh/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var sinh = Math.sinh;
+ if (typeof sinh !== "function") return false;
+ return sinh(1) === 1.1752011936438014 && sinh(Number.MIN_VALUE) === 5e-324;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/sinh/shim.js b/Nodejs/node_modules/es5-ext/math/sinh/shim.js
new file mode 100644
index 0000000..b161eca
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/sinh/shim.js
@@ -0,0 +1,18 @@
+// Parts of implementation taken from es6-shim project
+// See: https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js
+
+"use strict";
+
+var expm1 = require("../expm1")
+ , abs = Math.abs
+ , exp = Math.exp
+ , e = Math.E;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return value;
+ if (!isFinite(value)) return value;
+ if (abs(value) < 1) return (expm1(value) - expm1(-value)) / 2;
+ return ((exp(value - 1) - exp(-value - 1)) * e) / 2;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/tanh/implement.js b/Nodejs/node_modules/es5-ext/math/tanh/implement.js
new file mode 100644
index 0000000..52d2957
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/tanh/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "tanh", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/tanh/index.js b/Nodejs/node_modules/es5-ext/math/tanh/index.js
new file mode 100644
index 0000000..54b3251
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/tanh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.tanh : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/tanh/is-implemented.js b/Nodejs/node_modules/es5-ext/math/tanh/is-implemented.js
new file mode 100644
index 0000000..b6226b4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/tanh/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var tanh = Math.tanh;
+ if (typeof tanh !== "function") return false;
+ return tanh(1) === 0.7615941559557649 && tanh(Number.MAX_VALUE) === 1;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/tanh/shim.js b/Nodejs/node_modules/es5-ext/math/tanh/shim.js
new file mode 100644
index 0000000..974dd7c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/tanh/shim.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var exp = Math.exp;
+
+module.exports = function (value) {
+ var num1, num2;
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return value;
+ if (value === Infinity) return 1;
+ if (value === -Infinity) return -1;
+ num1 = exp(value);
+ if (num1 === Infinity) return 1;
+ num2 = exp(-value);
+ if (num2 === Infinity) return -1;
+ return (num1 - num2) / (num1 + num2);
+};
diff --git a/Nodejs/node_modules/es5-ext/math/trunc/implement.js b/Nodejs/node_modules/es5-ext/math/trunc/implement.js
new file mode 100644
index 0000000..bf1bf64
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/trunc/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Math, "trunc", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/math/trunc/index.js b/Nodejs/node_modules/es5-ext/math/trunc/index.js
new file mode 100644
index 0000000..8e3874c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/trunc/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Math.trunc : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/math/trunc/is-implemented.js b/Nodejs/node_modules/es5-ext/math/trunc/is-implemented.js
new file mode 100644
index 0000000..861b5c0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/trunc/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var trunc = Math.trunc;
+ if (typeof trunc !== "function") return false;
+ return trunc(13.67) === 13 && trunc(-13.67) === -13;
+};
diff --git a/Nodejs/node_modules/es5-ext/math/trunc/shim.js b/Nodejs/node_modules/es5-ext/math/trunc/shim.js
new file mode 100644
index 0000000..bf6ac8c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/math/trunc/shim.js
@@ -0,0 +1,13 @@
+"use strict";
+
+var floor = Math.floor;
+
+module.exports = function (value) {
+ if (isNaN(value)) return NaN;
+ value = Number(value);
+ if (value === 0) return value;
+ if (value === Infinity) return Infinity;
+ if (value === -Infinity) return -Infinity;
+ if (value > 0) return floor(value);
+ return -floor(-value);
+};
diff --git a/Nodejs/node_modules/es5-ext/number/#/index.js b/Nodejs/node_modules/es5-ext/number/#/index.js
new file mode 100644
index 0000000..50b6418
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/#/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = { pad: require("./pad") };
diff --git a/Nodejs/node_modules/es5-ext/number/#/pad.js b/Nodejs/node_modules/es5-ext/number/#/pad.js
new file mode 100644
index 0000000..aebe236
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/#/pad.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var pad = require("../../string/#/pad")
+ , toPosInt = require("../to-pos-integer")
+ , toFixed = Number.prototype.toFixed;
+
+module.exports = function (length/*, precision*/) {
+ var precision;
+ length = toPosInt(length);
+ precision = toPosInt(arguments[1]);
+
+ return pad.call(
+ precision ? toFixed.call(this, precision) : this, "0",
+ length + (precision ? 1 + precision : 0)
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/number/epsilon/implement.js b/Nodejs/node_modules/es5-ext/number/epsilon/implement.js
new file mode 100644
index 0000000..5a22cf5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/epsilon/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Number, "EPSILON", {
+ value: require("./"),
+ configurable: false,
+ enumerable: false,
+ writable: false
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/number/epsilon/index.js b/Nodejs/node_modules/es5-ext/number/epsilon/index.js
new file mode 100644
index 0000000..12e8a8d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/epsilon/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = 2.220446049250313e-16;
diff --git a/Nodejs/node_modules/es5-ext/number/epsilon/is-implemented.js b/Nodejs/node_modules/es5-ext/number/epsilon/is-implemented.js
new file mode 100644
index 0000000..5ddc9d6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/epsilon/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function () { return typeof Number.EPSILON === "number"; };
diff --git a/Nodejs/node_modules/es5-ext/number/index.js b/Nodejs/node_modules/es5-ext/number/index.js
new file mode 100644
index 0000000..b57ff15
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/index.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = {
+ "#": require("./#"),
+ "EPSILON": require("./epsilon"),
+ "isFinite": require("./is-finite"),
+ "isInteger": require("./is-integer"),
+ "isNaN": require("./is-nan"),
+ "isNatural": require("./is-natural"),
+ "isNumber": require("./is-number"),
+ "isSafeInteger": require("./is-safe-integer"),
+ "MAX_SAFE_INTEGER": require("./max-safe-integer"),
+ "MIN_SAFE_INTEGER": require("./min-safe-integer"),
+ "toInteger": require("./to-integer"),
+ "toPosInteger": require("./to-pos-integer"),
+ "toUint32": require("./to-uint32")
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-finite/implement.js b/Nodejs/node_modules/es5-ext/number/is-finite/implement.js
new file mode 100644
index 0000000..41109fb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-finite/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Number, "isFinite", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/number/is-finite/index.js b/Nodejs/node_modules/es5-ext/number/is-finite/index.js
new file mode 100644
index 0000000..f3a7112
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-finite/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Number.isFinite : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/number/is-finite/is-implemented.js b/Nodejs/node_modules/es5-ext/number/is-finite/is-implemented.js
new file mode 100644
index 0000000..eadd050
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-finite/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var numberIsFinite = Number.isFinite;
+ if (typeof numberIsFinite !== "function") return false;
+ return !numberIsFinite("23") && numberIsFinite(34) && !numberIsFinite(Infinity);
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-finite/shim.js b/Nodejs/node_modules/es5-ext/number/is-finite/shim.js
new file mode 100644
index 0000000..ce700f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-finite/shim.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (value) { return typeof value === "number" && isFinite(value); };
diff --git a/Nodejs/node_modules/es5-ext/number/is-integer/implement.js b/Nodejs/node_modules/es5-ext/number/is-integer/implement.js
new file mode 100644
index 0000000..48b4cd2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-integer/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Number, "isInteger", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/number/is-integer/index.js b/Nodejs/node_modules/es5-ext/number/is-integer/index.js
new file mode 100644
index 0000000..2805b11
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Number.isInteger : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/number/is-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/number/is-integer/is-implemented.js
new file mode 100644
index 0000000..f357c71
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-integer/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var isInteger = Number.isInteger;
+ if (typeof isInteger !== "function") return false;
+ return !isInteger("23") && isInteger(34) && !isInteger(32.34);
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-integer/shim.js b/Nodejs/node_modules/es5-ext/number/is-integer/shim.js
new file mode 100644
index 0000000..12058b5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-integer/shim.js
@@ -0,0 +1,8 @@
+// Credit: http://www.2ality.com/2014/05/is-integer.html
+
+"use strict";
+
+module.exports = function (value) {
+ if (typeof value !== "number") return false;
+ return value % 1 === 0;
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-nan/implement.js b/Nodejs/node_modules/es5-ext/number/is-nan/implement.js
new file mode 100644
index 0000000..f704e4c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-nan/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Number, "isNaN", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/number/is-nan/index.js b/Nodejs/node_modules/es5-ext/number/is-nan/index.js
new file mode 100644
index 0000000..2cec8fc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-nan/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Number.isNaN : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/number/is-nan/is-implemented.js b/Nodejs/node_modules/es5-ext/number/is-nan/is-implemented.js
new file mode 100644
index 0000000..756838a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-nan/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var numberIsNaN = Number.isNaN;
+ if (typeof numberIsNaN !== "function") return false;
+ return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-nan/shim.js b/Nodejs/node_modules/es5-ext/number/is-nan/shim.js
new file mode 100644
index 0000000..b5730d1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-nan/shim.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (value) {
+ // eslint-disable-next-line no-self-compare
+ return value !== value;
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-natural.js b/Nodejs/node_modules/es5-ext/number/is-natural.js
new file mode 100644
index 0000000..2bbb5a2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-natural.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isInteger = require("./is-integer");
+
+module.exports = function (num) { return isInteger(num) && num >= 0; };
diff --git a/Nodejs/node_modules/es5-ext/number/is-number.js b/Nodejs/node_modules/es5-ext/number/is-number.js
new file mode 100644
index 0000000..3da0712
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-number.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var objToString = Object.prototype.toString, id = objToString.call(1);
+
+module.exports = function (value) {
+ return (
+ typeof value === "number" ||
+ (value instanceof Number || (typeof value === "object" && objToString.call(value) === id))
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-safe-integer/implement.js b/Nodejs/node_modules/es5-ext/number/is-safe-integer/implement.js
new file mode 100644
index 0000000..571b214
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-safe-integer/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Number, "isSafeInteger", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/number/is-safe-integer/index.js b/Nodejs/node_modules/es5-ext/number/is-safe-integer/index.js
new file mode 100644
index 0000000..26c2b9f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-safe-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Number.isSafeInteger : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/number/is-safe-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/number/is-safe-integer/is-implemented.js
new file mode 100644
index 0000000..5ed3763
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-safe-integer/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var isSafeInteger = Number.isSafeInteger;
+ if (typeof isSafeInteger !== "function") return false;
+ return !isSafeInteger("23") && isSafeInteger(34232322323) && !isSafeInteger(9007199254740992);
+};
diff --git a/Nodejs/node_modules/es5-ext/number/is-safe-integer/shim.js b/Nodejs/node_modules/es5-ext/number/is-safe-integer/shim.js
new file mode 100644
index 0000000..fb4f4d5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/is-safe-integer/shim.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var isInteger = require("../is-integer/shim")
+ , maxValue = require("../max-safe-integer")
+ , abs = Math.abs;
+
+module.exports = function (value) {
+ if (!isInteger(value)) return false;
+ return abs(value) <= maxValue;
+};
diff --git a/Nodejs/node_modules/es5-ext/number/max-safe-integer/implement.js b/Nodejs/node_modules/es5-ext/number/max-safe-integer/implement.js
new file mode 100644
index 0000000..4ee3231
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/max-safe-integer/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Number, "MAX_SAFE_INTEGER", {
+ value: require("./"),
+ configurable: false,
+ enumerable: false,
+ writable: false
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/number/max-safe-integer/index.js b/Nodejs/node_modules/es5-ext/number/max-safe-integer/index.js
new file mode 100644
index 0000000..75a41e7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/max-safe-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = Math.pow(2, 53) - 1;
diff --git a/Nodejs/node_modules/es5-ext/number/max-safe-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/number/max-safe-integer/is-implemented.js
new file mode 100644
index 0000000..3d6e914
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/max-safe-integer/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function () { return typeof Number.MAX_SAFE_INTEGER === "number"; };
diff --git a/Nodejs/node_modules/es5-ext/number/min-safe-integer/implement.js b/Nodejs/node_modules/es5-ext/number/min-safe-integer/implement.js
new file mode 100644
index 0000000..979dc39
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/min-safe-integer/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Number, "MIN_SAFE_INTEGER", {
+ value: require("./"),
+ configurable: false,
+ enumerable: false,
+ writable: false
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/number/min-safe-integer/index.js b/Nodejs/node_modules/es5-ext/number/min-safe-integer/index.js
new file mode 100644
index 0000000..cde4514
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/min-safe-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = -(Math.pow(2, 53) - 1);
diff --git a/Nodejs/node_modules/es5-ext/number/min-safe-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/number/min-safe-integer/is-implemented.js
new file mode 100644
index 0000000..71e6a31
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/min-safe-integer/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function () { return typeof Number.MIN_SAFE_INTEGER === "number"; };
diff --git a/Nodejs/node_modules/es5-ext/number/to-integer.js b/Nodejs/node_modules/es5-ext/number/to-integer.js
new file mode 100644
index 0000000..4df5572
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/to-integer.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var sign = require("../math/sign")
+ , abs = Math.abs
+ , floor = Math.floor;
+
+module.exports = function (value) {
+ if (isNaN(value)) return 0;
+ value = Number(value);
+ if (value === 0 || !isFinite(value)) return value;
+ return sign(value) * floor(abs(value));
+};
diff --git a/Nodejs/node_modules/es5-ext/number/to-pos-integer.js b/Nodejs/node_modules/es5-ext/number/to-pos-integer.js
new file mode 100644
index 0000000..28f6d40
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/to-pos-integer.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var toInteger = require("./to-integer")
+ , max = Math.max;
+
+module.exports = function (value) { return max(0, toInteger(value)); };
diff --git a/Nodejs/node_modules/es5-ext/number/to-uint32.js b/Nodejs/node_modules/es5-ext/number/to-uint32.js
new file mode 100644
index 0000000..cb3590a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/number/to-uint32.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (value) {
+ // eslint-disable-next-line no-bitwise
+ return value >>> 0;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/_iterate.js b/Nodejs/node_modules/es5-ext/object/_iterate.js
new file mode 100644
index 0000000..0a64fdb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/_iterate.js
@@ -0,0 +1,30 @@
+// Internal method, used by iteration functions.
+// Calls a function for each key-value pair found in object
+// Optionally takes compareFn to iterate object in specific order
+
+"use strict";
+
+var callable = require("./valid-callable")
+ , value = require("./valid-value")
+ , bind = Function.prototype.bind
+ , call = Function.prototype.call
+ , keys = Object.keys
+ , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+module.exports = function (method, defVal) {
+ return function (obj, cb/*, thisArg, compareFn*/) {
+ var list, thisArg = arguments[2], compareFn = arguments[3];
+ obj = Object(value(obj));
+ callable(cb);
+
+ list = keys(obj);
+ if (compareFn) {
+ list.sort(typeof compareFn === "function" ? bind.call(compareFn, obj) : undefined);
+ }
+ if (typeof method !== "function") method = list[method];
+ return call.call(method, list, function (key, index) {
+ if (!objPropertyIsEnumerable.call(obj, key)) return defVal;
+ return call.call(cb, thisArg, obj[key], key, obj, index);
+ });
+ };
+};
diff --git a/Nodejs/node_modules/es5-ext/object/assign-deep.js b/Nodejs/node_modules/es5-ext/object/assign-deep.js
new file mode 100644
index 0000000..4a8597a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/assign-deep.js
@@ -0,0 +1,34 @@
+"use strict";
+
+var includes = require("../array/#/contains")
+ , uniq = require("../array/#/uniq")
+ , copyDeep = require("./copy-deep")
+ , objForEach = require("./for-each")
+ , isPlainObject = require("./is-plain-object")
+ , ensureValue = require("./valid-value");
+
+var isArray = Array.isArray, slice = Array.prototype.slice;
+
+var deepAssign = function (target, source) {
+ if (target === source) return target;
+ if (isPlainObject(target) && isPlainObject(source)) {
+ objForEach(source, function (value, key) { target[key] = deepAssign(target[key], value); });
+ return target;
+ }
+ if (isArray(target) && isArray(source)) {
+ source.forEach(function (item) {
+ if (includes.call(target, item)) return;
+ if (isArray(item) || isPlainObject(item)) item = copyDeep(item);
+ target.push(item);
+ });
+ return target;
+ }
+ if (isPlainObject(source) || isArray(source)) return copyDeep(source);
+ return source;
+};
+
+module.exports = function (target/*, ...objects*/) {
+ return uniq
+ .call([ensureValue(target)].concat(slice.call(arguments, 1).map(ensureValue)))
+ .reduce(deepAssign);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/assign/implement.js b/Nodejs/node_modules/es5-ext/object/assign/implement.js
new file mode 100644
index 0000000..f20371d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/assign/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Object, "assign", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/object/assign/index.js b/Nodejs/node_modules/es5-ext/object/assign/index.js
new file mode 100644
index 0000000..9585b55
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/assign/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Object.assign : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/object/assign/is-implemented.js b/Nodejs/node_modules/es5-ext/object/assign/is-implemented.js
new file mode 100644
index 0000000..8bf71ae
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/assign/is-implemented.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function () {
+ var assign = Object.assign, obj;
+ if (typeof assign !== "function") return false;
+ obj = { foo: "raz" };
+ assign(obj, { bar: "dwa" }, { trzy: "trzy" });
+ return obj.foo + obj.bar + obj.trzy === "razdwatrzy";
+};
diff --git a/Nodejs/node_modules/es5-ext/object/assign/shim.js b/Nodejs/node_modules/es5-ext/object/assign/shim.js
new file mode 100644
index 0000000..ad1804d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/assign/shim.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var keys = require("../keys")
+ , value = require("../valid-value")
+ , max = Math.max;
+
+module.exports = function (dest, src/*, …srcn*/) {
+ var error, i, length = max(arguments.length, 2), assign;
+ dest = Object(value(dest));
+ assign = function (key) {
+ try {
+ dest[key] = src[key];
+ } catch (e) {
+ if (!error) error = e;
+ }
+ };
+ for (i = 1; i < length; ++i) {
+ src = arguments[i];
+ keys(src).forEach(assign);
+ }
+ if (error !== undefined) throw error;
+ return dest;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/clear.js b/Nodejs/node_modules/es5-ext/object/clear.js
new file mode 100644
index 0000000..268cc5b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/clear.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var keys = require("./keys");
+
+module.exports = function (obj) {
+ var error;
+ keys(obj).forEach(function (key) {
+ try {
+ delete this[key];
+ } catch (e) {
+ if (!error) error = e;
+ }
+ }, obj);
+ if (error !== undefined) throw error;
+ return obj;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/compact.js b/Nodejs/node_modules/es5-ext/object/compact.js
new file mode 100644
index 0000000..a1794bb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/compact.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var filter = require("./filter")
+ , isValue = require("./is-value");
+
+module.exports = function (obj) {
+ return filter(obj, function (val) { return isValue(val); });
+};
diff --git a/Nodejs/node_modules/es5-ext/object/compare.js b/Nodejs/node_modules/es5-ext/object/compare.js
new file mode 100644
index 0000000..261a732
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/compare.js
@@ -0,0 +1,39 @@
+"use strict";
+
+var strCompare = require("../string/#/case-insensitive-compare")
+ , isObject = require("./is-object")
+ , isValue = require("./is-value")
+ , numIsNaN = require("../number/is-nan")
+ , resolve
+ , typeMap;
+
+typeMap = { undefined: 0, object: 1, boolean: 2, string: 3, number: 4 };
+
+resolve = function (a) {
+ if (isObject(a)) {
+ if (typeof a.valueOf !== "function") return NaN;
+ a = a.valueOf();
+ if (isObject(a)) {
+ if (typeof a.toString !== "function") return NaN;
+ a = a.toString();
+ if (typeof a !== "string") return NaN;
+ }
+ }
+ return a;
+};
+
+module.exports = function (val1, val2) {
+ if (val1 === val2) return 0; // Same
+
+ val1 = resolve(val1);
+ val2 = resolve(val2);
+ // eslint-disable-next-line eqeqeq
+ if (val1 == val2) return typeMap[typeof val1] - typeMap[typeof val2];
+ if (!isValue(val1)) return -1;
+ if (!isValue(val2)) return 1;
+ if (typeof val1 === "string" || typeof val2 === "string") {
+ return strCompare.call(val1, val2);
+ }
+ if (numIsNaN(val1) && numIsNaN(val2)) return 0; // Jslint: ignore
+ return Number(val1) - Number(val2);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/copy-deep.js b/Nodejs/node_modules/es5-ext/object/copy-deep.js
new file mode 100644
index 0000000..1d1bed2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/copy-deep.js
@@ -0,0 +1,35 @@
+"use strict";
+
+var forEach = require("./for-each")
+ , isPlainObject = require("./is-plain-object")
+ , ensureValue = require("./valid-value")
+ , isArray = Array.isArray;
+
+var copyValue = function (value, ancestors, ancestorsCopy) {
+ var mode;
+ if (isPlainObject(value)) mode = "object";
+ else if (isArray(value)) mode = "array";
+ if (!mode) return value;
+
+ var copy = ancestorsCopy[ancestors.indexOf(value)];
+ if (copy) return copy;
+ copy = mode === "object" ? {} : [];
+
+ ancestors.push(value);
+ ancestorsCopy.push(copy);
+ if (mode === "object") {
+ forEach(value, function (item, key) {
+ copy[key] = copyValue(item, ancestors, ancestorsCopy);
+ });
+ } else {
+ value.forEach(function (item, index) {
+ copy[index] = copyValue(item, ancestors, ancestorsCopy);
+ });
+ }
+ ancestors.pop();
+ ancestorsCopy.pop();
+
+ return copy;
+};
+
+module.exports = function (source) { return copyValue(ensureValue(source), [], []); };
diff --git a/Nodejs/node_modules/es5-ext/object/copy.js b/Nodejs/node_modules/es5-ext/object/copy.js
new file mode 100644
index 0000000..5368e42
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/copy.js
@@ -0,0 +1,19 @@
+"use strict";
+
+var aFrom = require("../array/from")
+ , assign = require("./assign")
+ , value = require("./valid-value");
+
+module.exports = function (obj/*, propertyNames, options*/) {
+ var copy = Object(value(obj)), propertyNames = arguments[1], options = Object(arguments[2]);
+ if (copy !== obj && !propertyNames) return copy;
+ var result = {};
+ if (propertyNames) {
+ aFrom(propertyNames, function (propertyName) {
+ if (options.ensure || propertyName in obj) result[propertyName] = obj[propertyName];
+ });
+ } else {
+ assign(result, obj);
+ }
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/count.js b/Nodejs/node_modules/es5-ext/object/count.js
new file mode 100644
index 0000000..6c018bb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/count.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var keys = require("./keys");
+
+module.exports = function (obj) { return keys(obj).length; };
diff --git a/Nodejs/node_modules/es5-ext/object/create.js b/Nodejs/node_modules/es5-ext/object/create.js
new file mode 100644
index 0000000..a391ec1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/create.js
@@ -0,0 +1,43 @@
+// Workaround for http://code.google.com/p/v8/issues/detail?id=2804
+
+"use strict";
+
+var create = Object.create, shim;
+
+if (!require("./set-prototype-of/is-implemented")()) {
+ shim = require("./set-prototype-of/shim");
+}
+
+module.exports = (function () {
+ var nullObject, polyProps, desc;
+ if (!shim) return create;
+ if (shim.level !== 1) return create;
+
+ nullObject = {};
+ polyProps = {};
+ desc = { configurable: false, enumerable: false, writable: true, value: undefined };
+ Object.getOwnPropertyNames(Object.prototype).forEach(function (name) {
+ if (name === "__proto__") {
+ polyProps[name] = {
+ configurable: true,
+ enumerable: false,
+ writable: true,
+ value: undefined
+ };
+ return;
+ }
+ polyProps[name] = desc;
+ });
+ Object.defineProperties(nullObject, polyProps);
+
+ Object.defineProperty(shim, "nullPolyfill", {
+ configurable: false,
+ enumerable: false,
+ writable: false,
+ value: nullObject
+ });
+
+ return function (prototype, props) {
+ return create(prototype === null ? nullObject : prototype, props);
+ };
+})();
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-array.js b/Nodejs/node_modules/es5-ext/object/ensure-array.js
new file mode 100644
index 0000000..5ca7a94
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-array.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var toShortString = require("../to-short-string-representation")
+ , isArray = require("./is-array-like");
+
+module.exports = function (value) {
+ if (isArray(value)) return value;
+ throw new TypeError(toShortString(value) + " is not a array");
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-finite-number.js b/Nodejs/node_modules/es5-ext/object/ensure-finite-number.js
new file mode 100644
index 0000000..4f6e4b4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-finite-number.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var isFiniteNumber = require("./is-finite-number")
+ , safeToString = require("../safe-to-string");
+
+module.exports = function (value) {
+ if (isFiniteNumber(value)) return Number(value);
+ throw new TypeError(safeToString(value) + " does not represent a finite number value");
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-integer.js b/Nodejs/node_modules/es5-ext/object/ensure-integer.js
new file mode 100644
index 0000000..9ec64b5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-integer.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var toShortString = require("../to-short-string-representation")
+ , isInteger = require("./is-integer");
+
+module.exports = function (num) {
+ if (!isInteger(num)) throw new TypeError(toShortString(num) + " is not a integer");
+ return Number(num);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-natural-number-value.js b/Nodejs/node_modules/es5-ext/object/ensure-natural-number-value.js
new file mode 100644
index 0000000..1a901aa
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-natural-number-value.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var isNaturalValue = require("./is-natural-number-value")
+ , toShortString = require("../to-short-string-representation");
+
+module.exports = function (arg) {
+ var num = Number(arg);
+ if (!isNaturalValue(arg)) throw new TypeError(toShortString(arg) + " is not a natural number");
+ return num;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-natural-number.js b/Nodejs/node_modules/es5-ext/object/ensure-natural-number.js
new file mode 100644
index 0000000..ec7e514
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-natural-number.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var isNatural = require("../number/is-natural")
+ , toShortString = require("../to-short-string-representation");
+
+module.exports = function (arg) {
+ var num = Number(arg);
+ if (!isNatural(num)) throw new TypeError(toShortString(arg) + " is not a natural number");
+ return num;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-plain-function.js b/Nodejs/node_modules/es5-ext/object/ensure-plain-function.js
new file mode 100644
index 0000000..6cd9853
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-plain-function.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var safeToString = require("../safe-to-string")
+ , isPlainFunction = require("./is-plain-function");
+
+module.exports = function (value) {
+ if (!isPlainFunction(value)) {
+ throw new TypeError(safeToString(value) + " is not a plain function");
+ }
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-plain-object.js b/Nodejs/node_modules/es5-ext/object/ensure-plain-object.js
new file mode 100644
index 0000000..7fb2b93
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-plain-object.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var safeToString = require("../safe-to-string")
+ , isPlainObject = require("./is-plain-object");
+
+module.exports = function (value) {
+ if (!isPlainObject(value)) throw new TypeError(safeToString(value) + " is not a plain object");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-promise.js b/Nodejs/node_modules/es5-ext/object/ensure-promise.js
new file mode 100644
index 0000000..b5b5356
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-promise.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var safeToString = require("../safe-to-string")
+ , isPromise = require("./is-promise");
+
+module.exports = function (value) {
+ if (!isPromise(value)) throw new TypeError(safeToString(value) + " is not a promise");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/ensure-thenable.js b/Nodejs/node_modules/es5-ext/object/ensure-thenable.js
new file mode 100644
index 0000000..c55c17a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/ensure-thenable.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var safeToString = require("../safe-to-string")
+ , isThenable = require("./is-thenable");
+
+module.exports = function (value) {
+ if (!isThenable(value)) throw new TypeError(safeToString(value) + " is not a thenable");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/entries/implement.js b/Nodejs/node_modules/es5-ext/object/entries/implement.js
new file mode 100644
index 0000000..5c2a246
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/entries/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Object, "entries", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/object/entries/index.js b/Nodejs/node_modules/es5-ext/object/entries/index.js
new file mode 100644
index 0000000..4a297d6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/entries/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Object.entries : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/object/entries/is-implemented.js b/Nodejs/node_modules/es5-ext/object/entries/is-implemented.js
new file mode 100644
index 0000000..aad52b2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/entries/is-implemented.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function () {
+ try { return Object.entries({ foo: 12 })[0][0] === "foo"; }
+ catch (e) { return false; }
+};
diff --git a/Nodejs/node_modules/es5-ext/object/entries/shim.js b/Nodejs/node_modules/es5-ext/object/entries/shim.js
new file mode 100644
index 0000000..2348e44
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/entries/shim.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var ensureValue = require("../valid-value");
+
+module.exports = function (object) {
+ ensureValue(object);
+ var result = [];
+ object = Object(object);
+ for (var key in object) {
+ if (!propertyIsEnumerable.call(object, key)) continue;
+ result.push([key, object[key]]);
+ }
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/eq.js b/Nodejs/node_modules/es5-ext/object/eq.js
new file mode 100644
index 0000000..0312468
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/eq.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var numIsNaN = require("../number/is-nan");
+
+module.exports = function (val1, val2) {
+ return val1 === val2 || (numIsNaN(val1) && numIsNaN(val2));
+};
diff --git a/Nodejs/node_modules/es5-ext/object/every.js b/Nodejs/node_modules/es5-ext/object/every.js
new file mode 100644
index 0000000..892b548
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/every.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./_iterate")("every", true);
diff --git a/Nodejs/node_modules/es5-ext/object/filter.js b/Nodejs/node_modules/es5-ext/object/filter.js
new file mode 100644
index 0000000..5c1ed92
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/filter.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var callable = require("./valid-callable")
+ , forEach = require("./for-each")
+ , call = Function.prototype.call;
+
+module.exports = function (obj, cb/*, thisArg*/) {
+ var result = {}, thisArg = arguments[2];
+ callable(cb);
+ forEach(obj, function (value, key, targetObj, index) {
+ if (call.call(cb, thisArg, value, key, targetObj, index)) result[key] = targetObj[key];
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/find-key.js b/Nodejs/node_modules/es5-ext/object/find-key.js
new file mode 100644
index 0000000..6da6ba6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/find-key.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./_iterate")(require("../array/#/find"), false);
diff --git a/Nodejs/node_modules/es5-ext/object/find.js b/Nodejs/node_modules/es5-ext/object/find.js
new file mode 100644
index 0000000..650375b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/find.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var findKey = require("./find-key")
+ , isValue = require("./is-value");
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (obj, cb/*, thisArg, compareFn*/) {
+ var key = findKey.apply(this, arguments);
+ return isValue(key) ? obj[key] : key;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/first-key.js b/Nodejs/node_modules/es5-ext/object/first-key.js
new file mode 100644
index 0000000..3666de5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/first-key.js
@@ -0,0 +1,13 @@
+"use strict";
+
+var value = require("./valid-value")
+ , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+module.exports = function (obj) {
+ var i;
+ value(obj);
+ for (i in obj) {
+ if (objPropertyIsEnumerable.call(obj, i)) return i;
+ }
+ return null;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/flatten.js b/Nodejs/node_modules/es5-ext/object/flatten.js
new file mode 100644
index 0000000..cda7475
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/flatten.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var isPlainObject = require("./is-plain-object")
+ , forEach = require("./for-each")
+ , process;
+
+process = function self(value, key) {
+ if (isPlainObject(value)) forEach(value, self, this);
+ else this[key] = value;
+};
+
+module.exports = function (obj) {
+ var flattened = {};
+ forEach(obj, process, flattened);
+ return flattened;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/for-each.js b/Nodejs/node_modules/es5-ext/object/for-each.js
new file mode 100644
index 0000000..d282956
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/for-each.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./_iterate")("forEach");
diff --git a/Nodejs/node_modules/es5-ext/object/get-property-names.js b/Nodejs/node_modules/es5-ext/object/get-property-names.js
new file mode 100644
index 0000000..7dfef27
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/get-property-names.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var uniq = require("../array/#/uniq")
+ , value = require("./valid-value")
+ , push = Array.prototype.push
+ , getOwnPropertyNames = Object.getOwnPropertyNames
+ , getPrototypeOf = Object.getPrototypeOf;
+
+module.exports = function (obj) {
+ var keys;
+ obj = Object(value(obj));
+ keys = getOwnPropertyNames(obj);
+ while ((obj = getPrototypeOf(obj))) {
+ push.apply(keys, getOwnPropertyNames(obj));
+ }
+ return uniq.call(keys);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/index.js b/Nodejs/node_modules/es5-ext/object/index.js
new file mode 100644
index 0000000..13cfb95
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/index.js
@@ -0,0 +1,70 @@
+"use strict";
+
+module.exports = {
+ assign: require("./assign"),
+ assignDeep: require("./assign-deep"),
+ clear: require("./clear"),
+ compact: require("./compact"),
+ compare: require("./compare"),
+ copy: require("./copy"),
+ copyDeep: require("./copy-deep"),
+ count: require("./count"),
+ create: require("./create"),
+ ensureArray: require("./ensure-array"),
+ ensureFiniteNumber: require("./ensure-finite-number"),
+ ensureInteger: require("./ensure-integer"),
+ ensureNaturalNumber: require("./ensure-natural-number"),
+ ensureNaturalNumberValue: require("./ensure-natural-number-value"),
+ ensurePlainFunction: require("./ensure-plain-function"),
+ ensurePlainObject: require("./ensure-plain-object"),
+ ensurePromise: require("./ensure-promise"),
+ ensureThenable: require("./ensure-thenable"),
+ entries: require("./entries"),
+ eq: require("./eq"),
+ every: require("./every"),
+ filter: require("./filter"),
+ find: require("./find"),
+ findKey: require("./find-key"),
+ firstKey: require("./first-key"),
+ flatten: require("./flatten"),
+ forEach: require("./for-each"),
+ getPropertyNames: require("./get-property-names"),
+ is: require("./is"),
+ isArrayLike: require("./is-array-like"),
+ isCallable: require("./is-callable"),
+ isCopy: require("./is-copy"),
+ isCopyDeep: require("./is-copy-deep"),
+ isEmpty: require("./is-empty"),
+ isFiniteNumber: require("./is-finite-number"),
+ isInteger: require("./is-integer"),
+ isNaturalNumber: require("./is-natural-number"),
+ isNaturalNumberValue: require("./is-natural-number-value"),
+ isNumberValue: require("./is-number-value"),
+ isObject: require("./is-object"),
+ isPlainFunction: require("./is-plain-function"),
+ isPlainObject: require("./is-plain-object"),
+ isPromise: require("./is-promise"),
+ isThenable: require("./is-thenable"),
+ isValue: require("./is-value"),
+ keyOf: require("./key-of"),
+ keys: require("./keys"),
+ map: require("./map"),
+ mapKeys: require("./map-keys"),
+ normalizeOptions: require("./normalize-options"),
+ mixin: require("./mixin"),
+ mixinPrototypes: require("./mixin-prototypes"),
+ primitiveSet: require("./primitive-set"),
+ safeTraverse: require("./safe-traverse"),
+ serialize: require("./serialize"),
+ setPrototypeOf: require("./set-prototype-of"),
+ some: require("./some"),
+ toArray: require("./to-array"),
+ unserialize: require("./unserialize"),
+ validateArrayLike: require("./validate-array-like"),
+ validateArrayLikeObject: require("./validate-array-like-object"),
+ validCallable: require("./valid-callable"),
+ validObject: require("./valid-object"),
+ validateStringifiable: require("./validate-stringifiable"),
+ validateStringifiableValue: require("./validate-stringifiable-value"),
+ validValue: require("./valid-value")
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-array-like.js b/Nodejs/node_modules/es5-ext/object/is-array-like.js
new file mode 100644
index 0000000..fcb9115
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-array-like.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var isFunction = require("../function/is-function")
+ , isObject = require("./is-object")
+ , isValue = require("./is-value");
+
+module.exports = function (value) {
+ return (
+ (isValue(value) &&
+ typeof value.length === "number" &&
+ // Just checking ((typeof x === 'object') && (typeof x !== 'function'))
+ // won't work right for some cases, e.g.:
+ // type of instance of NodeList in Safari is a 'function'
+ ((isObject(value) && !isFunction(value)) || typeof value === "string")) ||
+ false
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-callable.js b/Nodejs/node_modules/es5-ext/object/is-callable.js
new file mode 100644
index 0000000..927e5e8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-callable.js
@@ -0,0 +1,5 @@
+// Deprecated
+
+"use strict";
+
+module.exports = function (obj) { return typeof obj === "function"; };
diff --git a/Nodejs/node_modules/es5-ext/object/is-copy-deep.js b/Nodejs/node_modules/es5-ext/object/is-copy-deep.js
new file mode 100644
index 0000000..a1206ae
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-copy-deep.js
@@ -0,0 +1,59 @@
+"use strict";
+
+var eq = require("./eq")
+ , isPlainObject = require("./is-plain-object")
+ , value = require("./valid-value");
+
+var isArray = Array.isArray
+ , keys = Object.keys
+ , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable
+ , objHasOwnProperty = Object.prototype.hasOwnProperty
+ , eqArr
+ , eqVal
+ , eqObj;
+
+eqArr = function (arr1, arr2, recMap) {
+ var i, length = arr1.length;
+ if (length !== arr2.length) return false;
+ for (i = 0; i < length; ++i) {
+ if (objHasOwnProperty.call(arr1, i) !== objHasOwnProperty.call(arr2, i)) return false;
+ if (!eqVal(arr1[i], arr2[i], recMap)) return false;
+ }
+ return true;
+};
+
+eqObj = function (obj1, obj2, recMap) {
+ var k1 = keys(obj1), k2 = keys(obj2);
+ if (k1.length !== k2.length) return false;
+ return k1.every(function (key) {
+ if (!objPropertyIsEnumerable.call(obj2, key)) return false;
+ return eqVal(obj1[key], obj2[key], recMap);
+ });
+};
+
+eqVal = function (val1, val2, recMap) {
+ var i, eqX, c1, c2;
+ if (eq(val1, val2)) return true;
+ if (isPlainObject(val1)) {
+ if (!isPlainObject(val2)) return false;
+ eqX = eqObj;
+ } else if (isArray(val1) && isArray(val2)) {
+ eqX = eqArr;
+ } else {
+ return false;
+ }
+ c1 = recMap[0];
+ c2 = recMap[1];
+ i = c1.indexOf(val1);
+ if (i === -1) {
+ i = c1.push(val1) - 1;
+ c2[i] = [];
+ } else if (c2[i].indexOf(val2) !== -1) return true;
+ c2[i].push(val2);
+ return eqX(val1, val2, recMap);
+};
+
+module.exports = function (val1, val2) {
+ if (eq(value(val1), value(val2))) return true;
+ return eqVal(Object(val1), Object(val2), [[], []]);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-copy.js b/Nodejs/node_modules/es5-ext/object/is-copy.js
new file mode 100644
index 0000000..8c6ae5e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-copy.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var eq = require("./eq")
+ , value = require("./valid-value")
+ , keys = Object.keys
+ , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+module.exports = function (val1, val2) {
+ var k1, k2;
+
+ if (eq(value(val1), value(val2))) return true;
+
+ val1 = Object(val1);
+ val2 = Object(val2);
+
+ k1 = keys(val1);
+ k2 = keys(val2);
+ if (k1.length !== k2.length) return false;
+ return k1.every(function (key) {
+ if (!objPropertyIsEnumerable.call(val2, key)) return false;
+ return eq(val1[key], val2[key]);
+ });
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-empty.js b/Nodejs/node_modules/es5-ext/object/is-empty.js
new file mode 100644
index 0000000..dbc52d0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-empty.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var value = require("./valid-value")
+ , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+module.exports = function (obj) {
+ var i;
+ value(obj);
+ for (i in obj) {
+ // Jslint: ignore
+ if (objPropertyIsEnumerable.call(obj, i)) return false;
+ }
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-finite-number.js b/Nodejs/node_modules/es5-ext/object/is-finite-number.js
new file mode 100644
index 0000000..e016f8d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-finite-number.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isNumber = require("./is-number-value");
+
+module.exports = function (value) { return isNumber(value) && isFinite(value); };
diff --git a/Nodejs/node_modules/es5-ext/object/is-integer.js b/Nodejs/node_modules/es5-ext/object/is-integer.js
new file mode 100644
index 0000000..1745b82
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-integer.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var isInteger = require("../number/is-integer")
+ , isValue = require("./is-value");
+
+module.exports = function (arg) {
+ if (!isValue(arg)) return false;
+ arg = Number(arg);
+ return isInteger(arg);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-natural-number-value.js b/Nodejs/node_modules/es5-ext/object/is-natural-number-value.js
new file mode 100644
index 0000000..c744521
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-natural-number-value.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var isNaturalNumber = require("./is-natural-number")
+ , isValue = require("./is-value");
+
+module.exports = function (arg) {
+ if (!isValue(arg)) return false;
+ return isNaturalNumber(arg);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-natural-number.js b/Nodejs/node_modules/es5-ext/object/is-natural-number.js
new file mode 100644
index 0000000..3e2c1f5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-natural-number.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isNatural = require("../number/is-natural");
+
+module.exports = function (arg) { return isNatural(Number(arg)); };
diff --git a/Nodejs/node_modules/es5-ext/object/is-number-value.js b/Nodejs/node_modules/es5-ext/object/is-number-value.js
new file mode 100644
index 0000000..f701bf5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-number-value.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var isValue = require("./is-value");
+
+module.exports = function (value) {
+ if (!isValue(value)) return false;
+ try { return !isNaN(value); }
+ catch (e) { return false; }
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-object.js b/Nodejs/node_modules/es5-ext/object/is-object.js
new file mode 100644
index 0000000..0e576d7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-object.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var isValue = require("./is-value");
+
+var map = { function: true, object: true };
+
+module.exports = function (value) { return (isValue(value) && map[typeof value]) || false; };
diff --git a/Nodejs/node_modules/es5-ext/object/is-plain-function.js b/Nodejs/node_modules/es5-ext/object/is-plain-function.js
new file mode 100644
index 0000000..a2f3234
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-plain-function.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var isClassStr = RegExp.prototype.test.bind(/^\s*class[\s{/}]/)
+ , fnToString = Function.prototype.toString;
+
+module.exports = function (fn) {
+ if (typeof fn !== "function") return false;
+ if (typeof fn.call !== "function") return false;
+ if (typeof fn.apply !== "function") return false;
+ return !isClassStr(fnToString.call(fn));
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-plain-object.js b/Nodejs/node_modules/es5-ext/object/is-plain-object.js
new file mode 100644
index 0000000..ff15328
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-plain-object.js
@@ -0,0 +1,20 @@
+"use strict";
+
+var getPrototypeOf = Object.getPrototypeOf
+ , prototype = Object.prototype
+ , objToString = prototype.toString
+ , id = Object().toString();
+
+module.exports = function (value) {
+ var proto, valueConstructor;
+ if (!value || typeof value !== "object" || objToString.call(value) !== id) {
+ return false;
+ }
+ proto = getPrototypeOf(value);
+ if (proto === null) {
+ valueConstructor = value.constructor;
+ if (typeof valueConstructor !== "function") return true;
+ return valueConstructor.prototype !== value;
+ }
+ return proto === prototype || getPrototypeOf(proto) === null;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/is-promise.js b/Nodejs/node_modules/es5-ext/object/is-promise.js
new file mode 100644
index 0000000..33d6df1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-promise.js
@@ -0,0 +1,4 @@
+"use strict";
+
+// In next major this check will also confirm on promise constructor
+module.exports = require("./is-thenable");
diff --git a/Nodejs/node_modules/es5-ext/object/is-thenable.js b/Nodejs/node_modules/es5-ext/object/is-thenable.js
new file mode 100644
index 0000000..06db0fd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-thenable.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var isCallable = require("./is-callable")
+ , isObject = require("./is-object");
+
+module.exports = function (value) { return isObject(value) && isCallable(value.then); };
diff --git a/Nodejs/node_modules/es5-ext/object/is-value.js b/Nodejs/node_modules/es5-ext/object/is-value.js
new file mode 100644
index 0000000..4ee3805
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is-value.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var _undefined = require("../function/noop")(); // Support ES3 engines
+
+module.exports = function (val) { return val !== _undefined && val !== null; };
diff --git a/Nodejs/node_modules/es5-ext/object/is.js b/Nodejs/node_modules/es5-ext/object/is.js
new file mode 100644
index 0000000..54baade
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/is.js
@@ -0,0 +1,10 @@
+// Implementation credits go to:
+// http://wiki.ecmascript.org/doku.php?id=harmony:egal
+
+"use strict";
+
+var numIsNaN = require("../number/is-nan");
+
+module.exports = function (val1, val2) {
+ return val1 === val2 ? val1 !== 0 || 1 / val1 === 1 / val2 : numIsNaN(val1) && numIsNaN(val2);
+};
diff --git a/Nodejs/node_modules/es5-ext/object/key-of.js b/Nodejs/node_modules/es5-ext/object/key-of.js
new file mode 100644
index 0000000..dc640e4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/key-of.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var eq = require("./eq")
+ , some = require("./some");
+
+module.exports = function (obj, searchValue) {
+ var result;
+ return some(obj, function (value, name) {
+ if (eq(value, searchValue)) {
+ result = name;
+ return true;
+ }
+ return false;
+ })
+ ? result
+ : null;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/keys/implement.js b/Nodejs/node_modules/es5-ext/object/keys/implement.js
new file mode 100644
index 0000000..72ecfbd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/keys/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Object, "keys", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/object/keys/index.js b/Nodejs/node_modules/es5-ext/object/keys/index.js
new file mode 100644
index 0000000..d194227
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/keys/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Object.keys : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/object/keys/is-implemented.js b/Nodejs/node_modules/es5-ext/object/keys/is-implemented.js
new file mode 100644
index 0000000..2dfcf1b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/keys/is-implemented.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function () {
+ try {
+ Object.keys("primitive");
+ return true;
+ } catch (e) {
+ return false;
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/object/keys/shim.js b/Nodejs/node_modules/es5-ext/object/keys/shim.js
new file mode 100644
index 0000000..a8908d5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/keys/shim.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var isValue = require("../is-value");
+
+var keys = Object.keys;
+
+module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); };
diff --git a/Nodejs/node_modules/es5-ext/object/map-keys.js b/Nodejs/node_modules/es5-ext/object/map-keys.js
new file mode 100644
index 0000000..662e6ca
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/map-keys.js
@@ -0,0 +1,18 @@
+"use strict";
+
+var callable = require("./valid-callable")
+ , forEach = require("./for-each")
+ , call = Function.prototype.call;
+
+module.exports = function (obj, cb/*, thisArg*/) {
+ var result = {}, thisArg = arguments[2];
+ callable(cb);
+ forEach(
+ obj,
+ function (value, key, targetObj, index) {
+ result[call.call(cb, thisArg, key, value, this, index)] = value;
+ },
+ obj
+ );
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/map.js b/Nodejs/node_modules/es5-ext/object/map.js
new file mode 100644
index 0000000..e4eb61b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/map.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var callable = require("./valid-callable")
+ , forEach = require("./for-each")
+ , call = Function.prototype.call;
+
+module.exports = function (obj, cb/*, thisArg*/) {
+ var result = {}, thisArg = arguments[2];
+ callable(cb);
+ forEach(obj, function (value, key, targetObj, index) {
+ result[key] = call.call(cb, thisArg, value, key, targetObj, index);
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/mixin-prototypes.js b/Nodejs/node_modules/es5-ext/object/mixin-prototypes.js
new file mode 100644
index 0000000..81e27c7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/mixin-prototypes.js
@@ -0,0 +1,25 @@
+"use strict";
+
+var value = require("./valid-value")
+ , mixin = require("./mixin");
+
+var getPrototypeOf = Object.getPrototypeOf;
+
+module.exports = function (target, source) {
+ target = Object(value(target));
+ source = Object(value(source));
+ if (target === source) return target;
+
+ var sources = [];
+ while (source && !isPrototypeOf.call(source, target)) {
+ sources.unshift(source);
+ source = getPrototypeOf(source);
+ }
+
+ var error;
+ sources.forEach(function (sourceProto) {
+ try { mixin(target, sourceProto); } catch (mixinError) { error = mixinError; }
+ });
+ if (error) throw error;
+ return target;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/mixin.js b/Nodejs/node_modules/es5-ext/object/mixin.js
new file mode 100644
index 0000000..f5cf9dd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/mixin.js
@@ -0,0 +1,26 @@
+"use strict";
+
+var value = require("./valid-value")
+ , defineProperty = Object.defineProperty
+ , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor
+ , getOwnPropertyNames = Object.getOwnPropertyNames
+ , getOwnPropertySymbols = Object.getOwnPropertySymbols;
+
+module.exports = function (target, source) {
+ var error, sourceObject = Object(value(source));
+ target = Object(value(target));
+ getOwnPropertyNames(sourceObject).forEach(function (name) {
+ try {
+ defineProperty(target, name, getOwnPropertyDescriptor(source, name));
+ } catch (e) { error = e; }
+ });
+ if (typeof getOwnPropertySymbols === "function") {
+ getOwnPropertySymbols(sourceObject).forEach(function (symbol) {
+ try {
+ defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));
+ } catch (e) { error = e; }
+ });
+ }
+ if (error !== undefined) throw error;
+ return target;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/normalize-options.js b/Nodejs/node_modules/es5-ext/object/normalize-options.js
new file mode 100644
index 0000000..885dd80
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/normalize-options.js
@@ -0,0 +1,20 @@
+"use strict";
+
+var isValue = require("./is-value");
+
+var forEach = Array.prototype.forEach, create = Object.create;
+
+var process = function (src, obj) {
+ var key;
+ for (key in src) obj[key] = src[key];
+};
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (opts1/*, …options*/) {
+ var result = create(null);
+ forEach.call(arguments, function (options) {
+ if (!isValue(options)) return;
+ process(Object(options), result);
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/primitive-set.js b/Nodejs/node_modules/es5-ext/object/primitive-set.js
new file mode 100644
index 0000000..e6dd636
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/primitive-set.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var forEach = Array.prototype.forEach, create = Object.create;
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (arg/*, …args*/) {
+ var set = create(null);
+ forEach.call(arguments, function (name) { set[name] = true; });
+ return set;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/safe-traverse.js b/Nodejs/node_modules/es5-ext/object/safe-traverse.js
new file mode 100644
index 0000000..43d7cea
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/safe-traverse.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var value = require("./valid-value")
+ , isValue = require("./is-value");
+
+module.exports = function (obj/*, …names*/) {
+ var length, current = 1;
+ value(obj);
+ length = arguments.length - 1;
+ if (!length) return obj;
+ while (current < length) {
+ obj = obj[arguments[current++]];
+ if (!isValue(obj)) return undefined;
+ }
+ return obj[arguments[current]];
+};
diff --git a/Nodejs/node_modules/es5-ext/object/serialize.js b/Nodejs/node_modules/es5-ext/object/serialize.js
new file mode 100644
index 0000000..ec868c1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/serialize.js
@@ -0,0 +1,41 @@
+"use strict";
+
+var toArray = require("./to-array")
+ , isDate = require("../date/is-date")
+ , isValue = require("../object/is-value")
+ , isRegExp = require("../reg-exp/is-reg-exp");
+
+var isArray = Array.isArray
+ , stringify = JSON.stringify
+ , objHasOwnProperty = Object.prototype.hasOwnProperty;
+var keyValueToString = function (value, key) {
+ return stringify(key) + ":" + module.exports(value);
+};
+
+var sparseMap = function (arr) {
+ var i, length = arr.length, result = new Array(length);
+ for (i = 0; i < length; ++i) {
+ if (!objHasOwnProperty.call(arr, i)) continue;
+ result[i] = module.exports(arr[i]);
+ }
+ return result;
+};
+
+module.exports = function (obj) {
+ if (!isValue(obj)) return String(obj);
+ switch (typeof obj) {
+ case "string":
+ return stringify(obj);
+ case "number":
+ case "boolean":
+ case "function":
+ return String(obj);
+ case "object":
+ if (isArray(obj)) return "[" + sparseMap(obj) + "]";
+ if (isRegExp(obj)) return String(obj);
+ if (isDate(obj)) return "new Date(" + obj.valueOf() + ")";
+ return "{" + toArray(obj, keyValueToString) + "}";
+ default:
+ throw new TypeError("Serialization of " + String(obj) + "is unsupported");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/object/set-prototype-of/implement.js b/Nodejs/node_modules/es5-ext/object/set-prototype-of/implement.js
new file mode 100644
index 0000000..386a300
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/set-prototype-of/implement.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var shim;
+
+if (!require("./is-implemented")() && (shim = require("./shim"))) {
+ Object.defineProperty(Object, "setPrototypeOf", {
+ value: shim,
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/object/set-prototype-of/index.js b/Nodejs/node_modules/es5-ext/object/set-prototype-of/index.js
new file mode 100644
index 0000000..ac07b99
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/set-prototype-of/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Object.setPrototypeOf : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/object/set-prototype-of/is-implemented.js b/Nodejs/node_modules/es5-ext/object/set-prototype-of/is-implemented.js
new file mode 100644
index 0000000..1a00627
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/set-prototype-of/is-implemented.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var create = Object.create, getPrototypeOf = Object.getPrototypeOf, plainObject = {};
+
+module.exports = function (/* CustomCreate*/) {
+ var setPrototypeOf = Object.setPrototypeOf, customCreate = arguments[0] || create;
+ if (typeof setPrototypeOf !== "function") return false;
+ return getPrototypeOf(setPrototypeOf(customCreate(null), plainObject)) === plainObject;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/set-prototype-of/shim.js b/Nodejs/node_modules/es5-ext/object/set-prototype-of/shim.js
new file mode 100644
index 0000000..97b0b50
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/set-prototype-of/shim.js
@@ -0,0 +1,81 @@
+/* eslint no-proto: "off" */
+
+// Big thanks to @WebReflection for sorting this out
+// https://gist.github.com/WebReflection/5593554
+
+"use strict";
+
+var isObject = require("../is-object")
+ , value = require("../valid-value")
+ , objIsPrototypeOf = Object.prototype.isPrototypeOf
+ , defineProperty = Object.defineProperty
+ , nullDesc = { configurable: true, enumerable: false, writable: true, value: undefined }
+ , validate;
+
+validate = function (obj, prototype) {
+ value(obj);
+ if (prototype === null || isObject(prototype)) return obj;
+ throw new TypeError("Prototype must be null or an object");
+};
+
+module.exports = (function (status) {
+ var fn, set;
+ if (!status) return null;
+ if (status.level === 2) {
+ if (status.set) {
+ set = status.set;
+ fn = function (obj, prototype) {
+ set.call(validate(obj, prototype), prototype);
+ return obj;
+ };
+ } else {
+ fn = function (obj, prototype) {
+ validate(obj, prototype).__proto__ = prototype;
+ return obj;
+ };
+ }
+ } else {
+ fn = function self(obj, prototype) {
+ var isNullBase;
+ validate(obj, prototype);
+ isNullBase = objIsPrototypeOf.call(self.nullPolyfill, obj);
+ if (isNullBase) delete self.nullPolyfill.__proto__;
+ if (prototype === null) prototype = self.nullPolyfill;
+ obj.__proto__ = prototype;
+ if (isNullBase) defineProperty(self.nullPolyfill, "__proto__", nullDesc);
+ return obj;
+ };
+ }
+ return Object.defineProperty(fn, "level", {
+ configurable: false,
+ enumerable: false,
+ writable: false,
+ value: status.level
+ });
+})(
+ (function () {
+ var tmpObj1 = Object.create(null)
+ , tmpObj2 = {}
+ , set
+ , desc = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__");
+
+ if (desc) {
+ try {
+ set = desc.set; // Opera crashes at this point
+ set.call(tmpObj1, tmpObj2);
+ } catch (ignore) {}
+ if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { set: set, level: 2 };
+ }
+
+ tmpObj1.__proto__ = tmpObj2;
+ if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 2 };
+
+ tmpObj1 = {};
+ tmpObj1.__proto__ = tmpObj2;
+ if (Object.getPrototypeOf(tmpObj1) === tmpObj2) return { level: 1 };
+
+ return false;
+ })()
+);
+
+require("../create");
diff --git a/Nodejs/node_modules/es5-ext/object/some.js b/Nodejs/node_modules/es5-ext/object/some.js
new file mode 100644
index 0000000..c919466
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/some.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./_iterate")("some", false);
diff --git a/Nodejs/node_modules/es5-ext/object/to-array.js b/Nodejs/node_modules/es5-ext/object/to-array.js
new file mode 100644
index 0000000..18c0b27
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/to-array.js
@@ -0,0 +1,21 @@
+"use strict";
+
+var callable = require("./valid-callable")
+ , isValue = require("./is-value")
+ , forEach = require("./for-each")
+ , call = Function.prototype.call
+ , defaultCb = function (value, key) { return [key, value]; };
+
+module.exports = function (obj/*, cb, thisArg, compareFn*/) {
+ var a = [], cb = arguments[1], thisArg = arguments[2];
+ cb = isValue(cb) ? callable(cb) : defaultCb;
+
+ forEach(
+ obj,
+ function (value, key, targetObj, index) {
+ a.push(call.call(cb, thisArg, value, key, this, index));
+ },
+ obj, arguments[3]
+ );
+ return a;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/unserialize.js b/Nodejs/node_modules/es5-ext/object/unserialize.js
new file mode 100644
index 0000000..f62ea78
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/unserialize.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var value = require("./valid-value");
+
+module.exports = function (code) {
+ // eslint-disable-next-line no-new-func
+ return new Function("return " + value(code))();
+};
diff --git a/Nodejs/node_modules/es5-ext/object/valid-callable.js b/Nodejs/node_modules/es5-ext/object/valid-callable.js
new file mode 100644
index 0000000..a97fb3e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/valid-callable.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (fn) {
+ if (typeof fn !== "function") throw new TypeError(fn + " is not a function");
+ return fn;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/valid-object.js b/Nodejs/node_modules/es5-ext/object/valid-object.js
new file mode 100644
index 0000000..74b5e5f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/valid-object.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isObject = require("./is-object");
+
+module.exports = function (value) {
+ if (!isObject(value)) throw new TypeError(value + " is not an Object");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/valid-value.js b/Nodejs/node_modules/es5-ext/object/valid-value.js
new file mode 100644
index 0000000..d0ced8a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/valid-value.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isValue = require("./is-value");
+
+module.exports = function (value) {
+ if (!isValue(value)) throw new TypeError("Cannot use null or undefined");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/object/validate-array-like-object.js b/Nodejs/node_modules/es5-ext/object/validate-array-like-object.js
new file mode 100644
index 0000000..d7c45b3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/validate-array-like-object.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var isArrayLike = require("./is-array-like")
+ , isObject = require("./is-object");
+
+module.exports = function (obj) {
+ if (isObject(obj) && isArrayLike(obj)) return obj;
+ throw new TypeError(obj + " is not array-like object");
+};
diff --git a/Nodejs/node_modules/es5-ext/object/validate-array-like.js b/Nodejs/node_modules/es5-ext/object/validate-array-like.js
new file mode 100644
index 0000000..07aa794
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/validate-array-like.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isArrayLike = require("./is-array-like");
+
+module.exports = function (obj) {
+ if (isArrayLike(obj)) return obj;
+ throw new TypeError(obj + " is not array-like value");
+};
diff --git a/Nodejs/node_modules/es5-ext/object/validate-stringifiable-value.js b/Nodejs/node_modules/es5-ext/object/validate-stringifiable-value.js
new file mode 100644
index 0000000..b58f18c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/validate-stringifiable-value.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var ensureValue = require("./valid-value")
+ , stringifiable = require("./validate-stringifiable");
+
+module.exports = function (value) { return stringifiable(ensureValue(value)); };
diff --git a/Nodejs/node_modules/es5-ext/object/validate-stringifiable.js b/Nodejs/node_modules/es5-ext/object/validate-stringifiable.js
new file mode 100644
index 0000000..2b1f127
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/object/validate-stringifiable.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var isCallable = require("./is-callable");
+
+module.exports = function (stringifiable) {
+ try {
+ if (stringifiable && isCallable(stringifiable.toString)) return stringifiable.toString();
+ return String(stringifiable);
+ } catch (e) {
+ throw new TypeError("Passed argument cannot be stringifed");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/optional-chaining.js b/Nodejs/node_modules/es5-ext/optional-chaining.js
new file mode 100644
index 0000000..eba6bd8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/optional-chaining.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var isValue = require("./object/is-value");
+
+var slice = Array.prototype.slice;
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (value, propertyName1/*, …propertyNamen*/) {
+ var propertyNames = slice.call(arguments, 1), index = 0, length = propertyNames.length;
+ while (isValue(value) && index < length) value = value[propertyNames[index++]];
+ return index === length ? value : undefined;
+};
diff --git a/Nodejs/node_modules/es5-ext/package.json b/Nodejs/node_modules/es5-ext/package.json
new file mode 100644
index 0000000..1d493b3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/package.json
@@ -0,0 +1,135 @@
+{
+ "_from": "es5-ext@~0.10.14",
+ "_id": "es5-ext@0.10.53",
+ "_inBundle": false,
+ "_integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==",
+ "_location": "/es5-ext",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "es5-ext@~0.10.14",
+ "name": "es5-ext",
+ "escapedName": "es5-ext",
+ "rawSpec": "~0.10.14",
+ "saveSpec": null,
+ "fetchSpec": "~0.10.14"
+ },
+ "_requiredBy": [
+ "/d",
+ "/es6-iterator",
+ "/es6-map",
+ "/es6-set",
+ "/es6-set/es6-symbol",
+ "/event-emitter"
+ ],
+ "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz",
+ "_shasum": "93c5a3acfdbef275220ad72644ad02ee18368de1",
+ "_spec": "es5-ext@~0.10.14",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/es6-map",
+ "author": {
+ "name": "Mariusz Nowak",
+ "email": "medyk@medikoo.com",
+ "url": "http://www.medikoo.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/medikoo/es5-ext/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "es6-iterator": "~2.0.3",
+ "es6-symbol": "~3.1.3",
+ "next-tick": "~1.0.0"
+ },
+ "deprecated": false,
+ "description": "ECMAScript extensions and shims",
+ "devDependencies": {
+ "eslint": "^6.6.0",
+ "eslint-config-medikoo": "^2.7.0",
+ "git-list-updated": "^1.2.1",
+ "husky": "^3.1.0",
+ "lint-staged": "^9.4.3",
+ "plain-promise": "^0.1.1",
+ "prettier-elastic": "^1.18.2",
+ "tad": "^3.0.1"
+ },
+ "eslintConfig": {
+ "extends": "medikoo/es5",
+ "root": true,
+ "rules": {
+ "no-extend-native": "off"
+ },
+ "overrides": [
+ {
+ "files": "global.js",
+ "globals": {
+ "__global__": true,
+ "globalThis": true,
+ "self": true,
+ "window": true
+ },
+ "rules": {
+ "strict": "off"
+ }
+ }
+ ]
+ },
+ "homepage": "https://github.com/medikoo/es5-ext#readme",
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ },
+ "keywords": [
+ "ecmascript",
+ "ecmascript5",
+ "ecmascript6",
+ "es5",
+ "es6",
+ "extensions",
+ "ext",
+ "addons",
+ "extras",
+ "harmony",
+ "javascript",
+ "polyfill",
+ "shim",
+ "util",
+ "utils",
+ "utilities"
+ ],
+ "license": "ISC",
+ "lint-staged": {
+ "*.js": [
+ "eslint"
+ ],
+ "*.{css,html,js,json,md,yaml,yml}": [
+ "prettier -c"
+ ]
+ },
+ "name": "es5-ext",
+ "prettier": {
+ "printWidth": 100,
+ "tabWidth": 4,
+ "overrides": [
+ {
+ "files": "*.md",
+ "options": {
+ "tabWidth": 2
+ }
+ }
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/medikoo/es5-ext.git"
+ },
+ "scripts": {
+ "lint": "eslint --ignore-path=.gitignore .",
+ "lint-updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
+ "prettier-check-updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
+ "prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'",
+ "test": "node ./node_modules/tad/bin/tad"
+ },
+ "version": "0.10.53"
+}
diff --git a/Nodejs/node_modules/es5-ext/promise/#/as-callback.js b/Nodejs/node_modules/es5-ext/promise/#/as-callback.js
new file mode 100644
index 0000000..ba310b3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/#/as-callback.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var ensurePlainFunction = require("../../object/ensure-plain-function")
+ , ensureThenable = require("../../object/ensure-thenable")
+ , microtaskDelay = require("../../function/#/microtask-delay");
+
+module.exports = function (callback) {
+ ensureThenable(this);
+ ensurePlainFunction(callback);
+ // Rely on microtaskDelay to escape eventual error swallowing
+ this.then(
+ microtaskDelay.call(function (value) { callback(null, value); }),
+ microtaskDelay.call(function (reason) { callback(reason); })
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/promise/#/finally/implement.js b/Nodejs/node_modules/es5-ext/promise/#/finally/implement.js
new file mode 100644
index 0000000..77592b3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/#/finally/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(Promise.prototype, "finally", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/promise/#/finally/index.js b/Nodejs/node_modules/es5-ext/promise/#/finally/index.js
new file mode 100644
index 0000000..f6bb447
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/#/finally/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? Promise.prototype.finally : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/promise/#/finally/is-implemented.js b/Nodejs/node_modules/es5-ext/promise/#/finally/is-implemented.js
new file mode 100644
index 0000000..0534ce6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/#/finally/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ if (typeof Promise !== "function") return false;
+ if (typeof Promise.prototype.finally !== "function") return false;
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/promise/#/finally/shim.js b/Nodejs/node_modules/es5-ext/promise/#/finally/shim.js
new file mode 100644
index 0000000..f29f5b3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/#/finally/shim.js
@@ -0,0 +1,24 @@
+"use strict";
+
+var ensurePlainFunction = require("../../../object/ensure-plain-function")
+ , isThenable = require("../../../object/is-thenable")
+ , ensureThenable = require("../../../object/ensure-thenable");
+
+var resolveCallback = function (callback, next) {
+ var callbackResult = callback();
+ if (!isThenable(callbackResult)) return next();
+ return callbackResult.then(next);
+};
+
+module.exports = function (callback) {
+ ensureThenable(this);
+ ensurePlainFunction(callback);
+ return this.then(
+ function (result) {
+ return resolveCallback(callback, function () { return result; });
+ },
+ function (error) {
+ return resolveCallback(callback, function () { throw error; });
+ }
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/promise/#/index.js b/Nodejs/node_modules/es5-ext/promise/#/index.js
new file mode 100644
index 0000000..4601803
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/#/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = { asCallback: require("./as-callback"), finally: require("./finally") };
diff --git a/Nodejs/node_modules/es5-ext/promise/.eslintrc.json b/Nodejs/node_modules/es5-ext/promise/.eslintrc.json
new file mode 100644
index 0000000..0d86fe7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/.eslintrc.json
@@ -0,0 +1 @@
+{ "globals": { "Promise": true } }
diff --git a/Nodejs/node_modules/es5-ext/promise/index.js b/Nodejs/node_modules/es5-ext/promise/index.js
new file mode 100644
index 0000000..6aa66bb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = { "#": require("./#"), "lazy": require("./lazy") };
diff --git a/Nodejs/node_modules/es5-ext/promise/lazy.js b/Nodejs/node_modules/es5-ext/promise/lazy.js
new file mode 100644
index 0000000..ad97a53
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/promise/lazy.js
@@ -0,0 +1,35 @@
+"use strict";
+
+var isFunction = require("../function/is-function");
+
+module.exports = function (executor) {
+ var Constructor;
+ if (isFunction(this)) {
+ Constructor = this;
+ } else if (typeof Promise === "function") {
+ Constructor = Promise;
+ } else {
+ throw new TypeError("Could not resolve Promise constuctor");
+ }
+
+ var lazyThen;
+ var promise = new Constructor(function (resolve, reject) {
+ lazyThen = function (onSuccess, onFailure) {
+ if (!hasOwnProperty.call(this, "then")) {
+ // Sanity check
+ throw new Error("Unexpected (inherited) lazy then invocation");
+ }
+
+ try { executor(resolve, reject); }
+ catch (reason) { reject(reason); }
+ delete this.then;
+ return this.then(onSuccess, onFailure);
+ };
+ });
+
+ return Object.defineProperty(promise, "then", {
+ configurable: true,
+ writable: true,
+ value: lazyThen
+ });
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/index.js b/Nodejs/node_modules/es5-ext/reg-exp/#/index.js
new file mode 100644
index 0000000..9b098e0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/index.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = {
+ isSticky: require("./is-sticky"),
+ isUnicode: require("./is-unicode"),
+ match: require("./match"),
+ replace: require("./replace"),
+ search: require("./search"),
+ split: require("./split")
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/is-sticky.js b/Nodejs/node_modules/es5-ext/reg-exp/#/is-sticky.js
new file mode 100644
index 0000000..6e99533
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/is-sticky.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var validRegExp = require("../valid-reg-exp")
+ , re = /\/[a-xz]*y[a-xz]*$/;
+
+module.exports = function () { return Boolean(String(validRegExp(this)).match(re)); };
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/is-unicode.js b/Nodejs/node_modules/es5-ext/reg-exp/#/is-unicode.js
new file mode 100644
index 0000000..63a457f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/is-unicode.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var validRegExp = require("../valid-reg-exp")
+ , re = /\/[a-xz]*u[a-xz]*$/;
+
+module.exports = function () { return Boolean(String(validRegExp(this)).match(re)); };
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/match/implement.js b/Nodejs/node_modules/es5-ext/reg-exp/#/match/implement.js
new file mode 100644
index 0000000..68dcd55
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/match/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(RegExp.prototype, "match", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/match/index.js b/Nodejs/node_modules/es5-ext/reg-exp/#/match/index.js
new file mode 100644
index 0000000..4b33296
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/match/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? RegExp.prototype.match : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/match/is-implemented.js b/Nodejs/node_modules/es5-ext/reg-exp/#/match/is-implemented.js
new file mode 100644
index 0000000..a5065fc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/match/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var re = /foo/;
+
+module.exports = function () {
+ if (typeof re.match !== "function") return false;
+ return re.match("barfoobar") && !re.match("elo");
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/match/shim.js b/Nodejs/node_modules/es5-ext/reg-exp/#/match/shim.js
new file mode 100644
index 0000000..2955821
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/match/shim.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var validRegExp = require("../../valid-reg-exp");
+
+module.exports = function (string) {
+ validRegExp(this);
+ return String(string).match(this);
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/replace/implement.js b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/implement.js
new file mode 100644
index 0000000..f990c4f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(RegExp.prototype, "replace", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/replace/index.js b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/index.js
new file mode 100644
index 0000000..be54b52
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? RegExp.prototype.replace : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js
new file mode 100644
index 0000000..0a2e7c2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var re = /foo/;
+
+module.exports = function () {
+ if (typeof re.replace !== "function") return false;
+ return re.replace("foobar", "mar") === "marbar";
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/replace/shim.js b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/shim.js
new file mode 100644
index 0000000..66f5d5b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/replace/shim.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var validRegExp = require("../../valid-reg-exp");
+
+module.exports = function (string, replaceValue) {
+ validRegExp(this);
+ return String(string).replace(this, replaceValue);
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/search/implement.js b/Nodejs/node_modules/es5-ext/reg-exp/#/search/implement.js
new file mode 100644
index 0000000..df4a337
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/search/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(RegExp.prototype, "search", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/search/index.js b/Nodejs/node_modules/es5-ext/reg-exp/#/search/index.js
new file mode 100644
index 0000000..25ca76a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/search/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? RegExp.prototype.search : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/search/is-implemented.js b/Nodejs/node_modules/es5-ext/reg-exp/#/search/is-implemented.js
new file mode 100644
index 0000000..7f38669
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/search/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var re = /foo/;
+
+module.exports = function () {
+ if (typeof re.search !== "function") return false;
+ return re.search("barfoo") === 3;
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/search/shim.js b/Nodejs/node_modules/es5-ext/reg-exp/#/search/shim.js
new file mode 100644
index 0000000..c97a787
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/search/shim.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var validRegExp = require("../../valid-reg-exp");
+
+module.exports = function (string) {
+ validRegExp(this);
+ return String(string).search(this);
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/split/implement.js b/Nodejs/node_modules/es5-ext/reg-exp/#/split/implement.js
new file mode 100644
index 0000000..b979db0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/split/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(RegExp.prototype, "split", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/split/index.js b/Nodejs/node_modules/es5-ext/reg-exp/#/split/index.js
new file mode 100644
index 0000000..6d4f177
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/split/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? RegExp.prototype.split : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/split/is-implemented.js b/Nodejs/node_modules/es5-ext/reg-exp/#/split/is-implemented.js
new file mode 100644
index 0000000..90fca0c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/split/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var re = /\|/;
+
+module.exports = function () {
+ if (typeof re.split !== "function") return false;
+ return re.split("bar|foo")[1] === "foo";
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/split/shim.js b/Nodejs/node_modules/es5-ext/reg-exp/#/split/shim.js
new file mode 100644
index 0000000..c9c73cc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/split/shim.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var validRegExp = require("../../valid-reg-exp");
+
+module.exports = function (string) {
+ validRegExp(this);
+ return String(string).split(this);
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/sticky/implement.js b/Nodejs/node_modules/es5-ext/reg-exp/#/sticky/implement.js
new file mode 100644
index 0000000..7864c6c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/sticky/implement.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var isSticky = require("../is-sticky");
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(RegExp.prototype, "sticky", {
+ configurable: true,
+ enumerable: false,
+ get: isSticky
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js b/Nodejs/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
new file mode 100644
index 0000000..a1ade11
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/sticky/is-implemented.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function () {
+ var dummyRegExp = /a/;
+ // We need to do check on instance and not on prototype due to how ES2015 spec evolved:
+ // https://github.com/tc39/ecma262/issues/262
+ // https://github.com/tc39/ecma262/pull/263
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4617
+ return "sticky" in dummyRegExp;
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/unicode/implement.js b/Nodejs/node_modules/es5-ext/reg-exp/#/unicode/implement.js
new file mode 100644
index 0000000..8b99be5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/unicode/implement.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var isUnicode = require("../is-unicode");
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(RegExp.prototype, "unicode", {
+ configurable: true,
+ enumerable: false,
+ get: isUnicode
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js b/Nodejs/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
new file mode 100644
index 0000000..48605d7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/#/unicode/is-implemented.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function () {
+ var dummyRegExp = /a/;
+ // We need to do check on instance and not on prototype due to how ES2015 spec evolved:
+ // https://github.com/tc39/ecma262/issues/262
+ // https://github.com/tc39/ecma262/pull/263
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4617
+ return "unicode" in dummyRegExp;
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/escape.js b/Nodejs/node_modules/es5-ext/reg-exp/escape.js
new file mode 100644
index 0000000..b65b351
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/escape.js
@@ -0,0 +1,9 @@
+// Thanks to Andrew Clover:
+// http://stackoverflow.com/questions/3561493
+// /is-there-a-regexp-escape-function-in-javascript
+
+"use strict";
+
+var re = /[-/\\^$*+?.()|[\]{}]/g;
+
+module.exports = function (str) { return String(str).replace(re, "\\$&"); };
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/index.js b/Nodejs/node_modules/es5-ext/reg-exp/index.js
new file mode 100644
index 0000000..f023fe0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/index.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = {
+ "#": require("./#"),
+ "escape": require("./escape"),
+ "isRegExp": require("./is-reg-exp"),
+ "validRegExp": require("./valid-reg-exp")
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/is-reg-exp.js b/Nodejs/node_modules/es5-ext/reg-exp/is-reg-exp.js
new file mode 100644
index 0000000..b966b0f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/is-reg-exp.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var objToString = Object.prototype.toString, id = objToString.call(/a/);
+
+module.exports = function (value) {
+ return (value && (value instanceof RegExp || objToString.call(value) === id)) || false;
+};
diff --git a/Nodejs/node_modules/es5-ext/reg-exp/valid-reg-exp.js b/Nodejs/node_modules/es5-ext/reg-exp/valid-reg-exp.js
new file mode 100644
index 0000000..a05927a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/reg-exp/valid-reg-exp.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isRegExp = require("./is-reg-exp");
+
+module.exports = function (value) {
+ if (!isRegExp(value)) throw new TypeError(value + " is not a RegExp object");
+ return value;
+};
diff --git a/Nodejs/node_modules/es5-ext/safe-to-string.js b/Nodejs/node_modules/es5-ext/safe-to-string.js
new file mode 100644
index 0000000..f49a238
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/safe-to-string.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var isCallable = require("./object/is-callable");
+
+module.exports = function (value) {
+ try {
+ if (value && isCallable(value.toString)) return value.toString();
+ return String(value);
+ } catch (e) {
+ return "";
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/@@iterator/implement.js b/Nodejs/node_modules/es5-ext/string/#/@@iterator/implement.js
new file mode 100644
index 0000000..b51ad9f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/@@iterator/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String.prototype, require("es6-symbol").iterator, {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/#/@@iterator/index.js b/Nodejs/node_modules/es5-ext/string/#/@@iterator/index.js
new file mode 100644
index 0000000..4572443
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/@@iterator/index.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = require("./is-implemented")()
+ ? String.prototype[require("es6-symbol").iterator]
+ : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/#/@@iterator/is-implemented.js b/Nodejs/node_modules/es5-ext/string/#/@@iterator/is-implemented.js
new file mode 100644
index 0000000..bb8a8d6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/@@iterator/is-implemented.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function () {
+ var str = "🙈f", iterator, result;
+ if (typeof str[iteratorSymbol] !== "function") return false;
+ iterator = str[iteratorSymbol]();
+ if (!iterator) return false;
+ if (typeof iterator.next !== "function") return false;
+ result = iterator.next();
+ if (!result) return false;
+ if (result.value !== "🙈") return false;
+ if (result.done !== false) return false;
+ return true;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/@@iterator/shim.js b/Nodejs/node_modules/es5-ext/string/#/@@iterator/shim.js
new file mode 100644
index 0000000..2160619
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/@@iterator/shim.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var StringIterator = require("es6-iterator/string")
+ , value = require("../../../object/valid-value");
+
+module.exports = function () { return new StringIterator(value(this)); };
diff --git a/Nodejs/node_modules/es5-ext/string/#/at.js b/Nodejs/node_modules/es5-ext/string/#/at.js
new file mode 100644
index 0000000..a8c2917
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/at.js
@@ -0,0 +1,35 @@
+// Based on: https://github.com/mathiasbynens/String.prototype.at
+// Thanks @mathiasbynens !
+
+"use strict";
+
+var toInteger = require("../../number/to-integer")
+ , validValue = require("../../object/valid-value");
+
+module.exports = function (pos) {
+ var str = String(validValue(this)), size = str.length, cuFirst, cuSecond, nextPos, len;
+ pos = toInteger(pos);
+
+ // Account for out-of-bounds indices
+ // The odd lower bound is because the ToInteger operation is
+ // going to round `n` to `0` for `-1 < n <= 0`.
+ if (pos <= -1 || pos >= size) return "";
+
+ // Second half of `ToInteger`
+ // eslint-disable-next-line no-bitwise
+ pos |= 0;
+ // Get the first code unit and code unit value
+ cuFirst = str.charCodeAt(pos);
+ nextPos = pos + 1;
+ len = 1;
+ if (
+ // Check if it’s the start of a surrogate pair
+ cuFirst >= 0xd800 &&
+ cuFirst <= 0xdbff && // High surrogate
+ size > nextPos // There is a next code unit
+ ) {
+ cuSecond = str.charCodeAt(nextPos);
+ if (cuSecond >= 0xdc00 && cuSecond <= 0xdfff) len = 2; // Low surrogate
+ }
+ return str.slice(pos, pos + len);
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/camel-to-hyphen.js b/Nodejs/node_modules/es5-ext/string/#/camel-to-hyphen.js
new file mode 100644
index 0000000..5add3ed
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/camel-to-hyphen.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var replace = String.prototype.replace, re = /([A-Z])/g;
+
+module.exports = function () {
+ var str = replace.call(this, re, "-$1").toLowerCase();
+ if (str[0] === "-") str = str.slice(1);
+ return str;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/capitalize.js b/Nodejs/node_modules/es5-ext/string/#/capitalize.js
new file mode 100644
index 0000000..fc92a9f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/capitalize.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var value = require("../../object/valid-value");
+
+module.exports = function () {
+ var str = String(value(this));
+ return str.charAt(0).toUpperCase() + str.slice(1);
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/case-insensitive-compare.js b/Nodejs/node_modules/es5-ext/string/#/case-insensitive-compare.js
new file mode 100644
index 0000000..5d961a5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/case-insensitive-compare.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var toLowerCase = String.prototype.toLowerCase;
+
+module.exports = function (other) {
+ return toLowerCase.call(this).localeCompare(toLowerCase.call(String(other)));
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/code-point-at/implement.js b/Nodejs/node_modules/es5-ext/string/#/code-point-at/implement.js
new file mode 100644
index 0000000..25752f9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/code-point-at/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String.prototype, "codePointAt", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/#/code-point-at/index.js b/Nodejs/node_modules/es5-ext/string/#/code-point-at/index.js
new file mode 100644
index 0000000..0a22f84
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/code-point-at/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.prototype.codePointAt : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/#/code-point-at/is-implemented.js b/Nodejs/node_modules/es5-ext/string/#/code-point-at/is-implemented.js
new file mode 100644
index 0000000..47e4c93
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/code-point-at/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var str = "abc\uD834\uDF06def";
+
+module.exports = function () {
+ if (typeof str.codePointAt !== "function") return false;
+ return str.codePointAt(3) === 0x1d306;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/code-point-at/shim.js b/Nodejs/node_modules/es5-ext/string/#/code-point-at/shim.js
new file mode 100644
index 0000000..0f331c3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/code-point-at/shim.js
@@ -0,0 +1,26 @@
+// Based on: https://github.com/mathiasbynens/String.prototype.codePointAt
+// Thanks @mathiasbynens !
+
+"use strict";
+
+var toInteger = require("../../../number/to-integer")
+ , validValue = require("../../../object/valid-value");
+
+module.exports = function (pos) {
+ var str = String(validValue(this)), length = str.length, first, second;
+ pos = toInteger(pos);
+
+ // Account for out-of-bounds indices:
+ if (pos < 0 || pos >= length) return undefined;
+
+ // Get the first code unit
+ first = str.charCodeAt(pos);
+ if (first >= 0xd800 && first <= 0xdbff && length > pos + 1) {
+ second = str.charCodeAt(pos + 1);
+ if (second >= 0xdc00 && second <= 0xdfff) {
+ // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+ return (first - 0xd800) * 0x400 + second - 0xdc00 + 0x10000;
+ }
+ }
+ return first;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/contains/implement.js b/Nodejs/node_modules/es5-ext/string/#/contains/implement.js
new file mode 100644
index 0000000..03cc091
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/contains/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String.prototype, "contains", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/#/contains/index.js b/Nodejs/node_modules/es5-ext/string/#/contains/index.js
new file mode 100644
index 0000000..5f8d993
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/contains/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.prototype.contains : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/#/contains/is-implemented.js b/Nodejs/node_modules/es5-ext/string/#/contains/is-implemented.js
new file mode 100644
index 0000000..d9b3e9a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/contains/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var str = "razdwatrzy";
+
+module.exports = function () {
+ if (typeof str.contains !== "function") return false;
+ return str.contains("dwa") === true && str.contains("foo") === false;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/contains/shim.js b/Nodejs/node_modules/es5-ext/string/#/contains/shim.js
new file mode 100644
index 0000000..a7219f2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/contains/shim.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var indexOf = String.prototype.indexOf;
+
+module.exports = function (searchString/*, position*/) {
+ return indexOf.call(this, searchString, arguments[1]) > -1;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/count.js b/Nodejs/node_modules/es5-ext/string/#/count.js
new file mode 100644
index 0000000..7607013
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/count.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var ensureString = require("../../object/validate-stringifiable-value");
+
+module.exports = function (search) {
+ var string = ensureString(this), count = 0, index = 0;
+
+ search = ensureString(search);
+ if (!search) throw new TypeError("Search string cannot be empty");
+ while ((index = string.indexOf(search, index)) !== -1) {
+ ++count;
+ index += search.length;
+ }
+ return count;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/ends-with/implement.js b/Nodejs/node_modules/es5-ext/string/#/ends-with/implement.js
new file mode 100644
index 0000000..62457cc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/ends-with/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String.prototype, "endsWith", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/#/ends-with/index.js b/Nodejs/node_modules/es5-ext/string/#/ends-with/index.js
new file mode 100644
index 0000000..04c8264
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/ends-with/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.prototype.endsWith : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/#/ends-with/is-implemented.js b/Nodejs/node_modules/es5-ext/string/#/ends-with/is-implemented.js
new file mode 100644
index 0000000..1abaff7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/ends-with/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var str = "razdwatrzy";
+
+module.exports = function () {
+ if (typeof str.endsWith !== "function") return false;
+ return str.endsWith("trzy") === true && str.endsWith("raz") === false;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/ends-with/shim.js b/Nodejs/node_modules/es5-ext/string/#/ends-with/shim.js
new file mode 100644
index 0000000..725c2b7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/ends-with/shim.js
@@ -0,0 +1,18 @@
+"use strict";
+
+var toInteger = require("../../../number/to-integer")
+ , value = require("../../../object/valid-value")
+ , isValue = require("../../../object/is-value")
+ , min = Math.min
+ , max = Math.max;
+
+module.exports = function (searchString/*, endPosition*/) {
+ var self, start, endPos;
+ self = String(value(this));
+ searchString = String(searchString);
+ endPos = arguments[1];
+ start =
+ (isValue(endPos) ? min(max(toInteger(endPos), 0), self.length) : self.length) -
+ searchString.length;
+ return start < 0 ? false : self.indexOf(searchString, start) === start;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/hyphen-to-camel.js b/Nodejs/node_modules/es5-ext/string/#/hyphen-to-camel.js
new file mode 100644
index 0000000..9feef5b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/hyphen-to-camel.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var replace = String.prototype.replace, re = /-([a-z0-9])/g;
+var toUpperCase = function (ignored, a) { return a.toUpperCase(); };
+
+module.exports = function () { return replace.call(this, re, toUpperCase); };
diff --git a/Nodejs/node_modules/es5-ext/string/#/indent.js b/Nodejs/node_modules/es5-ext/string/#/indent.js
new file mode 100644
index 0000000..67fa9ad
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/indent.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var isValue = require("../../object/is-value")
+ , repeat = require("./repeat")
+ , replace = String.prototype.replace
+ , re = /(\r\n|[\n\r\u2028\u2029])([\u0000-\u0009\u000b-\uffff]+)/g;
+
+module.exports = function (indent/*, count*/) {
+ var count = arguments[1];
+ indent = repeat.call(String(indent), isValue(count) ? count : 1);
+ return indent + replace.call(this, re, "$1" + indent + "$2");
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/index.js b/Nodejs/node_modules/es5-ext/string/#/index.js
new file mode 100644
index 0000000..2344489
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/index.js
@@ -0,0 +1,23 @@
+"use strict";
+
+module.exports = {
+ "@@iterator": require("./@@iterator"),
+ "at": require("./at"),
+ "count": require("./count"),
+ "camelToHyphen": require("./camel-to-hyphen"),
+ "capitalize": require("./capitalize"),
+ "caseInsensitiveCompare": require("./case-insensitive-compare"),
+ "codePointAt": require("./code-point-at"),
+ "contains": require("./contains"),
+ "hyphenToCamel": require("./hyphen-to-camel"),
+ "endsWith": require("./ends-with"),
+ "indent": require("./indent"),
+ "last": require("./last"),
+ "normalize": require("./normalize"),
+ "pad": require("./pad"),
+ "plainReplace": require("./plain-replace"),
+ "plainReplaceAll": require("./plain-replace-all"),
+ "repeat": require("./repeat"),
+ "startsWith": require("./starts-with"),
+ "uncapitalize": require("./uncapitalize")
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/last.js b/Nodejs/node_modules/es5-ext/string/#/last.js
new file mode 100644
index 0000000..f5c957f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/last.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var value = require("../../object/valid-value");
+
+module.exports = function () {
+ var self = String(value(this)), length = self.length;
+ return length ? self[length - 1] : null;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/normalize/_data.js b/Nodejs/node_modules/es5-ext/string/#/normalize/_data.js
new file mode 100644
index 0000000..ae4f153
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/normalize/_data.js
@@ -0,0 +1,6988 @@
+/* eslint max-lines: "off", no-sparse-arrays: "off", comma-style: "off" */
+
+"use strict";
+
+module.exports = {
+ 0: {
+ 60: [, , { 824: 8814 }],
+ 61: [, , { 824: 8800 }],
+ 62: [, , { 824: 8815 }],
+ 65: [
+ , ,
+ {
+ 768: 192,
+ 769: 193,
+ 770: 194,
+ 771: 195,
+ 772: 256,
+ 774: 258,
+ 775: 550,
+ 776: 196,
+ 777: 7842,
+ 778: 197,
+ 780: 461,
+ 783: 512,
+ 785: 514,
+ 803: 7840,
+ 805: 7680,
+ 808: 260
+ }
+ ],
+ 66: [, , { 775: 7682, 803: 7684, 817: 7686 }],
+ 67: [, , { 769: 262, 770: 264, 775: 266, 780: 268, 807: 199 }],
+ 68: [, , { 775: 7690, 780: 270, 803: 7692, 807: 7696, 813: 7698, 817: 7694 }],
+ 69: [
+ , ,
+ {
+ 768: 200,
+ 769: 201,
+ 770: 202,
+ 771: 7868,
+ 772: 274,
+ 774: 276,
+ 775: 278,
+ 776: 203,
+ 777: 7866,
+ 780: 282,
+ 783: 516,
+ 785: 518,
+ 803: 7864,
+ 807: 552,
+ 808: 280,
+ 813: 7704,
+ 816: 7706
+ }
+ ],
+ 70: [, , { 775: 7710 }],
+ 71: [, , { 769: 500, 770: 284, 772: 7712, 774: 286, 775: 288, 780: 486, 807: 290 }],
+ 72: [, , { 770: 292, 775: 7714, 776: 7718, 780: 542, 803: 7716, 807: 7720, 814: 7722 }],
+ 73: [
+ , ,
+ {
+ 768: 204,
+ 769: 205,
+ 770: 206,
+ 771: 296,
+ 772: 298,
+ 774: 300,
+ 775: 304,
+ 776: 207,
+ 777: 7880,
+ 780: 463,
+ 783: 520,
+ 785: 522,
+ 803: 7882,
+ 808: 302,
+ 816: 7724
+ }
+ ],
+ 74: [, , { 770: 308 }],
+ 75: [, , { 769: 7728, 780: 488, 803: 7730, 807: 310, 817: 7732 }],
+ 76: [, , { 769: 313, 780: 317, 803: 7734, 807: 315, 813: 7740, 817: 7738 }],
+ 77: [, , { 769: 7742, 775: 7744, 803: 7746 }],
+ 78: [
+ , ,
+ {
+ 768: 504,
+ 769: 323,
+ 771: 209,
+ 775: 7748,
+ 780: 327,
+ 803: 7750,
+ 807: 325,
+ 813: 7754,
+ 817: 7752
+ }
+ ],
+ 79: [
+ , ,
+ {
+ 768: 210,
+ 769: 211,
+ 770: 212,
+ 771: 213,
+ 772: 332,
+ 774: 334,
+ 775: 558,
+ 776: 214,
+ 777: 7886,
+ 779: 336,
+ 780: 465,
+ 783: 524,
+ 785: 526,
+ 795: 416,
+ 803: 7884,
+ 808: 490
+ }
+ ],
+ 80: [, , { 769: 7764, 775: 7766 }],
+ 82: [
+ , ,
+ { 769: 340, 775: 7768, 780: 344, 783: 528, 785: 530, 803: 7770, 807: 342, 817: 7774 }
+ ],
+ 83: [, , { 769: 346, 770: 348, 775: 7776, 780: 352, 803: 7778, 806: 536, 807: 350 }],
+ 84: [, , { 775: 7786, 780: 356, 803: 7788, 806: 538, 807: 354, 813: 7792, 817: 7790 }],
+ 85: [
+ , ,
+ {
+ 768: 217,
+ 769: 218,
+ 770: 219,
+ 771: 360,
+ 772: 362,
+ 774: 364,
+ 776: 220,
+ 777: 7910,
+ 778: 366,
+ 779: 368,
+ 780: 467,
+ 783: 532,
+ 785: 534,
+ 795: 431,
+ 803: 7908,
+ 804: 7794,
+ 808: 370,
+ 813: 7798,
+ 816: 7796
+ }
+ ],
+ 86: [, , { 771: 7804, 803: 7806 }],
+ 87: [, , { 768: 7808, 769: 7810, 770: 372, 775: 7814, 776: 7812, 803: 7816 }],
+ 88: [, , { 775: 7818, 776: 7820 }],
+ 89: [
+ , ,
+ {
+ 768: 7922,
+ 769: 221,
+ 770: 374,
+ 771: 7928,
+ 772: 562,
+ 775: 7822,
+ 776: 376,
+ 777: 7926,
+ 803: 7924
+ }
+ ],
+ 90: [, , { 769: 377, 770: 7824, 775: 379, 780: 381, 803: 7826, 817: 7828 }],
+ 97: [
+ , ,
+ {
+ 768: 224,
+ 769: 225,
+ 770: 226,
+ 771: 227,
+ 772: 257,
+ 774: 259,
+ 775: 551,
+ 776: 228,
+ 777: 7843,
+ 778: 229,
+ 780: 462,
+ 783: 513,
+ 785: 515,
+ 803: 7841,
+ 805: 7681,
+ 808: 261
+ }
+ ],
+ 98: [, , { 775: 7683, 803: 7685, 817: 7687 }],
+ 99: [, , { 769: 263, 770: 265, 775: 267, 780: 269, 807: 231 }],
+ 100: [, , { 775: 7691, 780: 271, 803: 7693, 807: 7697, 813: 7699, 817: 7695 }],
+ 101: [
+ , ,
+ {
+ 768: 232,
+ 769: 233,
+ 770: 234,
+ 771: 7869,
+ 772: 275,
+ 774: 277,
+ 775: 279,
+ 776: 235,
+ 777: 7867,
+ 780: 283,
+ 783: 517,
+ 785: 519,
+ 803: 7865,
+ 807: 553,
+ 808: 281,
+ 813: 7705,
+ 816: 7707
+ }
+ ],
+ 102: [, , { 775: 7711 }],
+ 103: [, , { 769: 501, 770: 285, 772: 7713, 774: 287, 775: 289, 780: 487, 807: 291 }],
+ 104: [
+ , ,
+ { 770: 293, 775: 7715, 776: 7719, 780: 543, 803: 7717, 807: 7721, 814: 7723, 817: 7830 }
+ ],
+ 105: [
+ , ,
+ {
+ 768: 236,
+ 769: 237,
+ 770: 238,
+ 771: 297,
+ 772: 299,
+ 774: 301,
+ 776: 239,
+ 777: 7881,
+ 780: 464,
+ 783: 521,
+ 785: 523,
+ 803: 7883,
+ 808: 303,
+ 816: 7725
+ }
+ ],
+ 106: [, , { 770: 309, 780: 496 }],
+ 107: [, , { 769: 7729, 780: 489, 803: 7731, 807: 311, 817: 7733 }],
+ 108: [, , { 769: 314, 780: 318, 803: 7735, 807: 316, 813: 7741, 817: 7739 }],
+ 109: [, , { 769: 7743, 775: 7745, 803: 7747 }],
+ 110: [
+ , ,
+ {
+ 768: 505,
+ 769: 324,
+ 771: 241,
+ 775: 7749,
+ 780: 328,
+ 803: 7751,
+ 807: 326,
+ 813: 7755,
+ 817: 7753
+ }
+ ],
+ 111: [
+ , ,
+ {
+ 768: 242,
+ 769: 243,
+ 770: 244,
+ 771: 245,
+ 772: 333,
+ 774: 335,
+ 775: 559,
+ 776: 246,
+ 777: 7887,
+ 779: 337,
+ 780: 466,
+ 783: 525,
+ 785: 527,
+ 795: 417,
+ 803: 7885,
+ 808: 491
+ }
+ ],
+ 112: [, , { 769: 7765, 775: 7767 }],
+ 114: [
+ , ,
+ { 769: 341, 775: 7769, 780: 345, 783: 529, 785: 531, 803: 7771, 807: 343, 817: 7775 }
+ ],
+ 115: [, , { 769: 347, 770: 349, 775: 7777, 780: 353, 803: 7779, 806: 537, 807: 351 }],
+ 116: [
+ , ,
+ { 775: 7787, 776: 7831, 780: 357, 803: 7789, 806: 539, 807: 355, 813: 7793, 817: 7791 }
+ ],
+ 117: [
+ , ,
+ {
+ 768: 249,
+ 769: 250,
+ 770: 251,
+ 771: 361,
+ 772: 363,
+ 774: 365,
+ 776: 252,
+ 777: 7911,
+ 778: 367,
+ 779: 369,
+ 780: 468,
+ 783: 533,
+ 785: 535,
+ 795: 432,
+ 803: 7909,
+ 804: 7795,
+ 808: 371,
+ 813: 7799,
+ 816: 7797
+ }
+ ],
+ 118: [, , { 771: 7805, 803: 7807 }],
+ 119: [, , { 768: 7809, 769: 7811, 770: 373, 775: 7815, 776: 7813, 778: 7832, 803: 7817 }],
+ 120: [, , { 775: 7819, 776: 7821 }],
+ 121: [
+ , ,
+ {
+ 768: 7923,
+ 769: 253,
+ 770: 375,
+ 771: 7929,
+ 772: 563,
+ 775: 7823,
+ 776: 255,
+ 777: 7927,
+ 778: 7833,
+ 803: 7925
+ }
+ ],
+ 122: [, , { 769: 378, 770: 7825, 775: 380, 780: 382, 803: 7827, 817: 7829 }],
+ 160: [[32], 256],
+ 168: [[32, 776], 256, { 768: 8173, 769: 901, 834: 8129 }],
+ 170: [[97], 256],
+ 175: [[32, 772], 256],
+ 178: [[50], 256],
+ 179: [[51], 256],
+ 180: [[32, 769], 256],
+ 181: [[956], 256],
+ 184: [[32, 807], 256],
+ 185: [[49], 256],
+ 186: [[111], 256],
+ 188: [[49, 8260, 52], 256],
+ 189: [[49, 8260, 50], 256],
+ 190: [[51, 8260, 52], 256],
+ 192: [[65, 768]],
+ 193: [[65, 769]],
+ 194: [[65, 770], , { 768: 7846, 769: 7844, 771: 7850, 777: 7848 }],
+ 195: [[65, 771]],
+ 196: [[65, 776], , { 772: 478 }],
+ 197: [[65, 778], , { 769: 506 }],
+ 198: [, , { 769: 508, 772: 482 }],
+ 199: [[67, 807], , { 769: 7688 }],
+ 200: [[69, 768]],
+ 201: [[69, 769]],
+ 202: [[69, 770], , { 768: 7872, 769: 7870, 771: 7876, 777: 7874 }],
+ 203: [[69, 776]],
+ 204: [[73, 768]],
+ 205: [[73, 769]],
+ 206: [[73, 770]],
+ 207: [[73, 776], , { 769: 7726 }],
+ 209: [[78, 771]],
+ 210: [[79, 768]],
+ 211: [[79, 769]],
+ 212: [[79, 770], , { 768: 7890, 769: 7888, 771: 7894, 777: 7892 }],
+ 213: [[79, 771], , { 769: 7756, 772: 556, 776: 7758 }],
+ 214: [[79, 776], , { 772: 554 }],
+ 216: [, , { 769: 510 }],
+ 217: [[85, 768]],
+ 218: [[85, 769]],
+ 219: [[85, 770]],
+ 220: [[85, 776], , { 768: 475, 769: 471, 772: 469, 780: 473 }],
+ 221: [[89, 769]],
+ 224: [[97, 768]],
+ 225: [[97, 769]],
+ 226: [[97, 770], , { 768: 7847, 769: 7845, 771: 7851, 777: 7849 }],
+ 227: [[97, 771]],
+ 228: [[97, 776], , { 772: 479 }],
+ 229: [[97, 778], , { 769: 507 }],
+ 230: [, , { 769: 509, 772: 483 }],
+ 231: [[99, 807], , { 769: 7689 }],
+ 232: [[101, 768]],
+ 233: [[101, 769]],
+ 234: [[101, 770], , { 768: 7873, 769: 7871, 771: 7877, 777: 7875 }],
+ 235: [[101, 776]],
+ 236: [[105, 768]],
+ 237: [[105, 769]],
+ 238: [[105, 770]],
+ 239: [[105, 776], , { 769: 7727 }],
+ 241: [[110, 771]],
+ 242: [[111, 768]],
+ 243: [[111, 769]],
+ 244: [[111, 770], , { 768: 7891, 769: 7889, 771: 7895, 777: 7893 }],
+ 245: [[111, 771], , { 769: 7757, 772: 557, 776: 7759 }],
+ 246: [[111, 776], , { 772: 555 }],
+ 248: [, , { 769: 511 }],
+ 249: [[117, 768]],
+ 250: [[117, 769]],
+ 251: [[117, 770]],
+ 252: [[117, 776], , { 768: 476, 769: 472, 772: 470, 780: 474 }],
+ 253: [[121, 769]],
+ 255: [[121, 776]]
+ },
+ 256: {
+ 256: [[65, 772]],
+ 257: [[97, 772]],
+ 258: [[65, 774], , { 768: 7856, 769: 7854, 771: 7860, 777: 7858 }],
+ 259: [[97, 774], , { 768: 7857, 769: 7855, 771: 7861, 777: 7859 }],
+ 260: [[65, 808]],
+ 261: [[97, 808]],
+ 262: [[67, 769]],
+ 263: [[99, 769]],
+ 264: [[67, 770]],
+ 265: [[99, 770]],
+ 266: [[67, 775]],
+ 267: [[99, 775]],
+ 268: [[67, 780]],
+ 269: [[99, 780]],
+ 270: [[68, 780]],
+ 271: [[100, 780]],
+ 274: [[69, 772], , { 768: 7700, 769: 7702 }],
+ 275: [[101, 772], , { 768: 7701, 769: 7703 }],
+ 276: [[69, 774]],
+ 277: [[101, 774]],
+ 278: [[69, 775]],
+ 279: [[101, 775]],
+ 280: [[69, 808]],
+ 281: [[101, 808]],
+ 282: [[69, 780]],
+ 283: [[101, 780]],
+ 284: [[71, 770]],
+ 285: [[103, 770]],
+ 286: [[71, 774]],
+ 287: [[103, 774]],
+ 288: [[71, 775]],
+ 289: [[103, 775]],
+ 290: [[71, 807]],
+ 291: [[103, 807]],
+ 292: [[72, 770]],
+ 293: [[104, 770]],
+ 296: [[73, 771]],
+ 297: [[105, 771]],
+ 298: [[73, 772]],
+ 299: [[105, 772]],
+ 300: [[73, 774]],
+ 301: [[105, 774]],
+ 302: [[73, 808]],
+ 303: [[105, 808]],
+ 304: [[73, 775]],
+ 306: [[73, 74], 256],
+ 307: [[105, 106], 256],
+ 308: [[74, 770]],
+ 309: [[106, 770]],
+ 310: [[75, 807]],
+ 311: [[107, 807]],
+ 313: [[76, 769]],
+ 314: [[108, 769]],
+ 315: [[76, 807]],
+ 316: [[108, 807]],
+ 317: [[76, 780]],
+ 318: [[108, 780]],
+ 319: [[76, 183], 256],
+ 320: [[108, 183], 256],
+ 323: [[78, 769]],
+ 324: [[110, 769]],
+ 325: [[78, 807]],
+ 326: [[110, 807]],
+ 327: [[78, 780]],
+ 328: [[110, 780]],
+ 329: [[700, 110], 256],
+ 332: [[79, 772], , { 768: 7760, 769: 7762 }],
+ 333: [[111, 772], , { 768: 7761, 769: 7763 }],
+ 334: [[79, 774]],
+ 335: [[111, 774]],
+ 336: [[79, 779]],
+ 337: [[111, 779]],
+ 340: [[82, 769]],
+ 341: [[114, 769]],
+ 342: [[82, 807]],
+ 343: [[114, 807]],
+ 344: [[82, 780]],
+ 345: [[114, 780]],
+ 346: [[83, 769], , { 775: 7780 }],
+ 347: [[115, 769], , { 775: 7781 }],
+ 348: [[83, 770]],
+ 349: [[115, 770]],
+ 350: [[83, 807]],
+ 351: [[115, 807]],
+ 352: [[83, 780], , { 775: 7782 }],
+ 353: [[115, 780], , { 775: 7783 }],
+ 354: [[84, 807]],
+ 355: [[116, 807]],
+ 356: [[84, 780]],
+ 357: [[116, 780]],
+ 360: [[85, 771], , { 769: 7800 }],
+ 361: [[117, 771], , { 769: 7801 }],
+ 362: [[85, 772], , { 776: 7802 }],
+ 363: [[117, 772], , { 776: 7803 }],
+ 364: [[85, 774]],
+ 365: [[117, 774]],
+ 366: [[85, 778]],
+ 367: [[117, 778]],
+ 368: [[85, 779]],
+ 369: [[117, 779]],
+ 370: [[85, 808]],
+ 371: [[117, 808]],
+ 372: [[87, 770]],
+ 373: [[119, 770]],
+ 374: [[89, 770]],
+ 375: [[121, 770]],
+ 376: [[89, 776]],
+ 377: [[90, 769]],
+ 378: [[122, 769]],
+ 379: [[90, 775]],
+ 380: [[122, 775]],
+ 381: [[90, 780]],
+ 382: [[122, 780]],
+ 383: [[115], 256, { 775: 7835 }],
+ 416: [[79, 795], , { 768: 7900, 769: 7898, 771: 7904, 777: 7902, 803: 7906 }],
+ 417: [[111, 795], , { 768: 7901, 769: 7899, 771: 7905, 777: 7903, 803: 7907 }],
+ 431: [[85, 795], , { 768: 7914, 769: 7912, 771: 7918, 777: 7916, 803: 7920 }],
+ 432: [[117, 795], , { 768: 7915, 769: 7913, 771: 7919, 777: 7917, 803: 7921 }],
+ 439: [, , { 780: 494 }],
+ 452: [[68, 381], 256],
+ 453: [[68, 382], 256],
+ 454: [[100, 382], 256],
+ 455: [[76, 74], 256],
+ 456: [[76, 106], 256],
+ 457: [[108, 106], 256],
+ 458: [[78, 74], 256],
+ 459: [[78, 106], 256],
+ 460: [[110, 106], 256],
+ 461: [[65, 780]],
+ 462: [[97, 780]],
+ 463: [[73, 780]],
+ 464: [[105, 780]],
+ 465: [[79, 780]],
+ 466: [[111, 780]],
+ 467: [[85, 780]],
+ 468: [[117, 780]],
+ 469: [[220, 772]],
+ 470: [[252, 772]],
+ 471: [[220, 769]],
+ 472: [[252, 769]],
+ 473: [[220, 780]],
+ 474: [[252, 780]],
+ 475: [[220, 768]],
+ 476: [[252, 768]],
+ 478: [[196, 772]],
+ 479: [[228, 772]],
+ 480: [[550, 772]],
+ 481: [[551, 772]],
+ 482: [[198, 772]],
+ 483: [[230, 772]],
+ 486: [[71, 780]],
+ 487: [[103, 780]],
+ 488: [[75, 780]],
+ 489: [[107, 780]],
+ 490: [[79, 808], , { 772: 492 }],
+ 491: [[111, 808], , { 772: 493 }],
+ 492: [[490, 772]],
+ 493: [[491, 772]],
+ 494: [[439, 780]],
+ 495: [[658, 780]],
+ 496: [[106, 780]],
+ 497: [[68, 90], 256],
+ 498: [[68, 122], 256],
+ 499: [[100, 122], 256],
+ 500: [[71, 769]],
+ 501: [[103, 769]],
+ 504: [[78, 768]],
+ 505: [[110, 768]],
+ 506: [[197, 769]],
+ 507: [[229, 769]],
+ 508: [[198, 769]],
+ 509: [[230, 769]],
+ 510: [[216, 769]],
+ 511: [[248, 769]],
+ 66045: [, 220]
+ },
+ 512: {
+ 512: [[65, 783]],
+ 513: [[97, 783]],
+ 514: [[65, 785]],
+ 515: [[97, 785]],
+ 516: [[69, 783]],
+ 517: [[101, 783]],
+ 518: [[69, 785]],
+ 519: [[101, 785]],
+ 520: [[73, 783]],
+ 521: [[105, 783]],
+ 522: [[73, 785]],
+ 523: [[105, 785]],
+ 524: [[79, 783]],
+ 525: [[111, 783]],
+ 526: [[79, 785]],
+ 527: [[111, 785]],
+ 528: [[82, 783]],
+ 529: [[114, 783]],
+ 530: [[82, 785]],
+ 531: [[114, 785]],
+ 532: [[85, 783]],
+ 533: [[117, 783]],
+ 534: [[85, 785]],
+ 535: [[117, 785]],
+ 536: [[83, 806]],
+ 537: [[115, 806]],
+ 538: [[84, 806]],
+ 539: [[116, 806]],
+ 542: [[72, 780]],
+ 543: [[104, 780]],
+ 550: [[65, 775], , { 772: 480 }],
+ 551: [[97, 775], , { 772: 481 }],
+ 552: [[69, 807], , { 774: 7708 }],
+ 553: [[101, 807], , { 774: 7709 }],
+ 554: [[214, 772]],
+ 555: [[246, 772]],
+ 556: [[213, 772]],
+ 557: [[245, 772]],
+ 558: [[79, 775], , { 772: 560 }],
+ 559: [[111, 775], , { 772: 561 }],
+ 560: [[558, 772]],
+ 561: [[559, 772]],
+ 562: [[89, 772]],
+ 563: [[121, 772]],
+ 658: [, , { 780: 495 }],
+ 688: [[104], 256],
+ 689: [[614], 256],
+ 690: [[106], 256],
+ 691: [[114], 256],
+ 692: [[633], 256],
+ 693: [[635], 256],
+ 694: [[641], 256],
+ 695: [[119], 256],
+ 696: [[121], 256],
+ 728: [[32, 774], 256],
+ 729: [[32, 775], 256],
+ 730: [[32, 778], 256],
+ 731: [[32, 808], 256],
+ 732: [[32, 771], 256],
+ 733: [[32, 779], 256],
+ 736: [[611], 256],
+ 737: [[108], 256],
+ 738: [[115], 256],
+ 739: [[120], 256],
+ 740: [[661], 256]
+ },
+ 768: {
+ 768: [, 230],
+ 769: [, 230],
+ 770: [, 230],
+ 771: [, 230],
+ 772: [, 230],
+ 773: [, 230],
+ 774: [, 230],
+ 775: [, 230],
+ 776: [, 230, { 769: 836 }],
+ 777: [, 230],
+ 778: [, 230],
+ 779: [, 230],
+ 780: [, 230],
+ 781: [, 230],
+ 782: [, 230],
+ 783: [, 230],
+ 784: [, 230],
+ 785: [, 230],
+ 786: [, 230],
+ 787: [, 230],
+ 788: [, 230],
+ 789: [, 232],
+ 790: [, 220],
+ 791: [, 220],
+ 792: [, 220],
+ 793: [, 220],
+ 794: [, 232],
+ 795: [, 216],
+ 796: [, 220],
+ 797: [, 220],
+ 798: [, 220],
+ 799: [, 220],
+ 800: [, 220],
+ 801: [, 202],
+ 802: [, 202],
+ 803: [, 220],
+ 804: [, 220],
+ 805: [, 220],
+ 806: [, 220],
+ 807: [, 202],
+ 808: [, 202],
+ 809: [, 220],
+ 810: [, 220],
+ 811: [, 220],
+ 812: [, 220],
+ 813: [, 220],
+ 814: [, 220],
+ 815: [, 220],
+ 816: [, 220],
+ 817: [, 220],
+ 818: [, 220],
+ 819: [, 220],
+ 820: [, 1],
+ 821: [, 1],
+ 822: [, 1],
+ 823: [, 1],
+ 824: [, 1],
+ 825: [, 220],
+ 826: [, 220],
+ 827: [, 220],
+ 828: [, 220],
+ 829: [, 230],
+ 830: [, 230],
+ 831: [, 230],
+ 832: [[768], 230],
+ 833: [[769], 230],
+ 834: [, 230],
+ 835: [[787], 230],
+ 836: [[776, 769], 230],
+ 837: [, 240],
+ 838: [, 230],
+ 839: [, 220],
+ 840: [, 220],
+ 841: [, 220],
+ 842: [, 230],
+ 843: [, 230],
+ 844: [, 230],
+ 845: [, 220],
+ 846: [, 220],
+ 848: [, 230],
+ 849: [, 230],
+ 850: [, 230],
+ 851: [, 220],
+ 852: [, 220],
+ 853: [, 220],
+ 854: [, 220],
+ 855: [, 230],
+ 856: [, 232],
+ 857: [, 220],
+ 858: [, 220],
+ 859: [, 230],
+ 860: [, 233],
+ 861: [, 234],
+ 862: [, 234],
+ 863: [, 233],
+ 864: [, 234],
+ 865: [, 234],
+ 866: [, 233],
+ 867: [, 230],
+ 868: [, 230],
+ 869: [, 230],
+ 870: [, 230],
+ 871: [, 230],
+ 872: [, 230],
+ 873: [, 230],
+ 874: [, 230],
+ 875: [, 230],
+ 876: [, 230],
+ 877: [, 230],
+ 878: [, 230],
+ 879: [, 230],
+ 884: [[697]],
+ 890: [[32, 837], 256],
+ 894: [[59]],
+ 900: [[32, 769], 256],
+ 901: [[168, 769]],
+ 902: [[913, 769]],
+ 903: [[183]],
+ 904: [[917, 769]],
+ 905: [[919, 769]],
+ 906: [[921, 769]],
+ 908: [[927, 769]],
+ 910: [[933, 769]],
+ 911: [[937, 769]],
+ 912: [[970, 769]],
+ 913: [, , { 768: 8122, 769: 902, 772: 8121, 774: 8120, 787: 7944, 788: 7945, 837: 8124 }],
+ 917: [, , { 768: 8136, 769: 904, 787: 7960, 788: 7961 }],
+ 919: [, , { 768: 8138, 769: 905, 787: 7976, 788: 7977, 837: 8140 }],
+ 921: [, , { 768: 8154, 769: 906, 772: 8153, 774: 8152, 776: 938, 787: 7992, 788: 7993 }],
+ 927: [, , { 768: 8184, 769: 908, 787: 8008, 788: 8009 }],
+ 929: [, , { 788: 8172 }],
+ 933: [, , { 768: 8170, 769: 910, 772: 8169, 774: 8168, 776: 939, 788: 8025 }],
+ 937: [, , { 768: 8186, 769: 911, 787: 8040, 788: 8041, 837: 8188 }],
+ 938: [[921, 776]],
+ 939: [[933, 776]],
+ 940: [[945, 769], , { 837: 8116 }],
+ 941: [[949, 769]],
+ 942: [[951, 769], , { 837: 8132 }],
+ 943: [[953, 769]],
+ 944: [[971, 769]],
+ 945: [
+ , ,
+ {
+ 768: 8048,
+ 769: 940,
+ 772: 8113,
+ 774: 8112,
+ 787: 7936,
+ 788: 7937,
+ 834: 8118,
+ 837: 8115
+ }
+ ],
+ 949: [, , { 768: 8050, 769: 941, 787: 7952, 788: 7953 }],
+ 951: [, , { 768: 8052, 769: 942, 787: 7968, 788: 7969, 834: 8134, 837: 8131 }],
+ 953: [
+ , ,
+ { 768: 8054, 769: 943, 772: 8145, 774: 8144, 776: 970, 787: 7984, 788: 7985, 834: 8150 }
+ ],
+ 959: [, , { 768: 8056, 769: 972, 787: 8000, 788: 8001 }],
+ 961: [, , { 787: 8164, 788: 8165 }],
+ 965: [
+ , ,
+ { 768: 8058, 769: 973, 772: 8161, 774: 8160, 776: 971, 787: 8016, 788: 8017, 834: 8166 }
+ ],
+ 969: [, , { 768: 8060, 769: 974, 787: 8032, 788: 8033, 834: 8182, 837: 8179 }],
+ 970: [[953, 776], , { 768: 8146, 769: 912, 834: 8151 }],
+ 971: [[965, 776], , { 768: 8162, 769: 944, 834: 8167 }],
+ 972: [[959, 769]],
+ 973: [[965, 769]],
+ 974: [[969, 769], , { 837: 8180 }],
+ 976: [[946], 256],
+ 977: [[952], 256],
+ 978: [[933], 256, { 769: 979, 776: 980 }],
+ 979: [[978, 769]],
+ 980: [[978, 776]],
+ 981: [[966], 256],
+ 982: [[960], 256],
+ 1008: [[954], 256],
+ 1009: [[961], 256],
+ 1010: [[962], 256],
+ 1012: [[920], 256],
+ 1013: [[949], 256],
+ 1017: [[931], 256]
+ },
+ 1024: {
+ 1024: [[1045, 768]],
+ 1025: [[1045, 776]],
+ 1027: [[1043, 769]],
+ 1030: [, , { 776: 1031 }],
+ 1031: [[1030, 776]],
+ 1036: [[1050, 769]],
+ 1037: [[1048, 768]],
+ 1038: [[1059, 774]],
+ 1040: [, , { 774: 1232, 776: 1234 }],
+ 1043: [, , { 769: 1027 }],
+ 1045: [, , { 768: 1024, 774: 1238, 776: 1025 }],
+ 1046: [, , { 774: 1217, 776: 1244 }],
+ 1047: [, , { 776: 1246 }],
+ 1048: [, , { 768: 1037, 772: 1250, 774: 1049, 776: 1252 }],
+ 1049: [[1048, 774]],
+ 1050: [, , { 769: 1036 }],
+ 1054: [, , { 776: 1254 }],
+ 1059: [, , { 772: 1262, 774: 1038, 776: 1264, 779: 1266 }],
+ 1063: [, , { 776: 1268 }],
+ 1067: [, , { 776: 1272 }],
+ 1069: [, , { 776: 1260 }],
+ 1072: [, , { 774: 1233, 776: 1235 }],
+ 1075: [, , { 769: 1107 }],
+ 1077: [, , { 768: 1104, 774: 1239, 776: 1105 }],
+ 1078: [, , { 774: 1218, 776: 1245 }],
+ 1079: [, , { 776: 1247 }],
+ 1080: [, , { 768: 1117, 772: 1251, 774: 1081, 776: 1253 }],
+ 1081: [[1080, 774]],
+ 1082: [, , { 769: 1116 }],
+ 1086: [, , { 776: 1255 }],
+ 1091: [, , { 772: 1263, 774: 1118, 776: 1265, 779: 1267 }],
+ 1095: [, , { 776: 1269 }],
+ 1099: [, , { 776: 1273 }],
+ 1101: [, , { 776: 1261 }],
+ 1104: [[1077, 768]],
+ 1105: [[1077, 776]],
+ 1107: [[1075, 769]],
+ 1110: [, , { 776: 1111 }],
+ 1111: [[1110, 776]],
+ 1116: [[1082, 769]],
+ 1117: [[1080, 768]],
+ 1118: [[1091, 774]],
+ 1140: [, , { 783: 1142 }],
+ 1141: [, , { 783: 1143 }],
+ 1142: [[1140, 783]],
+ 1143: [[1141, 783]],
+ 1155: [, 230],
+ 1156: [, 230],
+ 1157: [, 230],
+ 1158: [, 230],
+ 1159: [, 230],
+ 1217: [[1046, 774]],
+ 1218: [[1078, 774]],
+ 1232: [[1040, 774]],
+ 1233: [[1072, 774]],
+ 1234: [[1040, 776]],
+ 1235: [[1072, 776]],
+ 1238: [[1045, 774]],
+ 1239: [[1077, 774]],
+ 1240: [, , { 776: 1242 }],
+ 1241: [, , { 776: 1243 }],
+ 1242: [[1240, 776]],
+ 1243: [[1241, 776]],
+ 1244: [[1046, 776]],
+ 1245: [[1078, 776]],
+ 1246: [[1047, 776]],
+ 1247: [[1079, 776]],
+ 1250: [[1048, 772]],
+ 1251: [[1080, 772]],
+ 1252: [[1048, 776]],
+ 1253: [[1080, 776]],
+ 1254: [[1054, 776]],
+ 1255: [[1086, 776]],
+ 1256: [, , { 776: 1258 }],
+ 1257: [, , { 776: 1259 }],
+ 1258: [[1256, 776]],
+ 1259: [[1257, 776]],
+ 1260: [[1069, 776]],
+ 1261: [[1101, 776]],
+ 1262: [[1059, 772]],
+ 1263: [[1091, 772]],
+ 1264: [[1059, 776]],
+ 1265: [[1091, 776]],
+ 1266: [[1059, 779]],
+ 1267: [[1091, 779]],
+ 1268: [[1063, 776]],
+ 1269: [[1095, 776]],
+ 1272: [[1067, 776]],
+ 1273: [[1099, 776]]
+ },
+ 1280: {
+ 1415: [[1381, 1410], 256],
+ 1425: [, 220],
+ 1426: [, 230],
+ 1427: [, 230],
+ 1428: [, 230],
+ 1429: [, 230],
+ 1430: [, 220],
+ 1431: [, 230],
+ 1432: [, 230],
+ 1433: [, 230],
+ 1434: [, 222],
+ 1435: [, 220],
+ 1436: [, 230],
+ 1437: [, 230],
+ 1438: [, 230],
+ 1439: [, 230],
+ 1440: [, 230],
+ 1441: [, 230],
+ 1442: [, 220],
+ 1443: [, 220],
+ 1444: [, 220],
+ 1445: [, 220],
+ 1446: [, 220],
+ 1447: [, 220],
+ 1448: [, 230],
+ 1449: [, 230],
+ 1450: [, 220],
+ 1451: [, 230],
+ 1452: [, 230],
+ 1453: [, 222],
+ 1454: [, 228],
+ 1455: [, 230],
+ 1456: [, 10],
+ 1457: [, 11],
+ 1458: [, 12],
+ 1459: [, 13],
+ 1460: [, 14],
+ 1461: [, 15],
+ 1462: [, 16],
+ 1463: [, 17],
+ 1464: [, 18],
+ 1465: [, 19],
+ 1466: [, 19],
+ 1467: [, 20],
+ 1468: [, 21],
+ 1469: [, 22],
+ 1471: [, 23],
+ 1473: [, 24],
+ 1474: [, 25],
+ 1476: [, 230],
+ 1477: [, 220],
+ 1479: [, 18]
+ },
+ 1536: {
+ 1552: [, 230],
+ 1553: [, 230],
+ 1554: [, 230],
+ 1555: [, 230],
+ 1556: [, 230],
+ 1557: [, 230],
+ 1558: [, 230],
+ 1559: [, 230],
+ 1560: [, 30],
+ 1561: [, 31],
+ 1562: [, 32],
+ 1570: [[1575, 1619]],
+ 1571: [[1575, 1620]],
+ 1572: [[1608, 1620]],
+ 1573: [[1575, 1621]],
+ 1574: [[1610, 1620]],
+ 1575: [, , { 1619: 1570, 1620: 1571, 1621: 1573 }],
+ 1608: [, , { 1620: 1572 }],
+ 1610: [, , { 1620: 1574 }],
+ 1611: [, 27],
+ 1612: [, 28],
+ 1613: [, 29],
+ 1614: [, 30],
+ 1615: [, 31],
+ 1616: [, 32],
+ 1617: [, 33],
+ 1618: [, 34],
+ 1619: [, 230],
+ 1620: [, 230],
+ 1621: [, 220],
+ 1622: [, 220],
+ 1623: [, 230],
+ 1624: [, 230],
+ 1625: [, 230],
+ 1626: [, 230],
+ 1627: [, 230],
+ 1628: [, 220],
+ 1629: [, 230],
+ 1630: [, 230],
+ 1631: [, 220],
+ 1648: [, 35],
+ 1653: [[1575, 1652], 256],
+ 1654: [[1608, 1652], 256],
+ 1655: [[1735, 1652], 256],
+ 1656: [[1610, 1652], 256],
+ 1728: [[1749, 1620]],
+ 1729: [, , { 1620: 1730 }],
+ 1730: [[1729, 1620]],
+ 1746: [, , { 1620: 1747 }],
+ 1747: [[1746, 1620]],
+ 1749: [, , { 1620: 1728 }],
+ 1750: [, 230],
+ 1751: [, 230],
+ 1752: [, 230],
+ 1753: [, 230],
+ 1754: [, 230],
+ 1755: [, 230],
+ 1756: [, 230],
+ 1759: [, 230],
+ 1760: [, 230],
+ 1761: [, 230],
+ 1762: [, 230],
+ 1763: [, 220],
+ 1764: [, 230],
+ 1767: [, 230],
+ 1768: [, 230],
+ 1770: [, 220],
+ 1771: [, 230],
+ 1772: [, 230],
+ 1773: [, 220]
+ },
+ 1792: {
+ 1809: [, 36],
+ 1840: [, 230],
+ 1841: [, 220],
+ 1842: [, 230],
+ 1843: [, 230],
+ 1844: [, 220],
+ 1845: [, 230],
+ 1846: [, 230],
+ 1847: [, 220],
+ 1848: [, 220],
+ 1849: [, 220],
+ 1850: [, 230],
+ 1851: [, 220],
+ 1852: [, 220],
+ 1853: [, 230],
+ 1854: [, 220],
+ 1855: [, 230],
+ 1856: [, 230],
+ 1857: [, 230],
+ 1858: [, 220],
+ 1859: [, 230],
+ 1860: [, 220],
+ 1861: [, 230],
+ 1862: [, 220],
+ 1863: [, 230],
+ 1864: [, 220],
+ 1865: [, 230],
+ 1866: [, 230],
+ 2027: [, 230],
+ 2028: [, 230],
+ 2029: [, 230],
+ 2030: [, 230],
+ 2031: [, 230],
+ 2032: [, 230],
+ 2033: [, 230],
+ 2034: [, 220],
+ 2035: [, 230]
+ },
+ 2048: {
+ 2070: [, 230],
+ 2071: [, 230],
+ 2072: [, 230],
+ 2073: [, 230],
+ 2075: [, 230],
+ 2076: [, 230],
+ 2077: [, 230],
+ 2078: [, 230],
+ 2079: [, 230],
+ 2080: [, 230],
+ 2081: [, 230],
+ 2082: [, 230],
+ 2083: [, 230],
+ 2085: [, 230],
+ 2086: [, 230],
+ 2087: [, 230],
+ 2089: [, 230],
+ 2090: [, 230],
+ 2091: [, 230],
+ 2092: [, 230],
+ 2093: [, 230],
+ 2137: [, 220],
+ 2138: [, 220],
+ 2139: [, 220],
+ 2276: [, 230],
+ 2277: [, 230],
+ 2278: [, 220],
+ 2279: [, 230],
+ 2280: [, 230],
+ 2281: [, 220],
+ 2282: [, 230],
+ 2283: [, 230],
+ 2284: [, 230],
+ 2285: [, 220],
+ 2286: [, 220],
+ 2287: [, 220],
+ 2288: [, 27],
+ 2289: [, 28],
+ 2290: [, 29],
+ 2291: [, 230],
+ 2292: [, 230],
+ 2293: [, 230],
+ 2294: [, 220],
+ 2295: [, 230],
+ 2296: [, 230],
+ 2297: [, 220],
+ 2298: [, 220],
+ 2299: [, 230],
+ 2300: [, 230],
+ 2301: [, 230],
+ 2302: [, 230]
+ },
+ 2304: {
+ 2344: [, , { 2364: 2345 }],
+ 2345: [[2344, 2364]],
+ 2352: [, , { 2364: 2353 }],
+ 2353: [[2352, 2364]],
+ 2355: [, , { 2364: 2356 }],
+ 2356: [[2355, 2364]],
+ 2364: [, 7],
+ 2381: [, 9],
+ 2385: [, 230],
+ 2386: [, 220],
+ 2387: [, 230],
+ 2388: [, 230],
+ 2392: [[2325, 2364], 512],
+ 2393: [[2326, 2364], 512],
+ 2394: [[2327, 2364], 512],
+ 2395: [[2332, 2364], 512],
+ 2396: [[2337, 2364], 512],
+ 2397: [[2338, 2364], 512],
+ 2398: [[2347, 2364], 512],
+ 2399: [[2351, 2364], 512],
+ 2492: [, 7],
+ 2503: [, , { 2494: 2507, 2519: 2508 }],
+ 2507: [[2503, 2494]],
+ 2508: [[2503, 2519]],
+ 2509: [, 9],
+ 2524: [[2465, 2492], 512],
+ 2525: [[2466, 2492], 512],
+ 2527: [[2479, 2492], 512]
+ },
+ 2560: {
+ 2611: [[2610, 2620], 512],
+ 2614: [[2616, 2620], 512],
+ 2620: [, 7],
+ 2637: [, 9],
+ 2649: [[2582, 2620], 512],
+ 2650: [[2583, 2620], 512],
+ 2651: [[2588, 2620], 512],
+ 2654: [[2603, 2620], 512],
+ 2748: [, 7],
+ 2765: [, 9],
+ 68109: [, 220],
+ 68111: [, 230],
+ 68152: [, 230],
+ 68153: [, 1],
+ 68154: [, 220],
+ 68159: [, 9]
+ },
+ 2816: {
+ 2876: [, 7],
+ 2887: [, , { 2878: 2891, 2902: 2888, 2903: 2892 }],
+ 2888: [[2887, 2902]],
+ 2891: [[2887, 2878]],
+ 2892: [[2887, 2903]],
+ 2893: [, 9],
+ 2908: [[2849, 2876], 512],
+ 2909: [[2850, 2876], 512],
+ 2962: [, , { 3031: 2964 }],
+ 2964: [[2962, 3031]],
+ 3014: [, , { 3006: 3018, 3031: 3020 }],
+ 3015: [, , { 3006: 3019 }],
+ 3018: [[3014, 3006]],
+ 3019: [[3015, 3006]],
+ 3020: [[3014, 3031]],
+ 3021: [, 9]
+ },
+ 3072: {
+ 3142: [, , { 3158: 3144 }],
+ 3144: [[3142, 3158]],
+ 3149: [, 9],
+ 3157: [, 84],
+ 3158: [, 91],
+ 3260: [, 7],
+ 3263: [, , { 3285: 3264 }],
+ 3264: [[3263, 3285]],
+ 3270: [, , { 3266: 3274, 3285: 3271, 3286: 3272 }],
+ 3271: [[3270, 3285]],
+ 3272: [[3270, 3286]],
+ 3274: [[3270, 3266], , { 3285: 3275 }],
+ 3275: [[3274, 3285]],
+ 3277: [, 9]
+ },
+ 3328: {
+ 3398: [, , { 3390: 3402, 3415: 3404 }],
+ 3399: [, , { 3390: 3403 }],
+ 3402: [[3398, 3390]],
+ 3403: [[3399, 3390]],
+ 3404: [[3398, 3415]],
+ 3405: [, 9],
+ 3530: [, 9],
+ 3545: [, , { 3530: 3546, 3535: 3548, 3551: 3550 }],
+ 3546: [[3545, 3530]],
+ 3548: [[3545, 3535], , { 3530: 3549 }],
+ 3549: [[3548, 3530]],
+ 3550: [[3545, 3551]]
+ },
+ 3584: {
+ 3635: [[3661, 3634], 256],
+ 3640: [, 103],
+ 3641: [, 103],
+ 3642: [, 9],
+ 3656: [, 107],
+ 3657: [, 107],
+ 3658: [, 107],
+ 3659: [, 107],
+ 3763: [[3789, 3762], 256],
+ 3768: [, 118],
+ 3769: [, 118],
+ 3784: [, 122],
+ 3785: [, 122],
+ 3786: [, 122],
+ 3787: [, 122],
+ 3804: [[3755, 3737], 256],
+ 3805: [[3755, 3745], 256]
+ },
+ 3840: {
+ 3852: [[3851], 256],
+ 3864: [, 220],
+ 3865: [, 220],
+ 3893: [, 220],
+ 3895: [, 220],
+ 3897: [, 216],
+ 3907: [[3906, 4023], 512],
+ 3917: [[3916, 4023], 512],
+ 3922: [[3921, 4023], 512],
+ 3927: [[3926, 4023], 512],
+ 3932: [[3931, 4023], 512],
+ 3945: [[3904, 4021], 512],
+ 3953: [, 129],
+ 3954: [, 130],
+ 3955: [[3953, 3954], 512],
+ 3956: [, 132],
+ 3957: [[3953, 3956], 512],
+ 3958: [[4018, 3968], 512],
+ 3959: [[4018, 3969], 256],
+ 3960: [[4019, 3968], 512],
+ 3961: [[4019, 3969], 256],
+ 3962: [, 130],
+ 3963: [, 130],
+ 3964: [, 130],
+ 3965: [, 130],
+ 3968: [, 130],
+ 3969: [[3953, 3968], 512],
+ 3970: [, 230],
+ 3971: [, 230],
+ 3972: [, 9],
+ 3974: [, 230],
+ 3975: [, 230],
+ 3987: [[3986, 4023], 512],
+ 3997: [[3996, 4023], 512],
+ 4002: [[4001, 4023], 512],
+ 4007: [[4006, 4023], 512],
+ 4012: [[4011, 4023], 512],
+ 4025: [[3984, 4021], 512],
+ 4038: [, 220]
+ },
+ 4096: {
+ 4133: [, , { 4142: 4134 }],
+ 4134: [[4133, 4142]],
+ 4151: [, 7],
+ 4153: [, 9],
+ 4154: [, 9],
+ 4237: [, 220],
+ 4348: [[4316], 256],
+ 69702: [, 9],
+ 69785: [, , { 69818: 69786 }],
+ 69786: [[69785, 69818]],
+ 69787: [, , { 69818: 69788 }],
+ 69788: [[69787, 69818]],
+ 69797: [, , { 69818: 69803 }],
+ 69803: [[69797, 69818]],
+ 69817: [, 9],
+ 69818: [, 7]
+ },
+ 4352: {
+ 69888: [, 230],
+ 69889: [, 230],
+ 69890: [, 230],
+ 69934: [[69937, 69927]],
+ 69935: [[69938, 69927]],
+ 69937: [, , { 69927: 69934 }],
+ 69938: [, , { 69927: 69935 }],
+ 69939: [, 9],
+ 69940: [, 9],
+ 70080: [, 9]
+ },
+ 4864: { 4957: [, 230], 4958: [, 230], 4959: [, 230] },
+ 5632: { 71350: [, 9], 71351: [, 7] },
+ 5888: { 5908: [, 9], 5940: [, 9], 6098: [, 9], 6109: [, 230] },
+ 6144: { 6313: [, 228] },
+ 6400: { 6457: [, 222], 6458: [, 230], 6459: [, 220] },
+ 6656: {
+ 6679: [, 230],
+ 6680: [, 220],
+ 6752: [, 9],
+ 6773: [, 230],
+ 6774: [, 230],
+ 6775: [, 230],
+ 6776: [, 230],
+ 6777: [, 230],
+ 6778: [, 230],
+ 6779: [, 230],
+ 6780: [, 230],
+ 6783: [, 220]
+ },
+ 6912: {
+ 6917: [, , { 6965: 6918 }],
+ 6918: [[6917, 6965]],
+ 6919: [, , { 6965: 6920 }],
+ 6920: [[6919, 6965]],
+ 6921: [, , { 6965: 6922 }],
+ 6922: [[6921, 6965]],
+ 6923: [, , { 6965: 6924 }],
+ 6924: [[6923, 6965]],
+ 6925: [, , { 6965: 6926 }],
+ 6926: [[6925, 6965]],
+ 6929: [, , { 6965: 6930 }],
+ 6930: [[6929, 6965]],
+ 6964: [, 7],
+ 6970: [, , { 6965: 6971 }],
+ 6971: [[6970, 6965]],
+ 6972: [, , { 6965: 6973 }],
+ 6973: [[6972, 6965]],
+ 6974: [, , { 6965: 6976 }],
+ 6975: [, , { 6965: 6977 }],
+ 6976: [[6974, 6965]],
+ 6977: [[6975, 6965]],
+ 6978: [, , { 6965: 6979 }],
+ 6979: [[6978, 6965]],
+ 6980: [, 9],
+ 7019: [, 230],
+ 7020: [, 220],
+ 7021: [, 230],
+ 7022: [, 230],
+ 7023: [, 230],
+ 7024: [, 230],
+ 7025: [, 230],
+ 7026: [, 230],
+ 7027: [, 230],
+ 7082: [, 9],
+ 7083: [, 9],
+ 7142: [, 7],
+ 7154: [, 9],
+ 7155: [, 9]
+ },
+ 7168: {
+ 7223: [, 7],
+ 7376: [, 230],
+ 7377: [, 230],
+ 7378: [, 230],
+ 7380: [, 1],
+ 7381: [, 220],
+ 7382: [, 220],
+ 7383: [, 220],
+ 7384: [, 220],
+ 7385: [, 220],
+ 7386: [, 230],
+ 7387: [, 230],
+ 7388: [, 220],
+ 7389: [, 220],
+ 7390: [, 220],
+ 7391: [, 220],
+ 7392: [, 230],
+ 7394: [, 1],
+ 7395: [, 1],
+ 7396: [, 1],
+ 7397: [, 1],
+ 7398: [, 1],
+ 7399: [, 1],
+ 7400: [, 1],
+ 7405: [, 220],
+ 7412: [, 230]
+ },
+ 7424: {
+ 7468: [[65], 256],
+ 7469: [[198], 256],
+ 7470: [[66], 256],
+ 7472: [[68], 256],
+ 7473: [[69], 256],
+ 7474: [[398], 256],
+ 7475: [[71], 256],
+ 7476: [[72], 256],
+ 7477: [[73], 256],
+ 7478: [[74], 256],
+ 7479: [[75], 256],
+ 7480: [[76], 256],
+ 7481: [[77], 256],
+ 7482: [[78], 256],
+ 7484: [[79], 256],
+ 7485: [[546], 256],
+ 7486: [[80], 256],
+ 7487: [[82], 256],
+ 7488: [[84], 256],
+ 7489: [[85], 256],
+ 7490: [[87], 256],
+ 7491: [[97], 256],
+ 7492: [[592], 256],
+ 7493: [[593], 256],
+ 7494: [[7426], 256],
+ 7495: [[98], 256],
+ 7496: [[100], 256],
+ 7497: [[101], 256],
+ 7498: [[601], 256],
+ 7499: [[603], 256],
+ 7500: [[604], 256],
+ 7501: [[103], 256],
+ 7503: [[107], 256],
+ 7504: [[109], 256],
+ 7505: [[331], 256],
+ 7506: [[111], 256],
+ 7507: [[596], 256],
+ 7508: [[7446], 256],
+ 7509: [[7447], 256],
+ 7510: [[112], 256],
+ 7511: [[116], 256],
+ 7512: [[117], 256],
+ 7513: [[7453], 256],
+ 7514: [[623], 256],
+ 7515: [[118], 256],
+ 7516: [[7461], 256],
+ 7517: [[946], 256],
+ 7518: [[947], 256],
+ 7519: [[948], 256],
+ 7520: [[966], 256],
+ 7521: [[967], 256],
+ 7522: [[105], 256],
+ 7523: [[114], 256],
+ 7524: [[117], 256],
+ 7525: [[118], 256],
+ 7526: [[946], 256],
+ 7527: [[947], 256],
+ 7528: [[961], 256],
+ 7529: [[966], 256],
+ 7530: [[967], 256],
+ 7544: [[1085], 256],
+ 7579: [[594], 256],
+ 7580: [[99], 256],
+ 7581: [[597], 256],
+ 7582: [[240], 256],
+ 7583: [[604], 256],
+ 7584: [[102], 256],
+ 7585: [[607], 256],
+ 7586: [[609], 256],
+ 7587: [[613], 256],
+ 7588: [[616], 256],
+ 7589: [[617], 256],
+ 7590: [[618], 256],
+ 7591: [[7547], 256],
+ 7592: [[669], 256],
+ 7593: [[621], 256],
+ 7594: [[7557], 256],
+ 7595: [[671], 256],
+ 7596: [[625], 256],
+ 7597: [[624], 256],
+ 7598: [[626], 256],
+ 7599: [[627], 256],
+ 7600: [[628], 256],
+ 7601: [[629], 256],
+ 7602: [[632], 256],
+ 7603: [[642], 256],
+ 7604: [[643], 256],
+ 7605: [[427], 256],
+ 7606: [[649], 256],
+ 7607: [[650], 256],
+ 7608: [[7452], 256],
+ 7609: [[651], 256],
+ 7610: [[652], 256],
+ 7611: [[122], 256],
+ 7612: [[656], 256],
+ 7613: [[657], 256],
+ 7614: [[658], 256],
+ 7615: [[952], 256],
+ 7616: [, 230],
+ 7617: [, 230],
+ 7618: [, 220],
+ 7619: [, 230],
+ 7620: [, 230],
+ 7621: [, 230],
+ 7622: [, 230],
+ 7623: [, 230],
+ 7624: [, 230],
+ 7625: [, 230],
+ 7626: [, 220],
+ 7627: [, 230],
+ 7628: [, 230],
+ 7629: [, 234],
+ 7630: [, 214],
+ 7631: [, 220],
+ 7632: [, 202],
+ 7633: [, 230],
+ 7634: [, 230],
+ 7635: [, 230],
+ 7636: [, 230],
+ 7637: [, 230],
+ 7638: [, 230],
+ 7639: [, 230],
+ 7640: [, 230],
+ 7641: [, 230],
+ 7642: [, 230],
+ 7643: [, 230],
+ 7644: [, 230],
+ 7645: [, 230],
+ 7646: [, 230],
+ 7647: [, 230],
+ 7648: [, 230],
+ 7649: [, 230],
+ 7650: [, 230],
+ 7651: [, 230],
+ 7652: [, 230],
+ 7653: [, 230],
+ 7654: [, 230],
+ 7676: [, 233],
+ 7677: [, 220],
+ 7678: [, 230],
+ 7679: [, 220]
+ },
+ 7680: {
+ 7680: [[65, 805]],
+ 7681: [[97, 805]],
+ 7682: [[66, 775]],
+ 7683: [[98, 775]],
+ 7684: [[66, 803]],
+ 7685: [[98, 803]],
+ 7686: [[66, 817]],
+ 7687: [[98, 817]],
+ 7688: [[199, 769]],
+ 7689: [[231, 769]],
+ 7690: [[68, 775]],
+ 7691: [[100, 775]],
+ 7692: [[68, 803]],
+ 7693: [[100, 803]],
+ 7694: [[68, 817]],
+ 7695: [[100, 817]],
+ 7696: [[68, 807]],
+ 7697: [[100, 807]],
+ 7698: [[68, 813]],
+ 7699: [[100, 813]],
+ 7700: [[274, 768]],
+ 7701: [[275, 768]],
+ 7702: [[274, 769]],
+ 7703: [[275, 769]],
+ 7704: [[69, 813]],
+ 7705: [[101, 813]],
+ 7706: [[69, 816]],
+ 7707: [[101, 816]],
+ 7708: [[552, 774]],
+ 7709: [[553, 774]],
+ 7710: [[70, 775]],
+ 7711: [[102, 775]],
+ 7712: [[71, 772]],
+ 7713: [[103, 772]],
+ 7714: [[72, 775]],
+ 7715: [[104, 775]],
+ 7716: [[72, 803]],
+ 7717: [[104, 803]],
+ 7718: [[72, 776]],
+ 7719: [[104, 776]],
+ 7720: [[72, 807]],
+ 7721: [[104, 807]],
+ 7722: [[72, 814]],
+ 7723: [[104, 814]],
+ 7724: [[73, 816]],
+ 7725: [[105, 816]],
+ 7726: [[207, 769]],
+ 7727: [[239, 769]],
+ 7728: [[75, 769]],
+ 7729: [[107, 769]],
+ 7730: [[75, 803]],
+ 7731: [[107, 803]],
+ 7732: [[75, 817]],
+ 7733: [[107, 817]],
+ 7734: [[76, 803], , { 772: 7736 }],
+ 7735: [[108, 803], , { 772: 7737 }],
+ 7736: [[7734, 772]],
+ 7737: [[7735, 772]],
+ 7738: [[76, 817]],
+ 7739: [[108, 817]],
+ 7740: [[76, 813]],
+ 7741: [[108, 813]],
+ 7742: [[77, 769]],
+ 7743: [[109, 769]],
+ 7744: [[77, 775]],
+ 7745: [[109, 775]],
+ 7746: [[77, 803]],
+ 7747: [[109, 803]],
+ 7748: [[78, 775]],
+ 7749: [[110, 775]],
+ 7750: [[78, 803]],
+ 7751: [[110, 803]],
+ 7752: [[78, 817]],
+ 7753: [[110, 817]],
+ 7754: [[78, 813]],
+ 7755: [[110, 813]],
+ 7756: [[213, 769]],
+ 7757: [[245, 769]],
+ 7758: [[213, 776]],
+ 7759: [[245, 776]],
+ 7760: [[332, 768]],
+ 7761: [[333, 768]],
+ 7762: [[332, 769]],
+ 7763: [[333, 769]],
+ 7764: [[80, 769]],
+ 7765: [[112, 769]],
+ 7766: [[80, 775]],
+ 7767: [[112, 775]],
+ 7768: [[82, 775]],
+ 7769: [[114, 775]],
+ 7770: [[82, 803], , { 772: 7772 }],
+ 7771: [[114, 803], , { 772: 7773 }],
+ 7772: [[7770, 772]],
+ 7773: [[7771, 772]],
+ 7774: [[82, 817]],
+ 7775: [[114, 817]],
+ 7776: [[83, 775]],
+ 7777: [[115, 775]],
+ 7778: [[83, 803], , { 775: 7784 }],
+ 7779: [[115, 803], , { 775: 7785 }],
+ 7780: [[346, 775]],
+ 7781: [[347, 775]],
+ 7782: [[352, 775]],
+ 7783: [[353, 775]],
+ 7784: [[7778, 775]],
+ 7785: [[7779, 775]],
+ 7786: [[84, 775]],
+ 7787: [[116, 775]],
+ 7788: [[84, 803]],
+ 7789: [[116, 803]],
+ 7790: [[84, 817]],
+ 7791: [[116, 817]],
+ 7792: [[84, 813]],
+ 7793: [[116, 813]],
+ 7794: [[85, 804]],
+ 7795: [[117, 804]],
+ 7796: [[85, 816]],
+ 7797: [[117, 816]],
+ 7798: [[85, 813]],
+ 7799: [[117, 813]],
+ 7800: [[360, 769]],
+ 7801: [[361, 769]],
+ 7802: [[362, 776]],
+ 7803: [[363, 776]],
+ 7804: [[86, 771]],
+ 7805: [[118, 771]],
+ 7806: [[86, 803]],
+ 7807: [[118, 803]],
+ 7808: [[87, 768]],
+ 7809: [[119, 768]],
+ 7810: [[87, 769]],
+ 7811: [[119, 769]],
+ 7812: [[87, 776]],
+ 7813: [[119, 776]],
+ 7814: [[87, 775]],
+ 7815: [[119, 775]],
+ 7816: [[87, 803]],
+ 7817: [[119, 803]],
+ 7818: [[88, 775]],
+ 7819: [[120, 775]],
+ 7820: [[88, 776]],
+ 7821: [[120, 776]],
+ 7822: [[89, 775]],
+ 7823: [[121, 775]],
+ 7824: [[90, 770]],
+ 7825: [[122, 770]],
+ 7826: [[90, 803]],
+ 7827: [[122, 803]],
+ 7828: [[90, 817]],
+ 7829: [[122, 817]],
+ 7830: [[104, 817]],
+ 7831: [[116, 776]],
+ 7832: [[119, 778]],
+ 7833: [[121, 778]],
+ 7834: [[97, 702], 256],
+ 7835: [[383, 775]],
+ 7840: [[65, 803], , { 770: 7852, 774: 7862 }],
+ 7841: [[97, 803], , { 770: 7853, 774: 7863 }],
+ 7842: [[65, 777]],
+ 7843: [[97, 777]],
+ 7844: [[194, 769]],
+ 7845: [[226, 769]],
+ 7846: [[194, 768]],
+ 7847: [[226, 768]],
+ 7848: [[194, 777]],
+ 7849: [[226, 777]],
+ 7850: [[194, 771]],
+ 7851: [[226, 771]],
+ 7852: [[7840, 770]],
+ 7853: [[7841, 770]],
+ 7854: [[258, 769]],
+ 7855: [[259, 769]],
+ 7856: [[258, 768]],
+ 7857: [[259, 768]],
+ 7858: [[258, 777]],
+ 7859: [[259, 777]],
+ 7860: [[258, 771]],
+ 7861: [[259, 771]],
+ 7862: [[7840, 774]],
+ 7863: [[7841, 774]],
+ 7864: [[69, 803], , { 770: 7878 }],
+ 7865: [[101, 803], , { 770: 7879 }],
+ 7866: [[69, 777]],
+ 7867: [[101, 777]],
+ 7868: [[69, 771]],
+ 7869: [[101, 771]],
+ 7870: [[202, 769]],
+ 7871: [[234, 769]],
+ 7872: [[202, 768]],
+ 7873: [[234, 768]],
+ 7874: [[202, 777]],
+ 7875: [[234, 777]],
+ 7876: [[202, 771]],
+ 7877: [[234, 771]],
+ 7878: [[7864, 770]],
+ 7879: [[7865, 770]],
+ 7880: [[73, 777]],
+ 7881: [[105, 777]],
+ 7882: [[73, 803]],
+ 7883: [[105, 803]],
+ 7884: [[79, 803], , { 770: 7896 }],
+ 7885: [[111, 803], , { 770: 7897 }],
+ 7886: [[79, 777]],
+ 7887: [[111, 777]],
+ 7888: [[212, 769]],
+ 7889: [[244, 769]],
+ 7890: [[212, 768]],
+ 7891: [[244, 768]],
+ 7892: [[212, 777]],
+ 7893: [[244, 777]],
+ 7894: [[212, 771]],
+ 7895: [[244, 771]],
+ 7896: [[7884, 770]],
+ 7897: [[7885, 770]],
+ 7898: [[416, 769]],
+ 7899: [[417, 769]],
+ 7900: [[416, 768]],
+ 7901: [[417, 768]],
+ 7902: [[416, 777]],
+ 7903: [[417, 777]],
+ 7904: [[416, 771]],
+ 7905: [[417, 771]],
+ 7906: [[416, 803]],
+ 7907: [[417, 803]],
+ 7908: [[85, 803]],
+ 7909: [[117, 803]],
+ 7910: [[85, 777]],
+ 7911: [[117, 777]],
+ 7912: [[431, 769]],
+ 7913: [[432, 769]],
+ 7914: [[431, 768]],
+ 7915: [[432, 768]],
+ 7916: [[431, 777]],
+ 7917: [[432, 777]],
+ 7918: [[431, 771]],
+ 7919: [[432, 771]],
+ 7920: [[431, 803]],
+ 7921: [[432, 803]],
+ 7922: [[89, 768]],
+ 7923: [[121, 768]],
+ 7924: [[89, 803]],
+ 7925: [[121, 803]],
+ 7926: [[89, 777]],
+ 7927: [[121, 777]],
+ 7928: [[89, 771]],
+ 7929: [[121, 771]]
+ },
+ 7936: {
+ 7936: [[945, 787], , { 768: 7938, 769: 7940, 834: 7942, 837: 8064 }],
+ 7937: [[945, 788], , { 768: 7939, 769: 7941, 834: 7943, 837: 8065 }],
+ 7938: [[7936, 768], , { 837: 8066 }],
+ 7939: [[7937, 768], , { 837: 8067 }],
+ 7940: [[7936, 769], , { 837: 8068 }],
+ 7941: [[7937, 769], , { 837: 8069 }],
+ 7942: [[7936, 834], , { 837: 8070 }],
+ 7943: [[7937, 834], , { 837: 8071 }],
+ 7944: [[913, 787], , { 768: 7946, 769: 7948, 834: 7950, 837: 8072 }],
+ 7945: [[913, 788], , { 768: 7947, 769: 7949, 834: 7951, 837: 8073 }],
+ 7946: [[7944, 768], , { 837: 8074 }],
+ 7947: [[7945, 768], , { 837: 8075 }],
+ 7948: [[7944, 769], , { 837: 8076 }],
+ 7949: [[7945, 769], , { 837: 8077 }],
+ 7950: [[7944, 834], , { 837: 8078 }],
+ 7951: [[7945, 834], , { 837: 8079 }],
+ 7952: [[949, 787], , { 768: 7954, 769: 7956 }],
+ 7953: [[949, 788], , { 768: 7955, 769: 7957 }],
+ 7954: [[7952, 768]],
+ 7955: [[7953, 768]],
+ 7956: [[7952, 769]],
+ 7957: [[7953, 769]],
+ 7960: [[917, 787], , { 768: 7962, 769: 7964 }],
+ 7961: [[917, 788], , { 768: 7963, 769: 7965 }],
+ 7962: [[7960, 768]],
+ 7963: [[7961, 768]],
+ 7964: [[7960, 769]],
+ 7965: [[7961, 769]],
+ 7968: [[951, 787], , { 768: 7970, 769: 7972, 834: 7974, 837: 8080 }],
+ 7969: [[951, 788], , { 768: 7971, 769: 7973, 834: 7975, 837: 8081 }],
+ 7970: [[7968, 768], , { 837: 8082 }],
+ 7971: [[7969, 768], , { 837: 8083 }],
+ 7972: [[7968, 769], , { 837: 8084 }],
+ 7973: [[7969, 769], , { 837: 8085 }],
+ 7974: [[7968, 834], , { 837: 8086 }],
+ 7975: [[7969, 834], , { 837: 8087 }],
+ 7976: [[919, 787], , { 768: 7978, 769: 7980, 834: 7982, 837: 8088 }],
+ 7977: [[919, 788], , { 768: 7979, 769: 7981, 834: 7983, 837: 8089 }],
+ 7978: [[7976, 768], , { 837: 8090 }],
+ 7979: [[7977, 768], , { 837: 8091 }],
+ 7980: [[7976, 769], , { 837: 8092 }],
+ 7981: [[7977, 769], , { 837: 8093 }],
+ 7982: [[7976, 834], , { 837: 8094 }],
+ 7983: [[7977, 834], , { 837: 8095 }],
+ 7984: [[953, 787], , { 768: 7986, 769: 7988, 834: 7990 }],
+ 7985: [[953, 788], , { 768: 7987, 769: 7989, 834: 7991 }],
+ 7986: [[7984, 768]],
+ 7987: [[7985, 768]],
+ 7988: [[7984, 769]],
+ 7989: [[7985, 769]],
+ 7990: [[7984, 834]],
+ 7991: [[7985, 834]],
+ 7992: [[921, 787], , { 768: 7994, 769: 7996, 834: 7998 }],
+ 7993: [[921, 788], , { 768: 7995, 769: 7997, 834: 7999 }],
+ 7994: [[7992, 768]],
+ 7995: [[7993, 768]],
+ 7996: [[7992, 769]],
+ 7997: [[7993, 769]],
+ 7998: [[7992, 834]],
+ 7999: [[7993, 834]],
+ 8000: [[959, 787], , { 768: 8002, 769: 8004 }],
+ 8001: [[959, 788], , { 768: 8003, 769: 8005 }],
+ 8002: [[8000, 768]],
+ 8003: [[8001, 768]],
+ 8004: [[8000, 769]],
+ 8005: [[8001, 769]],
+ 8008: [[927, 787], , { 768: 8010, 769: 8012 }],
+ 8009: [[927, 788], , { 768: 8011, 769: 8013 }],
+ 8010: [[8008, 768]],
+ 8011: [[8009, 768]],
+ 8012: [[8008, 769]],
+ 8013: [[8009, 769]],
+ 8016: [[965, 787], , { 768: 8018, 769: 8020, 834: 8022 }],
+ 8017: [[965, 788], , { 768: 8019, 769: 8021, 834: 8023 }],
+ 8018: [[8016, 768]],
+ 8019: [[8017, 768]],
+ 8020: [[8016, 769]],
+ 8021: [[8017, 769]],
+ 8022: [[8016, 834]],
+ 8023: [[8017, 834]],
+ 8025: [[933, 788], , { 768: 8027, 769: 8029, 834: 8031 }],
+ 8027: [[8025, 768]],
+ 8029: [[8025, 769]],
+ 8031: [[8025, 834]],
+ 8032: [[969, 787], , { 768: 8034, 769: 8036, 834: 8038, 837: 8096 }],
+ 8033: [[969, 788], , { 768: 8035, 769: 8037, 834: 8039, 837: 8097 }],
+ 8034: [[8032, 768], , { 837: 8098 }],
+ 8035: [[8033, 768], , { 837: 8099 }],
+ 8036: [[8032, 769], , { 837: 8100 }],
+ 8037: [[8033, 769], , { 837: 8101 }],
+ 8038: [[8032, 834], , { 837: 8102 }],
+ 8039: [[8033, 834], , { 837: 8103 }],
+ 8040: [[937, 787], , { 768: 8042, 769: 8044, 834: 8046, 837: 8104 }],
+ 8041: [[937, 788], , { 768: 8043, 769: 8045, 834: 8047, 837: 8105 }],
+ 8042: [[8040, 768], , { 837: 8106 }],
+ 8043: [[8041, 768], , { 837: 8107 }],
+ 8044: [[8040, 769], , { 837: 8108 }],
+ 8045: [[8041, 769], , { 837: 8109 }],
+ 8046: [[8040, 834], , { 837: 8110 }],
+ 8047: [[8041, 834], , { 837: 8111 }],
+ 8048: [[945, 768], , { 837: 8114 }],
+ 8049: [[940]],
+ 8050: [[949, 768]],
+ 8051: [[941]],
+ 8052: [[951, 768], , { 837: 8130 }],
+ 8053: [[942]],
+ 8054: [[953, 768]],
+ 8055: [[943]],
+ 8056: [[959, 768]],
+ 8057: [[972]],
+ 8058: [[965, 768]],
+ 8059: [[973]],
+ 8060: [[969, 768], , { 837: 8178 }],
+ 8061: [[974]],
+ 8064: [[7936, 837]],
+ 8065: [[7937, 837]],
+ 8066: [[7938, 837]],
+ 8067: [[7939, 837]],
+ 8068: [[7940, 837]],
+ 8069: [[7941, 837]],
+ 8070: [[7942, 837]],
+ 8071: [[7943, 837]],
+ 8072: [[7944, 837]],
+ 8073: [[7945, 837]],
+ 8074: [[7946, 837]],
+ 8075: [[7947, 837]],
+ 8076: [[7948, 837]],
+ 8077: [[7949, 837]],
+ 8078: [[7950, 837]],
+ 8079: [[7951, 837]],
+ 8080: [[7968, 837]],
+ 8081: [[7969, 837]],
+ 8082: [[7970, 837]],
+ 8083: [[7971, 837]],
+ 8084: [[7972, 837]],
+ 8085: [[7973, 837]],
+ 8086: [[7974, 837]],
+ 8087: [[7975, 837]],
+ 8088: [[7976, 837]],
+ 8089: [[7977, 837]],
+ 8090: [[7978, 837]],
+ 8091: [[7979, 837]],
+ 8092: [[7980, 837]],
+ 8093: [[7981, 837]],
+ 8094: [[7982, 837]],
+ 8095: [[7983, 837]],
+ 8096: [[8032, 837]],
+ 8097: [[8033, 837]],
+ 8098: [[8034, 837]],
+ 8099: [[8035, 837]],
+ 8100: [[8036, 837]],
+ 8101: [[8037, 837]],
+ 8102: [[8038, 837]],
+ 8103: [[8039, 837]],
+ 8104: [[8040, 837]],
+ 8105: [[8041, 837]],
+ 8106: [[8042, 837]],
+ 8107: [[8043, 837]],
+ 8108: [[8044, 837]],
+ 8109: [[8045, 837]],
+ 8110: [[8046, 837]],
+ 8111: [[8047, 837]],
+ 8112: [[945, 774]],
+ 8113: [[945, 772]],
+ 8114: [[8048, 837]],
+ 8115: [[945, 837]],
+ 8116: [[940, 837]],
+ 8118: [[945, 834], , { 837: 8119 }],
+ 8119: [[8118, 837]],
+ 8120: [[913, 774]],
+ 8121: [[913, 772]],
+ 8122: [[913, 768]],
+ 8123: [[902]],
+ 8124: [[913, 837]],
+ 8125: [[32, 787], 256],
+ 8126: [[953]],
+ 8127: [[32, 787], 256, { 768: 8141, 769: 8142, 834: 8143 }],
+ 8128: [[32, 834], 256],
+ 8129: [[168, 834]],
+ 8130: [[8052, 837]],
+ 8131: [[951, 837]],
+ 8132: [[942, 837]],
+ 8134: [[951, 834], , { 837: 8135 }],
+ 8135: [[8134, 837]],
+ 8136: [[917, 768]],
+ 8137: [[904]],
+ 8138: [[919, 768]],
+ 8139: [[905]],
+ 8140: [[919, 837]],
+ 8141: [[8127, 768]],
+ 8142: [[8127, 769]],
+ 8143: [[8127, 834]],
+ 8144: [[953, 774]],
+ 8145: [[953, 772]],
+ 8146: [[970, 768]],
+ 8147: [[912]],
+ 8150: [[953, 834]],
+ 8151: [[970, 834]],
+ 8152: [[921, 774]],
+ 8153: [[921, 772]],
+ 8154: [[921, 768]],
+ 8155: [[906]],
+ 8157: [[8190, 768]],
+ 8158: [[8190, 769]],
+ 8159: [[8190, 834]],
+ 8160: [[965, 774]],
+ 8161: [[965, 772]],
+ 8162: [[971, 768]],
+ 8163: [[944]],
+ 8164: [[961, 787]],
+ 8165: [[961, 788]],
+ 8166: [[965, 834]],
+ 8167: [[971, 834]],
+ 8168: [[933, 774]],
+ 8169: [[933, 772]],
+ 8170: [[933, 768]],
+ 8171: [[910]],
+ 8172: [[929, 788]],
+ 8173: [[168, 768]],
+ 8174: [[901]],
+ 8175: [[96]],
+ 8178: [[8060, 837]],
+ 8179: [[969, 837]],
+ 8180: [[974, 837]],
+ 8182: [[969, 834], , { 837: 8183 }],
+ 8183: [[8182, 837]],
+ 8184: [[927, 768]],
+ 8185: [[908]],
+ 8186: [[937, 768]],
+ 8187: [[911]],
+ 8188: [[937, 837]],
+ 8189: [[180]],
+ 8190: [[32, 788], 256, { 768: 8157, 769: 8158, 834: 8159 }]
+ },
+ 8192: {
+ 8192: [[8194]],
+ 8193: [[8195]],
+ 8194: [[32], 256],
+ 8195: [[32], 256],
+ 8196: [[32], 256],
+ 8197: [[32], 256],
+ 8198: [[32], 256],
+ 8199: [[32], 256],
+ 8200: [[32], 256],
+ 8201: [[32], 256],
+ 8202: [[32], 256],
+ 8209: [[8208], 256],
+ 8215: [[32, 819], 256],
+ 8228: [[46], 256],
+ 8229: [[46, 46], 256],
+ 8230: [[46, 46, 46], 256],
+ 8239: [[32], 256],
+ 8243: [[8242, 8242], 256],
+ 8244: [[8242, 8242, 8242], 256],
+ 8246: [[8245, 8245], 256],
+ 8247: [[8245, 8245, 8245], 256],
+ 8252: [[33, 33], 256],
+ 8254: [[32, 773], 256],
+ 8263: [[63, 63], 256],
+ 8264: [[63, 33], 256],
+ 8265: [[33, 63], 256],
+ 8279: [[8242, 8242, 8242, 8242], 256],
+ 8287: [[32], 256],
+ 8304: [[48], 256],
+ 8305: [[105], 256],
+ 8308: [[52], 256],
+ 8309: [[53], 256],
+ 8310: [[54], 256],
+ 8311: [[55], 256],
+ 8312: [[56], 256],
+ 8313: [[57], 256],
+ 8314: [[43], 256],
+ 8315: [[8722], 256],
+ 8316: [[61], 256],
+ 8317: [[40], 256],
+ 8318: [[41], 256],
+ 8319: [[110], 256],
+ 8320: [[48], 256],
+ 8321: [[49], 256],
+ 8322: [[50], 256],
+ 8323: [[51], 256],
+ 8324: [[52], 256],
+ 8325: [[53], 256],
+ 8326: [[54], 256],
+ 8327: [[55], 256],
+ 8328: [[56], 256],
+ 8329: [[57], 256],
+ 8330: [[43], 256],
+ 8331: [[8722], 256],
+ 8332: [[61], 256],
+ 8333: [[40], 256],
+ 8334: [[41], 256],
+ 8336: [[97], 256],
+ 8337: [[101], 256],
+ 8338: [[111], 256],
+ 8339: [[120], 256],
+ 8340: [[601], 256],
+ 8341: [[104], 256],
+ 8342: [[107], 256],
+ 8343: [[108], 256],
+ 8344: [[109], 256],
+ 8345: [[110], 256],
+ 8346: [[112], 256],
+ 8347: [[115], 256],
+ 8348: [[116], 256],
+ 8360: [[82, 115], 256],
+ 8400: [, 230],
+ 8401: [, 230],
+ 8402: [, 1],
+ 8403: [, 1],
+ 8404: [, 230],
+ 8405: [, 230],
+ 8406: [, 230],
+ 8407: [, 230],
+ 8408: [, 1],
+ 8409: [, 1],
+ 8410: [, 1],
+ 8411: [, 230],
+ 8412: [, 230],
+ 8417: [, 230],
+ 8421: [, 1],
+ 8422: [, 1],
+ 8423: [, 230],
+ 8424: [, 220],
+ 8425: [, 230],
+ 8426: [, 1],
+ 8427: [, 1],
+ 8428: [, 220],
+ 8429: [, 220],
+ 8430: [, 220],
+ 8431: [, 220],
+ 8432: [, 230]
+ },
+ 8448: {
+ 8448: [[97, 47, 99], 256],
+ 8449: [[97, 47, 115], 256],
+ 8450: [[67], 256],
+ 8451: [[176, 67], 256],
+ 8453: [[99, 47, 111], 256],
+ 8454: [[99, 47, 117], 256],
+ 8455: [[400], 256],
+ 8457: [[176, 70], 256],
+ 8458: [[103], 256],
+ 8459: [[72], 256],
+ 8460: [[72], 256],
+ 8461: [[72], 256],
+ 8462: [[104], 256],
+ 8463: [[295], 256],
+ 8464: [[73], 256],
+ 8465: [[73], 256],
+ 8466: [[76], 256],
+ 8467: [[108], 256],
+ 8469: [[78], 256],
+ 8470: [[78, 111], 256],
+ 8473: [[80], 256],
+ 8474: [[81], 256],
+ 8475: [[82], 256],
+ 8476: [[82], 256],
+ 8477: [[82], 256],
+ 8480: [[83, 77], 256],
+ 8481: [[84, 69, 76], 256],
+ 8482: [[84, 77], 256],
+ 8484: [[90], 256],
+ 8486: [[937]],
+ 8488: [[90], 256],
+ 8490: [[75]],
+ 8491: [[197]],
+ 8492: [[66], 256],
+ 8493: [[67], 256],
+ 8495: [[101], 256],
+ 8496: [[69], 256],
+ 8497: [[70], 256],
+ 8499: [[77], 256],
+ 8500: [[111], 256],
+ 8501: [[1488], 256],
+ 8502: [[1489], 256],
+ 8503: [[1490], 256],
+ 8504: [[1491], 256],
+ 8505: [[105], 256],
+ 8507: [[70, 65, 88], 256],
+ 8508: [[960], 256],
+ 8509: [[947], 256],
+ 8510: [[915], 256],
+ 8511: [[928], 256],
+ 8512: [[8721], 256],
+ 8517: [[68], 256],
+ 8518: [[100], 256],
+ 8519: [[101], 256],
+ 8520: [[105], 256],
+ 8521: [[106], 256],
+ 8528: [[49, 8260, 55], 256],
+ 8529: [[49, 8260, 57], 256],
+ 8530: [[49, 8260, 49, 48], 256],
+ 8531: [[49, 8260, 51], 256],
+ 8532: [[50, 8260, 51], 256],
+ 8533: [[49, 8260, 53], 256],
+ 8534: [[50, 8260, 53], 256],
+ 8535: [[51, 8260, 53], 256],
+ 8536: [[52, 8260, 53], 256],
+ 8537: [[49, 8260, 54], 256],
+ 8538: [[53, 8260, 54], 256],
+ 8539: [[49, 8260, 56], 256],
+ 8540: [[51, 8260, 56], 256],
+ 8541: [[53, 8260, 56], 256],
+ 8542: [[55, 8260, 56], 256],
+ 8543: [[49, 8260], 256],
+ 8544: [[73], 256],
+ 8545: [[73, 73], 256],
+ 8546: [[73, 73, 73], 256],
+ 8547: [[73, 86], 256],
+ 8548: [[86], 256],
+ 8549: [[86, 73], 256],
+ 8550: [[86, 73, 73], 256],
+ 8551: [[86, 73, 73, 73], 256],
+ 8552: [[73, 88], 256],
+ 8553: [[88], 256],
+ 8554: [[88, 73], 256],
+ 8555: [[88, 73, 73], 256],
+ 8556: [[76], 256],
+ 8557: [[67], 256],
+ 8558: [[68], 256],
+ 8559: [[77], 256],
+ 8560: [[105], 256],
+ 8561: [[105, 105], 256],
+ 8562: [[105, 105, 105], 256],
+ 8563: [[105, 118], 256],
+ 8564: [[118], 256],
+ 8565: [[118, 105], 256],
+ 8566: [[118, 105, 105], 256],
+ 8567: [[118, 105, 105, 105], 256],
+ 8568: [[105, 120], 256],
+ 8569: [[120], 256],
+ 8570: [[120, 105], 256],
+ 8571: [[120, 105, 105], 256],
+ 8572: [[108], 256],
+ 8573: [[99], 256],
+ 8574: [[100], 256],
+ 8575: [[109], 256],
+ 8585: [[48, 8260, 51], 256],
+ 8592: [, , { 824: 8602 }],
+ 8594: [, , { 824: 8603 }],
+ 8596: [, , { 824: 8622 }],
+ 8602: [[8592, 824]],
+ 8603: [[8594, 824]],
+ 8622: [[8596, 824]],
+ 8653: [[8656, 824]],
+ 8654: [[8660, 824]],
+ 8655: [[8658, 824]],
+ 8656: [, , { 824: 8653 }],
+ 8658: [, , { 824: 8655 }],
+ 8660: [, , { 824: 8654 }]
+ },
+ 8704: {
+ 8707: [, , { 824: 8708 }],
+ 8708: [[8707, 824]],
+ 8712: [, , { 824: 8713 }],
+ 8713: [[8712, 824]],
+ 8715: [, , { 824: 8716 }],
+ 8716: [[8715, 824]],
+ 8739: [, , { 824: 8740 }],
+ 8740: [[8739, 824]],
+ 8741: [, , { 824: 8742 }],
+ 8742: [[8741, 824]],
+ 8748: [[8747, 8747], 256],
+ 8749: [[8747, 8747, 8747], 256],
+ 8751: [[8750, 8750], 256],
+ 8752: [[8750, 8750, 8750], 256],
+ 8764: [, , { 824: 8769 }],
+ 8769: [[8764, 824]],
+ 8771: [, , { 824: 8772 }],
+ 8772: [[8771, 824]],
+ 8773: [, , { 824: 8775 }],
+ 8775: [[8773, 824]],
+ 8776: [, , { 824: 8777 }],
+ 8777: [[8776, 824]],
+ 8781: [, , { 824: 8813 }],
+ 8800: [[61, 824]],
+ 8801: [, , { 824: 8802 }],
+ 8802: [[8801, 824]],
+ 8804: [, , { 824: 8816 }],
+ 8805: [, , { 824: 8817 }],
+ 8813: [[8781, 824]],
+ 8814: [[60, 824]],
+ 8815: [[62, 824]],
+ 8816: [[8804, 824]],
+ 8817: [[8805, 824]],
+ 8818: [, , { 824: 8820 }],
+ 8819: [, , { 824: 8821 }],
+ 8820: [[8818, 824]],
+ 8821: [[8819, 824]],
+ 8822: [, , { 824: 8824 }],
+ 8823: [, , { 824: 8825 }],
+ 8824: [[8822, 824]],
+ 8825: [[8823, 824]],
+ 8826: [, , { 824: 8832 }],
+ 8827: [, , { 824: 8833 }],
+ 8828: [, , { 824: 8928 }],
+ 8829: [, , { 824: 8929 }],
+ 8832: [[8826, 824]],
+ 8833: [[8827, 824]],
+ 8834: [, , { 824: 8836 }],
+ 8835: [, , { 824: 8837 }],
+ 8836: [[8834, 824]],
+ 8837: [[8835, 824]],
+ 8838: [, , { 824: 8840 }],
+ 8839: [, , { 824: 8841 }],
+ 8840: [[8838, 824]],
+ 8841: [[8839, 824]],
+ 8849: [, , { 824: 8930 }],
+ 8850: [, , { 824: 8931 }],
+ 8866: [, , { 824: 8876 }],
+ 8872: [, , { 824: 8877 }],
+ 8873: [, , { 824: 8878 }],
+ 8875: [, , { 824: 8879 }],
+ 8876: [[8866, 824]],
+ 8877: [[8872, 824]],
+ 8878: [[8873, 824]],
+ 8879: [[8875, 824]],
+ 8882: [, , { 824: 8938 }],
+ 8883: [, , { 824: 8939 }],
+ 8884: [, , { 824: 8940 }],
+ 8885: [, , { 824: 8941 }],
+ 8928: [[8828, 824]],
+ 8929: [[8829, 824]],
+ 8930: [[8849, 824]],
+ 8931: [[8850, 824]],
+ 8938: [[8882, 824]],
+ 8939: [[8883, 824]],
+ 8940: [[8884, 824]],
+ 8941: [[8885, 824]]
+ },
+ 8960: { 9001: [[12296]], 9002: [[12297]] },
+ 9216: {
+ 9312: [[49], 256],
+ 9313: [[50], 256],
+ 9314: [[51], 256],
+ 9315: [[52], 256],
+ 9316: [[53], 256],
+ 9317: [[54], 256],
+ 9318: [[55], 256],
+ 9319: [[56], 256],
+ 9320: [[57], 256],
+ 9321: [[49, 48], 256],
+ 9322: [[49, 49], 256],
+ 9323: [[49, 50], 256],
+ 9324: [[49, 51], 256],
+ 9325: [[49, 52], 256],
+ 9326: [[49, 53], 256],
+ 9327: [[49, 54], 256],
+ 9328: [[49, 55], 256],
+ 9329: [[49, 56], 256],
+ 9330: [[49, 57], 256],
+ 9331: [[50, 48], 256],
+ 9332: [[40, 49, 41], 256],
+ 9333: [[40, 50, 41], 256],
+ 9334: [[40, 51, 41], 256],
+ 9335: [[40, 52, 41], 256],
+ 9336: [[40, 53, 41], 256],
+ 9337: [[40, 54, 41], 256],
+ 9338: [[40, 55, 41], 256],
+ 9339: [[40, 56, 41], 256],
+ 9340: [[40, 57, 41], 256],
+ 9341: [[40, 49, 48, 41], 256],
+ 9342: [[40, 49, 49, 41], 256],
+ 9343: [[40, 49, 50, 41], 256],
+ 9344: [[40, 49, 51, 41], 256],
+ 9345: [[40, 49, 52, 41], 256],
+ 9346: [[40, 49, 53, 41], 256],
+ 9347: [[40, 49, 54, 41], 256],
+ 9348: [[40, 49, 55, 41], 256],
+ 9349: [[40, 49, 56, 41], 256],
+ 9350: [[40, 49, 57, 41], 256],
+ 9351: [[40, 50, 48, 41], 256],
+ 9352: [[49, 46], 256],
+ 9353: [[50, 46], 256],
+ 9354: [[51, 46], 256],
+ 9355: [[52, 46], 256],
+ 9356: [[53, 46], 256],
+ 9357: [[54, 46], 256],
+ 9358: [[55, 46], 256],
+ 9359: [[56, 46], 256],
+ 9360: [[57, 46], 256],
+ 9361: [[49, 48, 46], 256],
+ 9362: [[49, 49, 46], 256],
+ 9363: [[49, 50, 46], 256],
+ 9364: [[49, 51, 46], 256],
+ 9365: [[49, 52, 46], 256],
+ 9366: [[49, 53, 46], 256],
+ 9367: [[49, 54, 46], 256],
+ 9368: [[49, 55, 46], 256],
+ 9369: [[49, 56, 46], 256],
+ 9370: [[49, 57, 46], 256],
+ 9371: [[50, 48, 46], 256],
+ 9372: [[40, 97, 41], 256],
+ 9373: [[40, 98, 41], 256],
+ 9374: [[40, 99, 41], 256],
+ 9375: [[40, 100, 41], 256],
+ 9376: [[40, 101, 41], 256],
+ 9377: [[40, 102, 41], 256],
+ 9378: [[40, 103, 41], 256],
+ 9379: [[40, 104, 41], 256],
+ 9380: [[40, 105, 41], 256],
+ 9381: [[40, 106, 41], 256],
+ 9382: [[40, 107, 41], 256],
+ 9383: [[40, 108, 41], 256],
+ 9384: [[40, 109, 41], 256],
+ 9385: [[40, 110, 41], 256],
+ 9386: [[40, 111, 41], 256],
+ 9387: [[40, 112, 41], 256],
+ 9388: [[40, 113, 41], 256],
+ 9389: [[40, 114, 41], 256],
+ 9390: [[40, 115, 41], 256],
+ 9391: [[40, 116, 41], 256],
+ 9392: [[40, 117, 41], 256],
+ 9393: [[40, 118, 41], 256],
+ 9394: [[40, 119, 41], 256],
+ 9395: [[40, 120, 41], 256],
+ 9396: [[40, 121, 41], 256],
+ 9397: [[40, 122, 41], 256],
+ 9398: [[65], 256],
+ 9399: [[66], 256],
+ 9400: [[67], 256],
+ 9401: [[68], 256],
+ 9402: [[69], 256],
+ 9403: [[70], 256],
+ 9404: [[71], 256],
+ 9405: [[72], 256],
+ 9406: [[73], 256],
+ 9407: [[74], 256],
+ 9408: [[75], 256],
+ 9409: [[76], 256],
+ 9410: [[77], 256],
+ 9411: [[78], 256],
+ 9412: [[79], 256],
+ 9413: [[80], 256],
+ 9414: [[81], 256],
+ 9415: [[82], 256],
+ 9416: [[83], 256],
+ 9417: [[84], 256],
+ 9418: [[85], 256],
+ 9419: [[86], 256],
+ 9420: [[87], 256],
+ 9421: [[88], 256],
+ 9422: [[89], 256],
+ 9423: [[90], 256],
+ 9424: [[97], 256],
+ 9425: [[98], 256],
+ 9426: [[99], 256],
+ 9427: [[100], 256],
+ 9428: [[101], 256],
+ 9429: [[102], 256],
+ 9430: [[103], 256],
+ 9431: [[104], 256],
+ 9432: [[105], 256],
+ 9433: [[106], 256],
+ 9434: [[107], 256],
+ 9435: [[108], 256],
+ 9436: [[109], 256],
+ 9437: [[110], 256],
+ 9438: [[111], 256],
+ 9439: [[112], 256],
+ 9440: [[113], 256],
+ 9441: [[114], 256],
+ 9442: [[115], 256],
+ 9443: [[116], 256],
+ 9444: [[117], 256],
+ 9445: [[118], 256],
+ 9446: [[119], 256],
+ 9447: [[120], 256],
+ 9448: [[121], 256],
+ 9449: [[122], 256],
+ 9450: [[48], 256]
+ },
+ 10752: {
+ 10764: [[8747, 8747, 8747, 8747], 256],
+ 10868: [[58, 58, 61], 256],
+ 10869: [[61, 61], 256],
+ 10870: [[61, 61, 61], 256],
+ 10972: [[10973, 824], 512]
+ },
+ 11264: {
+ 11388: [[106], 256],
+ 11389: [[86], 256],
+ 11503: [, 230],
+ 11504: [, 230],
+ 11505: [, 230]
+ },
+ 11520: {
+ 11631: [[11617], 256],
+ 11647: [, 9],
+ 11744: [, 230],
+ 11745: [, 230],
+ 11746: [, 230],
+ 11747: [, 230],
+ 11748: [, 230],
+ 11749: [, 230],
+ 11750: [, 230],
+ 11751: [, 230],
+ 11752: [, 230],
+ 11753: [, 230],
+ 11754: [, 230],
+ 11755: [, 230],
+ 11756: [, 230],
+ 11757: [, 230],
+ 11758: [, 230],
+ 11759: [, 230],
+ 11760: [, 230],
+ 11761: [, 230],
+ 11762: [, 230],
+ 11763: [, 230],
+ 11764: [, 230],
+ 11765: [, 230],
+ 11766: [, 230],
+ 11767: [, 230],
+ 11768: [, 230],
+ 11769: [, 230],
+ 11770: [, 230],
+ 11771: [, 230],
+ 11772: [, 230],
+ 11773: [, 230],
+ 11774: [, 230],
+ 11775: [, 230]
+ },
+ 11776: { 11935: [[27597], 256], 12019: [[40863], 256] },
+ 12032: {
+ 12032: [[19968], 256],
+ 12033: [[20008], 256],
+ 12034: [[20022], 256],
+ 12035: [[20031], 256],
+ 12036: [[20057], 256],
+ 12037: [[20101], 256],
+ 12038: [[20108], 256],
+ 12039: [[20128], 256],
+ 12040: [[20154], 256],
+ 12041: [[20799], 256],
+ 12042: [[20837], 256],
+ 12043: [[20843], 256],
+ 12044: [[20866], 256],
+ 12045: [[20886], 256],
+ 12046: [[20907], 256],
+ 12047: [[20960], 256],
+ 12048: [[20981], 256],
+ 12049: [[20992], 256],
+ 12050: [[21147], 256],
+ 12051: [[21241], 256],
+ 12052: [[21269], 256],
+ 12053: [[21274], 256],
+ 12054: [[21304], 256],
+ 12055: [[21313], 256],
+ 12056: [[21340], 256],
+ 12057: [[21353], 256],
+ 12058: [[21378], 256],
+ 12059: [[21430], 256],
+ 12060: [[21448], 256],
+ 12061: [[21475], 256],
+ 12062: [[22231], 256],
+ 12063: [[22303], 256],
+ 12064: [[22763], 256],
+ 12065: [[22786], 256],
+ 12066: [[22794], 256],
+ 12067: [[22805], 256],
+ 12068: [[22823], 256],
+ 12069: [[22899], 256],
+ 12070: [[23376], 256],
+ 12071: [[23424], 256],
+ 12072: [[23544], 256],
+ 12073: [[23567], 256],
+ 12074: [[23586], 256],
+ 12075: [[23608], 256],
+ 12076: [[23662], 256],
+ 12077: [[23665], 256],
+ 12078: [[24027], 256],
+ 12079: [[24037], 256],
+ 12080: [[24049], 256],
+ 12081: [[24062], 256],
+ 12082: [[24178], 256],
+ 12083: [[24186], 256],
+ 12084: [[24191], 256],
+ 12085: [[24308], 256],
+ 12086: [[24318], 256],
+ 12087: [[24331], 256],
+ 12088: [[24339], 256],
+ 12089: [[24400], 256],
+ 12090: [[24417], 256],
+ 12091: [[24435], 256],
+ 12092: [[24515], 256],
+ 12093: [[25096], 256],
+ 12094: [[25142], 256],
+ 12095: [[25163], 256],
+ 12096: [[25903], 256],
+ 12097: [[25908], 256],
+ 12098: [[25991], 256],
+ 12099: [[26007], 256],
+ 12100: [[26020], 256],
+ 12101: [[26041], 256],
+ 12102: [[26080], 256],
+ 12103: [[26085], 256],
+ 12104: [[26352], 256],
+ 12105: [[26376], 256],
+ 12106: [[26408], 256],
+ 12107: [[27424], 256],
+ 12108: [[27490], 256],
+ 12109: [[27513], 256],
+ 12110: [[27571], 256],
+ 12111: [[27595], 256],
+ 12112: [[27604], 256],
+ 12113: [[27611], 256],
+ 12114: [[27663], 256],
+ 12115: [[27668], 256],
+ 12116: [[27700], 256],
+ 12117: [[28779], 256],
+ 12118: [[29226], 256],
+ 12119: [[29238], 256],
+ 12120: [[29243], 256],
+ 12121: [[29247], 256],
+ 12122: [[29255], 256],
+ 12123: [[29273], 256],
+ 12124: [[29275], 256],
+ 12125: [[29356], 256],
+ 12126: [[29572], 256],
+ 12127: [[29577], 256],
+ 12128: [[29916], 256],
+ 12129: [[29926], 256],
+ 12130: [[29976], 256],
+ 12131: [[29983], 256],
+ 12132: [[29992], 256],
+ 12133: [[30000], 256],
+ 12134: [[30091], 256],
+ 12135: [[30098], 256],
+ 12136: [[30326], 256],
+ 12137: [[30333], 256],
+ 12138: [[30382], 256],
+ 12139: [[30399], 256],
+ 12140: [[30446], 256],
+ 12141: [[30683], 256],
+ 12142: [[30690], 256],
+ 12143: [[30707], 256],
+ 12144: [[31034], 256],
+ 12145: [[31160], 256],
+ 12146: [[31166], 256],
+ 12147: [[31348], 256],
+ 12148: [[31435], 256],
+ 12149: [[31481], 256],
+ 12150: [[31859], 256],
+ 12151: [[31992], 256],
+ 12152: [[32566], 256],
+ 12153: [[32593], 256],
+ 12154: [[32650], 256],
+ 12155: [[32701], 256],
+ 12156: [[32769], 256],
+ 12157: [[32780], 256],
+ 12158: [[32786], 256],
+ 12159: [[32819], 256],
+ 12160: [[32895], 256],
+ 12161: [[32905], 256],
+ 12162: [[33251], 256],
+ 12163: [[33258], 256],
+ 12164: [[33267], 256],
+ 12165: [[33276], 256],
+ 12166: [[33292], 256],
+ 12167: [[33307], 256],
+ 12168: [[33311], 256],
+ 12169: [[33390], 256],
+ 12170: [[33394], 256],
+ 12171: [[33400], 256],
+ 12172: [[34381], 256],
+ 12173: [[34411], 256],
+ 12174: [[34880], 256],
+ 12175: [[34892], 256],
+ 12176: [[34915], 256],
+ 12177: [[35198], 256],
+ 12178: [[35211], 256],
+ 12179: [[35282], 256],
+ 12180: [[35328], 256],
+ 12181: [[35895], 256],
+ 12182: [[35910], 256],
+ 12183: [[35925], 256],
+ 12184: [[35960], 256],
+ 12185: [[35997], 256],
+ 12186: [[36196], 256],
+ 12187: [[36208], 256],
+ 12188: [[36275], 256],
+ 12189: [[36523], 256],
+ 12190: [[36554], 256],
+ 12191: [[36763], 256],
+ 12192: [[36784], 256],
+ 12193: [[36789], 256],
+ 12194: [[37009], 256],
+ 12195: [[37193], 256],
+ 12196: [[37318], 256],
+ 12197: [[37324], 256],
+ 12198: [[37329], 256],
+ 12199: [[38263], 256],
+ 12200: [[38272], 256],
+ 12201: [[38428], 256],
+ 12202: [[38582], 256],
+ 12203: [[38585], 256],
+ 12204: [[38632], 256],
+ 12205: [[38737], 256],
+ 12206: [[38750], 256],
+ 12207: [[38754], 256],
+ 12208: [[38761], 256],
+ 12209: [[38859], 256],
+ 12210: [[38893], 256],
+ 12211: [[38899], 256],
+ 12212: [[38913], 256],
+ 12213: [[39080], 256],
+ 12214: [[39131], 256],
+ 12215: [[39135], 256],
+ 12216: [[39318], 256],
+ 12217: [[39321], 256],
+ 12218: [[39340], 256],
+ 12219: [[39592], 256],
+ 12220: [[39640], 256],
+ 12221: [[39647], 256],
+ 12222: [[39717], 256],
+ 12223: [[39727], 256],
+ 12224: [[39730], 256],
+ 12225: [[39740], 256],
+ 12226: [[39770], 256],
+ 12227: [[40165], 256],
+ 12228: [[40565], 256],
+ 12229: [[40575], 256],
+ 12230: [[40613], 256],
+ 12231: [[40635], 256],
+ 12232: [[40643], 256],
+ 12233: [[40653], 256],
+ 12234: [[40657], 256],
+ 12235: [[40697], 256],
+ 12236: [[40701], 256],
+ 12237: [[40718], 256],
+ 12238: [[40723], 256],
+ 12239: [[40736], 256],
+ 12240: [[40763], 256],
+ 12241: [[40778], 256],
+ 12242: [[40786], 256],
+ 12243: [[40845], 256],
+ 12244: [[40860], 256],
+ 12245: [[40864], 256]
+ },
+ 12288: {
+ 12288: [[32], 256],
+ 12330: [, 218],
+ 12331: [, 228],
+ 12332: [, 232],
+ 12333: [, 222],
+ 12334: [, 224],
+ 12335: [, 224],
+ 12342: [[12306], 256],
+ 12344: [[21313], 256],
+ 12345: [[21316], 256],
+ 12346: [[21317], 256],
+ 12358: [, , { 12441: 12436 }],
+ 12363: [, , { 12441: 12364 }],
+ 12364: [[12363, 12441]],
+ 12365: [, , { 12441: 12366 }],
+ 12366: [[12365, 12441]],
+ 12367: [, , { 12441: 12368 }],
+ 12368: [[12367, 12441]],
+ 12369: [, , { 12441: 12370 }],
+ 12370: [[12369, 12441]],
+ 12371: [, , { 12441: 12372 }],
+ 12372: [[12371, 12441]],
+ 12373: [, , { 12441: 12374 }],
+ 12374: [[12373, 12441]],
+ 12375: [, , { 12441: 12376 }],
+ 12376: [[12375, 12441]],
+ 12377: [, , { 12441: 12378 }],
+ 12378: [[12377, 12441]],
+ 12379: [, , { 12441: 12380 }],
+ 12380: [[12379, 12441]],
+ 12381: [, , { 12441: 12382 }],
+ 12382: [[12381, 12441]],
+ 12383: [, , { 12441: 12384 }],
+ 12384: [[12383, 12441]],
+ 12385: [, , { 12441: 12386 }],
+ 12386: [[12385, 12441]],
+ 12388: [, , { 12441: 12389 }],
+ 12389: [[12388, 12441]],
+ 12390: [, , { 12441: 12391 }],
+ 12391: [[12390, 12441]],
+ 12392: [, , { 12441: 12393 }],
+ 12393: [[12392, 12441]],
+ 12399: [, , { 12441: 12400, 12442: 12401 }],
+ 12400: [[12399, 12441]],
+ 12401: [[12399, 12442]],
+ 12402: [, , { 12441: 12403, 12442: 12404 }],
+ 12403: [[12402, 12441]],
+ 12404: [[12402, 12442]],
+ 12405: [, , { 12441: 12406, 12442: 12407 }],
+ 12406: [[12405, 12441]],
+ 12407: [[12405, 12442]],
+ 12408: [, , { 12441: 12409, 12442: 12410 }],
+ 12409: [[12408, 12441]],
+ 12410: [[12408, 12442]],
+ 12411: [, , { 12441: 12412, 12442: 12413 }],
+ 12412: [[12411, 12441]],
+ 12413: [[12411, 12442]],
+ 12436: [[12358, 12441]],
+ 12441: [, 8],
+ 12442: [, 8],
+ 12443: [[32, 12441], 256],
+ 12444: [[32, 12442], 256],
+ 12445: [, , { 12441: 12446 }],
+ 12446: [[12445, 12441]],
+ 12447: [[12424, 12426], 256],
+ 12454: [, , { 12441: 12532 }],
+ 12459: [, , { 12441: 12460 }],
+ 12460: [[12459, 12441]],
+ 12461: [, , { 12441: 12462 }],
+ 12462: [[12461, 12441]],
+ 12463: [, , { 12441: 12464 }],
+ 12464: [[12463, 12441]],
+ 12465: [, , { 12441: 12466 }],
+ 12466: [[12465, 12441]],
+ 12467: [, , { 12441: 12468 }],
+ 12468: [[12467, 12441]],
+ 12469: [, , { 12441: 12470 }],
+ 12470: [[12469, 12441]],
+ 12471: [, , { 12441: 12472 }],
+ 12472: [[12471, 12441]],
+ 12473: [, , { 12441: 12474 }],
+ 12474: [[12473, 12441]],
+ 12475: [, , { 12441: 12476 }],
+ 12476: [[12475, 12441]],
+ 12477: [, , { 12441: 12478 }],
+ 12478: [[12477, 12441]],
+ 12479: [, , { 12441: 12480 }],
+ 12480: [[12479, 12441]],
+ 12481: [, , { 12441: 12482 }],
+ 12482: [[12481, 12441]],
+ 12484: [, , { 12441: 12485 }],
+ 12485: [[12484, 12441]],
+ 12486: [, , { 12441: 12487 }],
+ 12487: [[12486, 12441]],
+ 12488: [, , { 12441: 12489 }],
+ 12489: [[12488, 12441]],
+ 12495: [, , { 12441: 12496, 12442: 12497 }],
+ 12496: [[12495, 12441]],
+ 12497: [[12495, 12442]],
+ 12498: [, , { 12441: 12499, 12442: 12500 }],
+ 12499: [[12498, 12441]],
+ 12500: [[12498, 12442]],
+ 12501: [, , { 12441: 12502, 12442: 12503 }],
+ 12502: [[12501, 12441]],
+ 12503: [[12501, 12442]],
+ 12504: [, , { 12441: 12505, 12442: 12506 }],
+ 12505: [[12504, 12441]],
+ 12506: [[12504, 12442]],
+ 12507: [, , { 12441: 12508, 12442: 12509 }],
+ 12508: [[12507, 12441]],
+ 12509: [[12507, 12442]],
+ 12527: [, , { 12441: 12535 }],
+ 12528: [, , { 12441: 12536 }],
+ 12529: [, , { 12441: 12537 }],
+ 12530: [, , { 12441: 12538 }],
+ 12532: [[12454, 12441]],
+ 12535: [[12527, 12441]],
+ 12536: [[12528, 12441]],
+ 12537: [[12529, 12441]],
+ 12538: [[12530, 12441]],
+ 12541: [, , { 12441: 12542 }],
+ 12542: [[12541, 12441]],
+ 12543: [[12467, 12488], 256]
+ },
+ 12544: {
+ 12593: [[4352], 256],
+ 12594: [[4353], 256],
+ 12595: [[4522], 256],
+ 12596: [[4354], 256],
+ 12597: [[4524], 256],
+ 12598: [[4525], 256],
+ 12599: [[4355], 256],
+ 12600: [[4356], 256],
+ 12601: [[4357], 256],
+ 12602: [[4528], 256],
+ 12603: [[4529], 256],
+ 12604: [[4530], 256],
+ 12605: [[4531], 256],
+ 12606: [[4532], 256],
+ 12607: [[4533], 256],
+ 12608: [[4378], 256],
+ 12609: [[4358], 256],
+ 12610: [[4359], 256],
+ 12611: [[4360], 256],
+ 12612: [[4385], 256],
+ 12613: [[4361], 256],
+ 12614: [[4362], 256],
+ 12615: [[4363], 256],
+ 12616: [[4364], 256],
+ 12617: [[4365], 256],
+ 12618: [[4366], 256],
+ 12619: [[4367], 256],
+ 12620: [[4368], 256],
+ 12621: [[4369], 256],
+ 12622: [[4370], 256],
+ 12623: [[4449], 256],
+ 12624: [[4450], 256],
+ 12625: [[4451], 256],
+ 12626: [[4452], 256],
+ 12627: [[4453], 256],
+ 12628: [[4454], 256],
+ 12629: [[4455], 256],
+ 12630: [[4456], 256],
+ 12631: [[4457], 256],
+ 12632: [[4458], 256],
+ 12633: [[4459], 256],
+ 12634: [[4460], 256],
+ 12635: [[4461], 256],
+ 12636: [[4462], 256],
+ 12637: [[4463], 256],
+ 12638: [[4464], 256],
+ 12639: [[4465], 256],
+ 12640: [[4466], 256],
+ 12641: [[4467], 256],
+ 12642: [[4468], 256],
+ 12643: [[4469], 256],
+ 12644: [[4448], 256],
+ 12645: [[4372], 256],
+ 12646: [[4373], 256],
+ 12647: [[4551], 256],
+ 12648: [[4552], 256],
+ 12649: [[4556], 256],
+ 12650: [[4558], 256],
+ 12651: [[4563], 256],
+ 12652: [[4567], 256],
+ 12653: [[4569], 256],
+ 12654: [[4380], 256],
+ 12655: [[4573], 256],
+ 12656: [[4575], 256],
+ 12657: [[4381], 256],
+ 12658: [[4382], 256],
+ 12659: [[4384], 256],
+ 12660: [[4386], 256],
+ 12661: [[4387], 256],
+ 12662: [[4391], 256],
+ 12663: [[4393], 256],
+ 12664: [[4395], 256],
+ 12665: [[4396], 256],
+ 12666: [[4397], 256],
+ 12667: [[4398], 256],
+ 12668: [[4399], 256],
+ 12669: [[4402], 256],
+ 12670: [[4406], 256],
+ 12671: [[4416], 256],
+ 12672: [[4423], 256],
+ 12673: [[4428], 256],
+ 12674: [[4593], 256],
+ 12675: [[4594], 256],
+ 12676: [[4439], 256],
+ 12677: [[4440], 256],
+ 12678: [[4441], 256],
+ 12679: [[4484], 256],
+ 12680: [[4485], 256],
+ 12681: [[4488], 256],
+ 12682: [[4497], 256],
+ 12683: [[4498], 256],
+ 12684: [[4500], 256],
+ 12685: [[4510], 256],
+ 12686: [[4513], 256],
+ 12690: [[19968], 256],
+ 12691: [[20108], 256],
+ 12692: [[19977], 256],
+ 12693: [[22235], 256],
+ 12694: [[19978], 256],
+ 12695: [[20013], 256],
+ 12696: [[19979], 256],
+ 12697: [[30002], 256],
+ 12698: [[20057], 256],
+ 12699: [[19993], 256],
+ 12700: [[19969], 256],
+ 12701: [[22825], 256],
+ 12702: [[22320], 256],
+ 12703: [[20154], 256]
+ },
+ 12800: {
+ 12800: [[40, 4352, 41], 256],
+ 12801: [[40, 4354, 41], 256],
+ 12802: [[40, 4355, 41], 256],
+ 12803: [[40, 4357, 41], 256],
+ 12804: [[40, 4358, 41], 256],
+ 12805: [[40, 4359, 41], 256],
+ 12806: [[40, 4361, 41], 256],
+ 12807: [[40, 4363, 41], 256],
+ 12808: [[40, 4364, 41], 256],
+ 12809: [[40, 4366, 41], 256],
+ 12810: [[40, 4367, 41], 256],
+ 12811: [[40, 4368, 41], 256],
+ 12812: [[40, 4369, 41], 256],
+ 12813: [[40, 4370, 41], 256],
+ 12814: [[40, 4352, 4449, 41], 256],
+ 12815: [[40, 4354, 4449, 41], 256],
+ 12816: [[40, 4355, 4449, 41], 256],
+ 12817: [[40, 4357, 4449, 41], 256],
+ 12818: [[40, 4358, 4449, 41], 256],
+ 12819: [[40, 4359, 4449, 41], 256],
+ 12820: [[40, 4361, 4449, 41], 256],
+ 12821: [[40, 4363, 4449, 41], 256],
+ 12822: [[40, 4364, 4449, 41], 256],
+ 12823: [[40, 4366, 4449, 41], 256],
+ 12824: [[40, 4367, 4449, 41], 256],
+ 12825: [[40, 4368, 4449, 41], 256],
+ 12826: [[40, 4369, 4449, 41], 256],
+ 12827: [[40, 4370, 4449, 41], 256],
+ 12828: [[40, 4364, 4462, 41], 256],
+ 12829: [[40, 4363, 4457, 4364, 4453, 4523, 41], 256],
+ 12830: [[40, 4363, 4457, 4370, 4462, 41], 256],
+ 12832: [[40, 19968, 41], 256],
+ 12833: [[40, 20108, 41], 256],
+ 12834: [[40, 19977, 41], 256],
+ 12835: [[40, 22235, 41], 256],
+ 12836: [[40, 20116, 41], 256],
+ 12837: [[40, 20845, 41], 256],
+ 12838: [[40, 19971, 41], 256],
+ 12839: [[40, 20843, 41], 256],
+ 12840: [[40, 20061, 41], 256],
+ 12841: [[40, 21313, 41], 256],
+ 12842: [[40, 26376, 41], 256],
+ 12843: [[40, 28779, 41], 256],
+ 12844: [[40, 27700, 41], 256],
+ 12845: [[40, 26408, 41], 256],
+ 12846: [[40, 37329, 41], 256],
+ 12847: [[40, 22303, 41], 256],
+ 12848: [[40, 26085, 41], 256],
+ 12849: [[40, 26666, 41], 256],
+ 12850: [[40, 26377, 41], 256],
+ 12851: [[40, 31038, 41], 256],
+ 12852: [[40, 21517, 41], 256],
+ 12853: [[40, 29305, 41], 256],
+ 12854: [[40, 36001, 41], 256],
+ 12855: [[40, 31069, 41], 256],
+ 12856: [[40, 21172, 41], 256],
+ 12857: [[40, 20195, 41], 256],
+ 12858: [[40, 21628, 41], 256],
+ 12859: [[40, 23398, 41], 256],
+ 12860: [[40, 30435, 41], 256],
+ 12861: [[40, 20225, 41], 256],
+ 12862: [[40, 36039, 41], 256],
+ 12863: [[40, 21332, 41], 256],
+ 12864: [[40, 31085, 41], 256],
+ 12865: [[40, 20241, 41], 256],
+ 12866: [[40, 33258, 41], 256],
+ 12867: [[40, 33267, 41], 256],
+ 12868: [[21839], 256],
+ 12869: [[24188], 256],
+ 12870: [[25991], 256],
+ 12871: [[31631], 256],
+ 12880: [[80, 84, 69], 256],
+ 12881: [[50, 49], 256],
+ 12882: [[50, 50], 256],
+ 12883: [[50, 51], 256],
+ 12884: [[50, 52], 256],
+ 12885: [[50, 53], 256],
+ 12886: [[50, 54], 256],
+ 12887: [[50, 55], 256],
+ 12888: [[50, 56], 256],
+ 12889: [[50, 57], 256],
+ 12890: [[51, 48], 256],
+ 12891: [[51, 49], 256],
+ 12892: [[51, 50], 256],
+ 12893: [[51, 51], 256],
+ 12894: [[51, 52], 256],
+ 12895: [[51, 53], 256],
+ 12896: [[4352], 256],
+ 12897: [[4354], 256],
+ 12898: [[4355], 256],
+ 12899: [[4357], 256],
+ 12900: [[4358], 256],
+ 12901: [[4359], 256],
+ 12902: [[4361], 256],
+ 12903: [[4363], 256],
+ 12904: [[4364], 256],
+ 12905: [[4366], 256],
+ 12906: [[4367], 256],
+ 12907: [[4368], 256],
+ 12908: [[4369], 256],
+ 12909: [[4370], 256],
+ 12910: [[4352, 4449], 256],
+ 12911: [[4354, 4449], 256],
+ 12912: [[4355, 4449], 256],
+ 12913: [[4357, 4449], 256],
+ 12914: [[4358, 4449], 256],
+ 12915: [[4359, 4449], 256],
+ 12916: [[4361, 4449], 256],
+ 12917: [[4363, 4449], 256],
+ 12918: [[4364, 4449], 256],
+ 12919: [[4366, 4449], 256],
+ 12920: [[4367, 4449], 256],
+ 12921: [[4368, 4449], 256],
+ 12922: [[4369, 4449], 256],
+ 12923: [[4370, 4449], 256],
+ 12924: [[4366, 4449, 4535, 4352, 4457], 256],
+ 12925: [[4364, 4462, 4363, 4468], 256],
+ 12926: [[4363, 4462], 256],
+ 12928: [[19968], 256],
+ 12929: [[20108], 256],
+ 12930: [[19977], 256],
+ 12931: [[22235], 256],
+ 12932: [[20116], 256],
+ 12933: [[20845], 256],
+ 12934: [[19971], 256],
+ 12935: [[20843], 256],
+ 12936: [[20061], 256],
+ 12937: [[21313], 256],
+ 12938: [[26376], 256],
+ 12939: [[28779], 256],
+ 12940: [[27700], 256],
+ 12941: [[26408], 256],
+ 12942: [[37329], 256],
+ 12943: [[22303], 256],
+ 12944: [[26085], 256],
+ 12945: [[26666], 256],
+ 12946: [[26377], 256],
+ 12947: [[31038], 256],
+ 12948: [[21517], 256],
+ 12949: [[29305], 256],
+ 12950: [[36001], 256],
+ 12951: [[31069], 256],
+ 12952: [[21172], 256],
+ 12953: [[31192], 256],
+ 12954: [[30007], 256],
+ 12955: [[22899], 256],
+ 12956: [[36969], 256],
+ 12957: [[20778], 256],
+ 12958: [[21360], 256],
+ 12959: [[27880], 256],
+ 12960: [[38917], 256],
+ 12961: [[20241], 256],
+ 12962: [[20889], 256],
+ 12963: [[27491], 256],
+ 12964: [[19978], 256],
+ 12965: [[20013], 256],
+ 12966: [[19979], 256],
+ 12967: [[24038], 256],
+ 12968: [[21491], 256],
+ 12969: [[21307], 256],
+ 12970: [[23447], 256],
+ 12971: [[23398], 256],
+ 12972: [[30435], 256],
+ 12973: [[20225], 256],
+ 12974: [[36039], 256],
+ 12975: [[21332], 256],
+ 12976: [[22812], 256],
+ 12977: [[51, 54], 256],
+ 12978: [[51, 55], 256],
+ 12979: [[51, 56], 256],
+ 12980: [[51, 57], 256],
+ 12981: [[52, 48], 256],
+ 12982: [[52, 49], 256],
+ 12983: [[52, 50], 256],
+ 12984: [[52, 51], 256],
+ 12985: [[52, 52], 256],
+ 12986: [[52, 53], 256],
+ 12987: [[52, 54], 256],
+ 12988: [[52, 55], 256],
+ 12989: [[52, 56], 256],
+ 12990: [[52, 57], 256],
+ 12991: [[53, 48], 256],
+ 12992: [[49, 26376], 256],
+ 12993: [[50, 26376], 256],
+ 12994: [[51, 26376], 256],
+ 12995: [[52, 26376], 256],
+ 12996: [[53, 26376], 256],
+ 12997: [[54, 26376], 256],
+ 12998: [[55, 26376], 256],
+ 12999: [[56, 26376], 256],
+ 13000: [[57, 26376], 256],
+ 13001: [[49, 48, 26376], 256],
+ 13002: [[49, 49, 26376], 256],
+ 13003: [[49, 50, 26376], 256],
+ 13004: [[72, 103], 256],
+ 13005: [[101, 114, 103], 256],
+ 13006: [[101, 86], 256],
+ 13007: [[76, 84, 68], 256],
+ 13008: [[12450], 256],
+ 13009: [[12452], 256],
+ 13010: [[12454], 256],
+ 13011: [[12456], 256],
+ 13012: [[12458], 256],
+ 13013: [[12459], 256],
+ 13014: [[12461], 256],
+ 13015: [[12463], 256],
+ 13016: [[12465], 256],
+ 13017: [[12467], 256],
+ 13018: [[12469], 256],
+ 13019: [[12471], 256],
+ 13020: [[12473], 256],
+ 13021: [[12475], 256],
+ 13022: [[12477], 256],
+ 13023: [[12479], 256],
+ 13024: [[12481], 256],
+ 13025: [[12484], 256],
+ 13026: [[12486], 256],
+ 13027: [[12488], 256],
+ 13028: [[12490], 256],
+ 13029: [[12491], 256],
+ 13030: [[12492], 256],
+ 13031: [[12493], 256],
+ 13032: [[12494], 256],
+ 13033: [[12495], 256],
+ 13034: [[12498], 256],
+ 13035: [[12501], 256],
+ 13036: [[12504], 256],
+ 13037: [[12507], 256],
+ 13038: [[12510], 256],
+ 13039: [[12511], 256],
+ 13040: [[12512], 256],
+ 13041: [[12513], 256],
+ 13042: [[12514], 256],
+ 13043: [[12516], 256],
+ 13044: [[12518], 256],
+ 13045: [[12520], 256],
+ 13046: [[12521], 256],
+ 13047: [[12522], 256],
+ 13048: [[12523], 256],
+ 13049: [[12524], 256],
+ 13050: [[12525], 256],
+ 13051: [[12527], 256],
+ 13052: [[12528], 256],
+ 13053: [[12529], 256],
+ 13054: [[12530], 256]
+ },
+ 13056: {
+ 13056: [[12450, 12497, 12540, 12488], 256],
+ 13057: [[12450, 12523, 12501, 12449], 256],
+ 13058: [[12450, 12531, 12506, 12450], 256],
+ 13059: [[12450, 12540, 12523], 256],
+ 13060: [[12452, 12491, 12531, 12464], 256],
+ 13061: [[12452, 12531, 12481], 256],
+ 13062: [[12454, 12457, 12531], 256],
+ 13063: [[12456, 12473, 12463, 12540, 12489], 256],
+ 13064: [[12456, 12540, 12459, 12540], 256],
+ 13065: [[12458, 12531, 12473], 256],
+ 13066: [[12458, 12540, 12512], 256],
+ 13067: [[12459, 12452, 12522], 256],
+ 13068: [[12459, 12521, 12483, 12488], 256],
+ 13069: [[12459, 12525, 12522, 12540], 256],
+ 13070: [[12460, 12525, 12531], 256],
+ 13071: [[12460, 12531, 12510], 256],
+ 13072: [[12462, 12460], 256],
+ 13073: [[12462, 12491, 12540], 256],
+ 13074: [[12461, 12517, 12522, 12540], 256],
+ 13075: [[12462, 12523, 12480, 12540], 256],
+ 13076: [[12461, 12525], 256],
+ 13077: [[12461, 12525, 12464, 12521, 12512], 256],
+ 13078: [[12461, 12525, 12513, 12540, 12488, 12523], 256],
+ 13079: [[12461, 12525, 12527, 12483, 12488], 256],
+ 13080: [[12464, 12521, 12512], 256],
+ 13081: [[12464, 12521, 12512, 12488, 12531], 256],
+ 13082: [[12463, 12523, 12476, 12452, 12525], 256],
+ 13083: [[12463, 12525, 12540, 12493], 256],
+ 13084: [[12465, 12540, 12473], 256],
+ 13085: [[12467, 12523, 12490], 256],
+ 13086: [[12467, 12540, 12509], 256],
+ 13087: [[12469, 12452, 12463, 12523], 256],
+ 13088: [[12469, 12531, 12481, 12540, 12512], 256],
+ 13089: [[12471, 12522, 12531, 12464], 256],
+ 13090: [[12475, 12531, 12481], 256],
+ 13091: [[12475, 12531, 12488], 256],
+ 13092: [[12480, 12540, 12473], 256],
+ 13093: [[12487, 12471], 256],
+ 13094: [[12489, 12523], 256],
+ 13095: [[12488, 12531], 256],
+ 13096: [[12490, 12494], 256],
+ 13097: [[12494, 12483, 12488], 256],
+ 13098: [[12495, 12452, 12484], 256],
+ 13099: [[12497, 12540, 12475, 12531, 12488], 256],
+ 13100: [[12497, 12540, 12484], 256],
+ 13101: [[12496, 12540, 12524, 12523], 256],
+ 13102: [[12500, 12450, 12473, 12488, 12523], 256],
+ 13103: [[12500, 12463, 12523], 256],
+ 13104: [[12500, 12467], 256],
+ 13105: [[12499, 12523], 256],
+ 13106: [[12501, 12449, 12521, 12483, 12489], 256],
+ 13107: [[12501, 12451, 12540, 12488], 256],
+ 13108: [[12502, 12483, 12471, 12455, 12523], 256],
+ 13109: [[12501, 12521, 12531], 256],
+ 13110: [[12504, 12463, 12479, 12540, 12523], 256],
+ 13111: [[12506, 12477], 256],
+ 13112: [[12506, 12491, 12498], 256],
+ 13113: [[12504, 12523, 12484], 256],
+ 13114: [[12506, 12531, 12473], 256],
+ 13115: [[12506, 12540, 12472], 256],
+ 13116: [[12505, 12540, 12479], 256],
+ 13117: [[12509, 12452, 12531, 12488], 256],
+ 13118: [[12508, 12523, 12488], 256],
+ 13119: [[12507, 12531], 256],
+ 13120: [[12509, 12531, 12489], 256],
+ 13121: [[12507, 12540, 12523], 256],
+ 13122: [[12507, 12540, 12531], 256],
+ 13123: [[12510, 12452, 12463, 12525], 256],
+ 13124: [[12510, 12452, 12523], 256],
+ 13125: [[12510, 12483, 12495], 256],
+ 13126: [[12510, 12523, 12463], 256],
+ 13127: [[12510, 12531, 12471, 12519, 12531], 256],
+ 13128: [[12511, 12463, 12525, 12531], 256],
+ 13129: [[12511, 12522], 256],
+ 13130: [[12511, 12522, 12496, 12540, 12523], 256],
+ 13131: [[12513, 12460], 256],
+ 13132: [[12513, 12460, 12488, 12531], 256],
+ 13133: [[12513, 12540, 12488, 12523], 256],
+ 13134: [[12516, 12540, 12489], 256],
+ 13135: [[12516, 12540, 12523], 256],
+ 13136: [[12518, 12450, 12531], 256],
+ 13137: [[12522, 12483, 12488, 12523], 256],
+ 13138: [[12522, 12521], 256],
+ 13139: [[12523, 12500, 12540], 256],
+ 13140: [[12523, 12540, 12502, 12523], 256],
+ 13141: [[12524, 12512], 256],
+ 13142: [[12524, 12531, 12488, 12466, 12531], 256],
+ 13143: [[12527, 12483, 12488], 256],
+ 13144: [[48, 28857], 256],
+ 13145: [[49, 28857], 256],
+ 13146: [[50, 28857], 256],
+ 13147: [[51, 28857], 256],
+ 13148: [[52, 28857], 256],
+ 13149: [[53, 28857], 256],
+ 13150: [[54, 28857], 256],
+ 13151: [[55, 28857], 256],
+ 13152: [[56, 28857], 256],
+ 13153: [[57, 28857], 256],
+ 13154: [[49, 48, 28857], 256],
+ 13155: [[49, 49, 28857], 256],
+ 13156: [[49, 50, 28857], 256],
+ 13157: [[49, 51, 28857], 256],
+ 13158: [[49, 52, 28857], 256],
+ 13159: [[49, 53, 28857], 256],
+ 13160: [[49, 54, 28857], 256],
+ 13161: [[49, 55, 28857], 256],
+ 13162: [[49, 56, 28857], 256],
+ 13163: [[49, 57, 28857], 256],
+ 13164: [[50, 48, 28857], 256],
+ 13165: [[50, 49, 28857], 256],
+ 13166: [[50, 50, 28857], 256],
+ 13167: [[50, 51, 28857], 256],
+ 13168: [[50, 52, 28857], 256],
+ 13169: [[104, 80, 97], 256],
+ 13170: [[100, 97], 256],
+ 13171: [[65, 85], 256],
+ 13172: [[98, 97, 114], 256],
+ 13173: [[111, 86], 256],
+ 13174: [[112, 99], 256],
+ 13175: [[100, 109], 256],
+ 13176: [[100, 109, 178], 256],
+ 13177: [[100, 109, 179], 256],
+ 13178: [[73, 85], 256],
+ 13179: [[24179, 25104], 256],
+ 13180: [[26157, 21644], 256],
+ 13181: [[22823, 27491], 256],
+ 13182: [[26126, 27835], 256],
+ 13183: [[26666, 24335, 20250, 31038], 256],
+ 13184: [[112, 65], 256],
+ 13185: [[110, 65], 256],
+ 13186: [[956, 65], 256],
+ 13187: [[109, 65], 256],
+ 13188: [[107, 65], 256],
+ 13189: [[75, 66], 256],
+ 13190: [[77, 66], 256],
+ 13191: [[71, 66], 256],
+ 13192: [[99, 97, 108], 256],
+ 13193: [[107, 99, 97, 108], 256],
+ 13194: [[112, 70], 256],
+ 13195: [[110, 70], 256],
+ 13196: [[956, 70], 256],
+ 13197: [[956, 103], 256],
+ 13198: [[109, 103], 256],
+ 13199: [[107, 103], 256],
+ 13200: [[72, 122], 256],
+ 13201: [[107, 72, 122], 256],
+ 13202: [[77, 72, 122], 256],
+ 13203: [[71, 72, 122], 256],
+ 13204: [[84, 72, 122], 256],
+ 13205: [[956, 8467], 256],
+ 13206: [[109, 8467], 256],
+ 13207: [[100, 8467], 256],
+ 13208: [[107, 8467], 256],
+ 13209: [[102, 109], 256],
+ 13210: [[110, 109], 256],
+ 13211: [[956, 109], 256],
+ 13212: [[109, 109], 256],
+ 13213: [[99, 109], 256],
+ 13214: [[107, 109], 256],
+ 13215: [[109, 109, 178], 256],
+ 13216: [[99, 109, 178], 256],
+ 13217: [[109, 178], 256],
+ 13218: [[107, 109, 178], 256],
+ 13219: [[109, 109, 179], 256],
+ 13220: [[99, 109, 179], 256],
+ 13221: [[109, 179], 256],
+ 13222: [[107, 109, 179], 256],
+ 13223: [[109, 8725, 115], 256],
+ 13224: [[109, 8725, 115, 178], 256],
+ 13225: [[80, 97], 256],
+ 13226: [[107, 80, 97], 256],
+ 13227: [[77, 80, 97], 256],
+ 13228: [[71, 80, 97], 256],
+ 13229: [[114, 97, 100], 256],
+ 13230: [[114, 97, 100, 8725, 115], 256],
+ 13231: [[114, 97, 100, 8725, 115, 178], 256],
+ 13232: [[112, 115], 256],
+ 13233: [[110, 115], 256],
+ 13234: [[956, 115], 256],
+ 13235: [[109, 115], 256],
+ 13236: [[112, 86], 256],
+ 13237: [[110, 86], 256],
+ 13238: [[956, 86], 256],
+ 13239: [[109, 86], 256],
+ 13240: [[107, 86], 256],
+ 13241: [[77, 86], 256],
+ 13242: [[112, 87], 256],
+ 13243: [[110, 87], 256],
+ 13244: [[956, 87], 256],
+ 13245: [[109, 87], 256],
+ 13246: [[107, 87], 256],
+ 13247: [[77, 87], 256],
+ 13248: [[107, 937], 256],
+ 13249: [[77, 937], 256],
+ 13250: [[97, 46, 109, 46], 256],
+ 13251: [[66, 113], 256],
+ 13252: [[99, 99], 256],
+ 13253: [[99, 100], 256],
+ 13254: [[67, 8725, 107, 103], 256],
+ 13255: [[67, 111, 46], 256],
+ 13256: [[100, 66], 256],
+ 13257: [[71, 121], 256],
+ 13258: [[104, 97], 256],
+ 13259: [[72, 80], 256],
+ 13260: [[105, 110], 256],
+ 13261: [[75, 75], 256],
+ 13262: [[75, 77], 256],
+ 13263: [[107, 116], 256],
+ 13264: [[108, 109], 256],
+ 13265: [[108, 110], 256],
+ 13266: [[108, 111, 103], 256],
+ 13267: [[108, 120], 256],
+ 13268: [[109, 98], 256],
+ 13269: [[109, 105, 108], 256],
+ 13270: [[109, 111, 108], 256],
+ 13271: [[80, 72], 256],
+ 13272: [[112, 46, 109, 46], 256],
+ 13273: [[80, 80, 77], 256],
+ 13274: [[80, 82], 256],
+ 13275: [[115, 114], 256],
+ 13276: [[83, 118], 256],
+ 13277: [[87, 98], 256],
+ 13278: [[86, 8725, 109], 256],
+ 13279: [[65, 8725, 109], 256],
+ 13280: [[49, 26085], 256],
+ 13281: [[50, 26085], 256],
+ 13282: [[51, 26085], 256],
+ 13283: [[52, 26085], 256],
+ 13284: [[53, 26085], 256],
+ 13285: [[54, 26085], 256],
+ 13286: [[55, 26085], 256],
+ 13287: [[56, 26085], 256],
+ 13288: [[57, 26085], 256],
+ 13289: [[49, 48, 26085], 256],
+ 13290: [[49, 49, 26085], 256],
+ 13291: [[49, 50, 26085], 256],
+ 13292: [[49, 51, 26085], 256],
+ 13293: [[49, 52, 26085], 256],
+ 13294: [[49, 53, 26085], 256],
+ 13295: [[49, 54, 26085], 256],
+ 13296: [[49, 55, 26085], 256],
+ 13297: [[49, 56, 26085], 256],
+ 13298: [[49, 57, 26085], 256],
+ 13299: [[50, 48, 26085], 256],
+ 13300: [[50, 49, 26085], 256],
+ 13301: [[50, 50, 26085], 256],
+ 13302: [[50, 51, 26085], 256],
+ 13303: [[50, 52, 26085], 256],
+ 13304: [[50, 53, 26085], 256],
+ 13305: [[50, 54, 26085], 256],
+ 13306: [[50, 55, 26085], 256],
+ 13307: [[50, 56, 26085], 256],
+ 13308: [[50, 57, 26085], 256],
+ 13309: [[51, 48, 26085], 256],
+ 13310: [[51, 49, 26085], 256],
+ 13311: [[103, 97, 108], 256]
+ },
+ 42496: {
+ 42607: [, 230],
+ 42612: [, 230],
+ 42613: [, 230],
+ 42614: [, 230],
+ 42615: [, 230],
+ 42616: [, 230],
+ 42617: [, 230],
+ 42618: [, 230],
+ 42619: [, 230],
+ 42620: [, 230],
+ 42621: [, 230],
+ 42655: [, 230],
+ 42736: [, 230],
+ 42737: [, 230]
+ },
+ 42752: { 42864: [[42863], 256], 43000: [[294], 256], 43001: [[339], 256] },
+ 43008: {
+ 43014: [, 9],
+ 43204: [, 9],
+ 43232: [, 230],
+ 43233: [, 230],
+ 43234: [, 230],
+ 43235: [, 230],
+ 43236: [, 230],
+ 43237: [, 230],
+ 43238: [, 230],
+ 43239: [, 230],
+ 43240: [, 230],
+ 43241: [, 230],
+ 43242: [, 230],
+ 43243: [, 230],
+ 43244: [, 230],
+ 43245: [, 230],
+ 43246: [, 230],
+ 43247: [, 230],
+ 43248: [, 230],
+ 43249: [, 230]
+ },
+ 43264: {
+ 43307: [, 220],
+ 43308: [, 220],
+ 43309: [, 220],
+ 43347: [, 9],
+ 43443: [, 7],
+ 43456: [, 9]
+ },
+ 43520: {
+ 43696: [, 230],
+ 43698: [, 230],
+ 43699: [, 230],
+ 43700: [, 220],
+ 43703: [, 230],
+ 43704: [, 230],
+ 43710: [, 230],
+ 43711: [, 230],
+ 43713: [, 230],
+ 43766: [, 9]
+ },
+ 43776: { 44013: [, 9] },
+ 53504: {
+ 119134: [[119127, 119141], 512],
+ 119135: [[119128, 119141], 512],
+ 119136: [[119135, 119150], 512],
+ 119137: [[119135, 119151], 512],
+ 119138: [[119135, 119152], 512],
+ 119139: [[119135, 119153], 512],
+ 119140: [[119135, 119154], 512],
+ 119141: [, 216],
+ 119142: [, 216],
+ 119143: [, 1],
+ 119144: [, 1],
+ 119145: [, 1],
+ 119149: [, 226],
+ 119150: [, 216],
+ 119151: [, 216],
+ 119152: [, 216],
+ 119153: [, 216],
+ 119154: [, 216],
+ 119163: [, 220],
+ 119164: [, 220],
+ 119165: [, 220],
+ 119166: [, 220],
+ 119167: [, 220],
+ 119168: [, 220],
+ 119169: [, 220],
+ 119170: [, 220],
+ 119173: [, 230],
+ 119174: [, 230],
+ 119175: [, 230],
+ 119176: [, 230],
+ 119177: [, 230],
+ 119178: [, 220],
+ 119179: [, 220],
+ 119210: [, 230],
+ 119211: [, 230],
+ 119212: [, 230],
+ 119213: [, 230],
+ 119227: [[119225, 119141], 512],
+ 119228: [[119226, 119141], 512],
+ 119229: [[119227, 119150], 512],
+ 119230: [[119228, 119150], 512],
+ 119231: [[119227, 119151], 512],
+ 119232: [[119228, 119151], 512]
+ },
+ 53760: { 119362: [, 230], 119363: [, 230], 119364: [, 230] },
+ 54272: {
+ 119808: [[65], 256],
+ 119809: [[66], 256],
+ 119810: [[67], 256],
+ 119811: [[68], 256],
+ 119812: [[69], 256],
+ 119813: [[70], 256],
+ 119814: [[71], 256],
+ 119815: [[72], 256],
+ 119816: [[73], 256],
+ 119817: [[74], 256],
+ 119818: [[75], 256],
+ 119819: [[76], 256],
+ 119820: [[77], 256],
+ 119821: [[78], 256],
+ 119822: [[79], 256],
+ 119823: [[80], 256],
+ 119824: [[81], 256],
+ 119825: [[82], 256],
+ 119826: [[83], 256],
+ 119827: [[84], 256],
+ 119828: [[85], 256],
+ 119829: [[86], 256],
+ 119830: [[87], 256],
+ 119831: [[88], 256],
+ 119832: [[89], 256],
+ 119833: [[90], 256],
+ 119834: [[97], 256],
+ 119835: [[98], 256],
+ 119836: [[99], 256],
+ 119837: [[100], 256],
+ 119838: [[101], 256],
+ 119839: [[102], 256],
+ 119840: [[103], 256],
+ 119841: [[104], 256],
+ 119842: [[105], 256],
+ 119843: [[106], 256],
+ 119844: [[107], 256],
+ 119845: [[108], 256],
+ 119846: [[109], 256],
+ 119847: [[110], 256],
+ 119848: [[111], 256],
+ 119849: [[112], 256],
+ 119850: [[113], 256],
+ 119851: [[114], 256],
+ 119852: [[115], 256],
+ 119853: [[116], 256],
+ 119854: [[117], 256],
+ 119855: [[118], 256],
+ 119856: [[119], 256],
+ 119857: [[120], 256],
+ 119858: [[121], 256],
+ 119859: [[122], 256],
+ 119860: [[65], 256],
+ 119861: [[66], 256],
+ 119862: [[67], 256],
+ 119863: [[68], 256],
+ 119864: [[69], 256],
+ 119865: [[70], 256],
+ 119866: [[71], 256],
+ 119867: [[72], 256],
+ 119868: [[73], 256],
+ 119869: [[74], 256],
+ 119870: [[75], 256],
+ 119871: [[76], 256],
+ 119872: [[77], 256],
+ 119873: [[78], 256],
+ 119874: [[79], 256],
+ 119875: [[80], 256],
+ 119876: [[81], 256],
+ 119877: [[82], 256],
+ 119878: [[83], 256],
+ 119879: [[84], 256],
+ 119880: [[85], 256],
+ 119881: [[86], 256],
+ 119882: [[87], 256],
+ 119883: [[88], 256],
+ 119884: [[89], 256],
+ 119885: [[90], 256],
+ 119886: [[97], 256],
+ 119887: [[98], 256],
+ 119888: [[99], 256],
+ 119889: [[100], 256],
+ 119890: [[101], 256],
+ 119891: [[102], 256],
+ 119892: [[103], 256],
+ 119894: [[105], 256],
+ 119895: [[106], 256],
+ 119896: [[107], 256],
+ 119897: [[108], 256],
+ 119898: [[109], 256],
+ 119899: [[110], 256],
+ 119900: [[111], 256],
+ 119901: [[112], 256],
+ 119902: [[113], 256],
+ 119903: [[114], 256],
+ 119904: [[115], 256],
+ 119905: [[116], 256],
+ 119906: [[117], 256],
+ 119907: [[118], 256],
+ 119908: [[119], 256],
+ 119909: [[120], 256],
+ 119910: [[121], 256],
+ 119911: [[122], 256],
+ 119912: [[65], 256],
+ 119913: [[66], 256],
+ 119914: [[67], 256],
+ 119915: [[68], 256],
+ 119916: [[69], 256],
+ 119917: [[70], 256],
+ 119918: [[71], 256],
+ 119919: [[72], 256],
+ 119920: [[73], 256],
+ 119921: [[74], 256],
+ 119922: [[75], 256],
+ 119923: [[76], 256],
+ 119924: [[77], 256],
+ 119925: [[78], 256],
+ 119926: [[79], 256],
+ 119927: [[80], 256],
+ 119928: [[81], 256],
+ 119929: [[82], 256],
+ 119930: [[83], 256],
+ 119931: [[84], 256],
+ 119932: [[85], 256],
+ 119933: [[86], 256],
+ 119934: [[87], 256],
+ 119935: [[88], 256],
+ 119936: [[89], 256],
+ 119937: [[90], 256],
+ 119938: [[97], 256],
+ 119939: [[98], 256],
+ 119940: [[99], 256],
+ 119941: [[100], 256],
+ 119942: [[101], 256],
+ 119943: [[102], 256],
+ 119944: [[103], 256],
+ 119945: [[104], 256],
+ 119946: [[105], 256],
+ 119947: [[106], 256],
+ 119948: [[107], 256],
+ 119949: [[108], 256],
+ 119950: [[109], 256],
+ 119951: [[110], 256],
+ 119952: [[111], 256],
+ 119953: [[112], 256],
+ 119954: [[113], 256],
+ 119955: [[114], 256],
+ 119956: [[115], 256],
+ 119957: [[116], 256],
+ 119958: [[117], 256],
+ 119959: [[118], 256],
+ 119960: [[119], 256],
+ 119961: [[120], 256],
+ 119962: [[121], 256],
+ 119963: [[122], 256],
+ 119964: [[65], 256],
+ 119966: [[67], 256],
+ 119967: [[68], 256],
+ 119970: [[71], 256],
+ 119973: [[74], 256],
+ 119974: [[75], 256],
+ 119977: [[78], 256],
+ 119978: [[79], 256],
+ 119979: [[80], 256],
+ 119980: [[81], 256],
+ 119982: [[83], 256],
+ 119983: [[84], 256],
+ 119984: [[85], 256],
+ 119985: [[86], 256],
+ 119986: [[87], 256],
+ 119987: [[88], 256],
+ 119988: [[89], 256],
+ 119989: [[90], 256],
+ 119990: [[97], 256],
+ 119991: [[98], 256],
+ 119992: [[99], 256],
+ 119993: [[100], 256],
+ 119995: [[102], 256],
+ 119997: [[104], 256],
+ 119998: [[105], 256],
+ 119999: [[106], 256],
+ 120000: [[107], 256],
+ 120001: [[108], 256],
+ 120002: [[109], 256],
+ 120003: [[110], 256],
+ 120005: [[112], 256],
+ 120006: [[113], 256],
+ 120007: [[114], 256],
+ 120008: [[115], 256],
+ 120009: [[116], 256],
+ 120010: [[117], 256],
+ 120011: [[118], 256],
+ 120012: [[119], 256],
+ 120013: [[120], 256],
+ 120014: [[121], 256],
+ 120015: [[122], 256],
+ 120016: [[65], 256],
+ 120017: [[66], 256],
+ 120018: [[67], 256],
+ 120019: [[68], 256],
+ 120020: [[69], 256],
+ 120021: [[70], 256],
+ 120022: [[71], 256],
+ 120023: [[72], 256],
+ 120024: [[73], 256],
+ 120025: [[74], 256],
+ 120026: [[75], 256],
+ 120027: [[76], 256],
+ 120028: [[77], 256],
+ 120029: [[78], 256],
+ 120030: [[79], 256],
+ 120031: [[80], 256],
+ 120032: [[81], 256],
+ 120033: [[82], 256],
+ 120034: [[83], 256],
+ 120035: [[84], 256],
+ 120036: [[85], 256],
+ 120037: [[86], 256],
+ 120038: [[87], 256],
+ 120039: [[88], 256],
+ 120040: [[89], 256],
+ 120041: [[90], 256],
+ 120042: [[97], 256],
+ 120043: [[98], 256],
+ 120044: [[99], 256],
+ 120045: [[100], 256],
+ 120046: [[101], 256],
+ 120047: [[102], 256],
+ 120048: [[103], 256],
+ 120049: [[104], 256],
+ 120050: [[105], 256],
+ 120051: [[106], 256],
+ 120052: [[107], 256],
+ 120053: [[108], 256],
+ 120054: [[109], 256],
+ 120055: [[110], 256],
+ 120056: [[111], 256],
+ 120057: [[112], 256],
+ 120058: [[113], 256],
+ 120059: [[114], 256],
+ 120060: [[115], 256],
+ 120061: [[116], 256],
+ 120062: [[117], 256],
+ 120063: [[118], 256]
+ },
+ 54528: {
+ 120064: [[119], 256],
+ 120065: [[120], 256],
+ 120066: [[121], 256],
+ 120067: [[122], 256],
+ 120068: [[65], 256],
+ 120069: [[66], 256],
+ 120071: [[68], 256],
+ 120072: [[69], 256],
+ 120073: [[70], 256],
+ 120074: [[71], 256],
+ 120077: [[74], 256],
+ 120078: [[75], 256],
+ 120079: [[76], 256],
+ 120080: [[77], 256],
+ 120081: [[78], 256],
+ 120082: [[79], 256],
+ 120083: [[80], 256],
+ 120084: [[81], 256],
+ 120086: [[83], 256],
+ 120087: [[84], 256],
+ 120088: [[85], 256],
+ 120089: [[86], 256],
+ 120090: [[87], 256],
+ 120091: [[88], 256],
+ 120092: [[89], 256],
+ 120094: [[97], 256],
+ 120095: [[98], 256],
+ 120096: [[99], 256],
+ 120097: [[100], 256],
+ 120098: [[101], 256],
+ 120099: [[102], 256],
+ 120100: [[103], 256],
+ 120101: [[104], 256],
+ 120102: [[105], 256],
+ 120103: [[106], 256],
+ 120104: [[107], 256],
+ 120105: [[108], 256],
+ 120106: [[109], 256],
+ 120107: [[110], 256],
+ 120108: [[111], 256],
+ 120109: [[112], 256],
+ 120110: [[113], 256],
+ 120111: [[114], 256],
+ 120112: [[115], 256],
+ 120113: [[116], 256],
+ 120114: [[117], 256],
+ 120115: [[118], 256],
+ 120116: [[119], 256],
+ 120117: [[120], 256],
+ 120118: [[121], 256],
+ 120119: [[122], 256],
+ 120120: [[65], 256],
+ 120121: [[66], 256],
+ 120123: [[68], 256],
+ 120124: [[69], 256],
+ 120125: [[70], 256],
+ 120126: [[71], 256],
+ 120128: [[73], 256],
+ 120129: [[74], 256],
+ 120130: [[75], 256],
+ 120131: [[76], 256],
+ 120132: [[77], 256],
+ 120134: [[79], 256],
+ 120138: [[83], 256],
+ 120139: [[84], 256],
+ 120140: [[85], 256],
+ 120141: [[86], 256],
+ 120142: [[87], 256],
+ 120143: [[88], 256],
+ 120144: [[89], 256],
+ 120146: [[97], 256],
+ 120147: [[98], 256],
+ 120148: [[99], 256],
+ 120149: [[100], 256],
+ 120150: [[101], 256],
+ 120151: [[102], 256],
+ 120152: [[103], 256],
+ 120153: [[104], 256],
+ 120154: [[105], 256],
+ 120155: [[106], 256],
+ 120156: [[107], 256],
+ 120157: [[108], 256],
+ 120158: [[109], 256],
+ 120159: [[110], 256],
+ 120160: [[111], 256],
+ 120161: [[112], 256],
+ 120162: [[113], 256],
+ 120163: [[114], 256],
+ 120164: [[115], 256],
+ 120165: [[116], 256],
+ 120166: [[117], 256],
+ 120167: [[118], 256],
+ 120168: [[119], 256],
+ 120169: [[120], 256],
+ 120170: [[121], 256],
+ 120171: [[122], 256],
+ 120172: [[65], 256],
+ 120173: [[66], 256],
+ 120174: [[67], 256],
+ 120175: [[68], 256],
+ 120176: [[69], 256],
+ 120177: [[70], 256],
+ 120178: [[71], 256],
+ 120179: [[72], 256],
+ 120180: [[73], 256],
+ 120181: [[74], 256],
+ 120182: [[75], 256],
+ 120183: [[76], 256],
+ 120184: [[77], 256],
+ 120185: [[78], 256],
+ 120186: [[79], 256],
+ 120187: [[80], 256],
+ 120188: [[81], 256],
+ 120189: [[82], 256],
+ 120190: [[83], 256],
+ 120191: [[84], 256],
+ 120192: [[85], 256],
+ 120193: [[86], 256],
+ 120194: [[87], 256],
+ 120195: [[88], 256],
+ 120196: [[89], 256],
+ 120197: [[90], 256],
+ 120198: [[97], 256],
+ 120199: [[98], 256],
+ 120200: [[99], 256],
+ 120201: [[100], 256],
+ 120202: [[101], 256],
+ 120203: [[102], 256],
+ 120204: [[103], 256],
+ 120205: [[104], 256],
+ 120206: [[105], 256],
+ 120207: [[106], 256],
+ 120208: [[107], 256],
+ 120209: [[108], 256],
+ 120210: [[109], 256],
+ 120211: [[110], 256],
+ 120212: [[111], 256],
+ 120213: [[112], 256],
+ 120214: [[113], 256],
+ 120215: [[114], 256],
+ 120216: [[115], 256],
+ 120217: [[116], 256],
+ 120218: [[117], 256],
+ 120219: [[118], 256],
+ 120220: [[119], 256],
+ 120221: [[120], 256],
+ 120222: [[121], 256],
+ 120223: [[122], 256],
+ 120224: [[65], 256],
+ 120225: [[66], 256],
+ 120226: [[67], 256],
+ 120227: [[68], 256],
+ 120228: [[69], 256],
+ 120229: [[70], 256],
+ 120230: [[71], 256],
+ 120231: [[72], 256],
+ 120232: [[73], 256],
+ 120233: [[74], 256],
+ 120234: [[75], 256],
+ 120235: [[76], 256],
+ 120236: [[77], 256],
+ 120237: [[78], 256],
+ 120238: [[79], 256],
+ 120239: [[80], 256],
+ 120240: [[81], 256],
+ 120241: [[82], 256],
+ 120242: [[83], 256],
+ 120243: [[84], 256],
+ 120244: [[85], 256],
+ 120245: [[86], 256],
+ 120246: [[87], 256],
+ 120247: [[88], 256],
+ 120248: [[89], 256],
+ 120249: [[90], 256],
+ 120250: [[97], 256],
+ 120251: [[98], 256],
+ 120252: [[99], 256],
+ 120253: [[100], 256],
+ 120254: [[101], 256],
+ 120255: [[102], 256],
+ 120256: [[103], 256],
+ 120257: [[104], 256],
+ 120258: [[105], 256],
+ 120259: [[106], 256],
+ 120260: [[107], 256],
+ 120261: [[108], 256],
+ 120262: [[109], 256],
+ 120263: [[110], 256],
+ 120264: [[111], 256],
+ 120265: [[112], 256],
+ 120266: [[113], 256],
+ 120267: [[114], 256],
+ 120268: [[115], 256],
+ 120269: [[116], 256],
+ 120270: [[117], 256],
+ 120271: [[118], 256],
+ 120272: [[119], 256],
+ 120273: [[120], 256],
+ 120274: [[121], 256],
+ 120275: [[122], 256],
+ 120276: [[65], 256],
+ 120277: [[66], 256],
+ 120278: [[67], 256],
+ 120279: [[68], 256],
+ 120280: [[69], 256],
+ 120281: [[70], 256],
+ 120282: [[71], 256],
+ 120283: [[72], 256],
+ 120284: [[73], 256],
+ 120285: [[74], 256],
+ 120286: [[75], 256],
+ 120287: [[76], 256],
+ 120288: [[77], 256],
+ 120289: [[78], 256],
+ 120290: [[79], 256],
+ 120291: [[80], 256],
+ 120292: [[81], 256],
+ 120293: [[82], 256],
+ 120294: [[83], 256],
+ 120295: [[84], 256],
+ 120296: [[85], 256],
+ 120297: [[86], 256],
+ 120298: [[87], 256],
+ 120299: [[88], 256],
+ 120300: [[89], 256],
+ 120301: [[90], 256],
+ 120302: [[97], 256],
+ 120303: [[98], 256],
+ 120304: [[99], 256],
+ 120305: [[100], 256],
+ 120306: [[101], 256],
+ 120307: [[102], 256],
+ 120308: [[103], 256],
+ 120309: [[104], 256],
+ 120310: [[105], 256],
+ 120311: [[106], 256],
+ 120312: [[107], 256],
+ 120313: [[108], 256],
+ 120314: [[109], 256],
+ 120315: [[110], 256],
+ 120316: [[111], 256],
+ 120317: [[112], 256],
+ 120318: [[113], 256],
+ 120319: [[114], 256]
+ },
+ 54784: {
+ 120320: [[115], 256],
+ 120321: [[116], 256],
+ 120322: [[117], 256],
+ 120323: [[118], 256],
+ 120324: [[119], 256],
+ 120325: [[120], 256],
+ 120326: [[121], 256],
+ 120327: [[122], 256],
+ 120328: [[65], 256],
+ 120329: [[66], 256],
+ 120330: [[67], 256],
+ 120331: [[68], 256],
+ 120332: [[69], 256],
+ 120333: [[70], 256],
+ 120334: [[71], 256],
+ 120335: [[72], 256],
+ 120336: [[73], 256],
+ 120337: [[74], 256],
+ 120338: [[75], 256],
+ 120339: [[76], 256],
+ 120340: [[77], 256],
+ 120341: [[78], 256],
+ 120342: [[79], 256],
+ 120343: [[80], 256],
+ 120344: [[81], 256],
+ 120345: [[82], 256],
+ 120346: [[83], 256],
+ 120347: [[84], 256],
+ 120348: [[85], 256],
+ 120349: [[86], 256],
+ 120350: [[87], 256],
+ 120351: [[88], 256],
+ 120352: [[89], 256],
+ 120353: [[90], 256],
+ 120354: [[97], 256],
+ 120355: [[98], 256],
+ 120356: [[99], 256],
+ 120357: [[100], 256],
+ 120358: [[101], 256],
+ 120359: [[102], 256],
+ 120360: [[103], 256],
+ 120361: [[104], 256],
+ 120362: [[105], 256],
+ 120363: [[106], 256],
+ 120364: [[107], 256],
+ 120365: [[108], 256],
+ 120366: [[109], 256],
+ 120367: [[110], 256],
+ 120368: [[111], 256],
+ 120369: [[112], 256],
+ 120370: [[113], 256],
+ 120371: [[114], 256],
+ 120372: [[115], 256],
+ 120373: [[116], 256],
+ 120374: [[117], 256],
+ 120375: [[118], 256],
+ 120376: [[119], 256],
+ 120377: [[120], 256],
+ 120378: [[121], 256],
+ 120379: [[122], 256],
+ 120380: [[65], 256],
+ 120381: [[66], 256],
+ 120382: [[67], 256],
+ 120383: [[68], 256],
+ 120384: [[69], 256],
+ 120385: [[70], 256],
+ 120386: [[71], 256],
+ 120387: [[72], 256],
+ 120388: [[73], 256],
+ 120389: [[74], 256],
+ 120390: [[75], 256],
+ 120391: [[76], 256],
+ 120392: [[77], 256],
+ 120393: [[78], 256],
+ 120394: [[79], 256],
+ 120395: [[80], 256],
+ 120396: [[81], 256],
+ 120397: [[82], 256],
+ 120398: [[83], 256],
+ 120399: [[84], 256],
+ 120400: [[85], 256],
+ 120401: [[86], 256],
+ 120402: [[87], 256],
+ 120403: [[88], 256],
+ 120404: [[89], 256],
+ 120405: [[90], 256],
+ 120406: [[97], 256],
+ 120407: [[98], 256],
+ 120408: [[99], 256],
+ 120409: [[100], 256],
+ 120410: [[101], 256],
+ 120411: [[102], 256],
+ 120412: [[103], 256],
+ 120413: [[104], 256],
+ 120414: [[105], 256],
+ 120415: [[106], 256],
+ 120416: [[107], 256],
+ 120417: [[108], 256],
+ 120418: [[109], 256],
+ 120419: [[110], 256],
+ 120420: [[111], 256],
+ 120421: [[112], 256],
+ 120422: [[113], 256],
+ 120423: [[114], 256],
+ 120424: [[115], 256],
+ 120425: [[116], 256],
+ 120426: [[117], 256],
+ 120427: [[118], 256],
+ 120428: [[119], 256],
+ 120429: [[120], 256],
+ 120430: [[121], 256],
+ 120431: [[122], 256],
+ 120432: [[65], 256],
+ 120433: [[66], 256],
+ 120434: [[67], 256],
+ 120435: [[68], 256],
+ 120436: [[69], 256],
+ 120437: [[70], 256],
+ 120438: [[71], 256],
+ 120439: [[72], 256],
+ 120440: [[73], 256],
+ 120441: [[74], 256],
+ 120442: [[75], 256],
+ 120443: [[76], 256],
+ 120444: [[77], 256],
+ 120445: [[78], 256],
+ 120446: [[79], 256],
+ 120447: [[80], 256],
+ 120448: [[81], 256],
+ 120449: [[82], 256],
+ 120450: [[83], 256],
+ 120451: [[84], 256],
+ 120452: [[85], 256],
+ 120453: [[86], 256],
+ 120454: [[87], 256],
+ 120455: [[88], 256],
+ 120456: [[89], 256],
+ 120457: [[90], 256],
+ 120458: [[97], 256],
+ 120459: [[98], 256],
+ 120460: [[99], 256],
+ 120461: [[100], 256],
+ 120462: [[101], 256],
+ 120463: [[102], 256],
+ 120464: [[103], 256],
+ 120465: [[104], 256],
+ 120466: [[105], 256],
+ 120467: [[106], 256],
+ 120468: [[107], 256],
+ 120469: [[108], 256],
+ 120470: [[109], 256],
+ 120471: [[110], 256],
+ 120472: [[111], 256],
+ 120473: [[112], 256],
+ 120474: [[113], 256],
+ 120475: [[114], 256],
+ 120476: [[115], 256],
+ 120477: [[116], 256],
+ 120478: [[117], 256],
+ 120479: [[118], 256],
+ 120480: [[119], 256],
+ 120481: [[120], 256],
+ 120482: [[121], 256],
+ 120483: [[122], 256],
+ 120484: [[305], 256],
+ 120485: [[567], 256],
+ 120488: [[913], 256],
+ 120489: [[914], 256],
+ 120490: [[915], 256],
+ 120491: [[916], 256],
+ 120492: [[917], 256],
+ 120493: [[918], 256],
+ 120494: [[919], 256],
+ 120495: [[920], 256],
+ 120496: [[921], 256],
+ 120497: [[922], 256],
+ 120498: [[923], 256],
+ 120499: [[924], 256],
+ 120500: [[925], 256],
+ 120501: [[926], 256],
+ 120502: [[927], 256],
+ 120503: [[928], 256],
+ 120504: [[929], 256],
+ 120505: [[1012], 256],
+ 120506: [[931], 256],
+ 120507: [[932], 256],
+ 120508: [[933], 256],
+ 120509: [[934], 256],
+ 120510: [[935], 256],
+ 120511: [[936], 256],
+ 120512: [[937], 256],
+ 120513: [[8711], 256],
+ 120514: [[945], 256],
+ 120515: [[946], 256],
+ 120516: [[947], 256],
+ 120517: [[948], 256],
+ 120518: [[949], 256],
+ 120519: [[950], 256],
+ 120520: [[951], 256],
+ 120521: [[952], 256],
+ 120522: [[953], 256],
+ 120523: [[954], 256],
+ 120524: [[955], 256],
+ 120525: [[956], 256],
+ 120526: [[957], 256],
+ 120527: [[958], 256],
+ 120528: [[959], 256],
+ 120529: [[960], 256],
+ 120530: [[961], 256],
+ 120531: [[962], 256],
+ 120532: [[963], 256],
+ 120533: [[964], 256],
+ 120534: [[965], 256],
+ 120535: [[966], 256],
+ 120536: [[967], 256],
+ 120537: [[968], 256],
+ 120538: [[969], 256],
+ 120539: [[8706], 256],
+ 120540: [[1013], 256],
+ 120541: [[977], 256],
+ 120542: [[1008], 256],
+ 120543: [[981], 256],
+ 120544: [[1009], 256],
+ 120545: [[982], 256],
+ 120546: [[913], 256],
+ 120547: [[914], 256],
+ 120548: [[915], 256],
+ 120549: [[916], 256],
+ 120550: [[917], 256],
+ 120551: [[918], 256],
+ 120552: [[919], 256],
+ 120553: [[920], 256],
+ 120554: [[921], 256],
+ 120555: [[922], 256],
+ 120556: [[923], 256],
+ 120557: [[924], 256],
+ 120558: [[925], 256],
+ 120559: [[926], 256],
+ 120560: [[927], 256],
+ 120561: [[928], 256],
+ 120562: [[929], 256],
+ 120563: [[1012], 256],
+ 120564: [[931], 256],
+ 120565: [[932], 256],
+ 120566: [[933], 256],
+ 120567: [[934], 256],
+ 120568: [[935], 256],
+ 120569: [[936], 256],
+ 120570: [[937], 256],
+ 120571: [[8711], 256],
+ 120572: [[945], 256],
+ 120573: [[946], 256],
+ 120574: [[947], 256],
+ 120575: [[948], 256]
+ },
+ 55040: {
+ 120576: [[949], 256],
+ 120577: [[950], 256],
+ 120578: [[951], 256],
+ 120579: [[952], 256],
+ 120580: [[953], 256],
+ 120581: [[954], 256],
+ 120582: [[955], 256],
+ 120583: [[956], 256],
+ 120584: [[957], 256],
+ 120585: [[958], 256],
+ 120586: [[959], 256],
+ 120587: [[960], 256],
+ 120588: [[961], 256],
+ 120589: [[962], 256],
+ 120590: [[963], 256],
+ 120591: [[964], 256],
+ 120592: [[965], 256],
+ 120593: [[966], 256],
+ 120594: [[967], 256],
+ 120595: [[968], 256],
+ 120596: [[969], 256],
+ 120597: [[8706], 256],
+ 120598: [[1013], 256],
+ 120599: [[977], 256],
+ 120600: [[1008], 256],
+ 120601: [[981], 256],
+ 120602: [[1009], 256],
+ 120603: [[982], 256],
+ 120604: [[913], 256],
+ 120605: [[914], 256],
+ 120606: [[915], 256],
+ 120607: [[916], 256],
+ 120608: [[917], 256],
+ 120609: [[918], 256],
+ 120610: [[919], 256],
+ 120611: [[920], 256],
+ 120612: [[921], 256],
+ 120613: [[922], 256],
+ 120614: [[923], 256],
+ 120615: [[924], 256],
+ 120616: [[925], 256],
+ 120617: [[926], 256],
+ 120618: [[927], 256],
+ 120619: [[928], 256],
+ 120620: [[929], 256],
+ 120621: [[1012], 256],
+ 120622: [[931], 256],
+ 120623: [[932], 256],
+ 120624: [[933], 256],
+ 120625: [[934], 256],
+ 120626: [[935], 256],
+ 120627: [[936], 256],
+ 120628: [[937], 256],
+ 120629: [[8711], 256],
+ 120630: [[945], 256],
+ 120631: [[946], 256],
+ 120632: [[947], 256],
+ 120633: [[948], 256],
+ 120634: [[949], 256],
+ 120635: [[950], 256],
+ 120636: [[951], 256],
+ 120637: [[952], 256],
+ 120638: [[953], 256],
+ 120639: [[954], 256],
+ 120640: [[955], 256],
+ 120641: [[956], 256],
+ 120642: [[957], 256],
+ 120643: [[958], 256],
+ 120644: [[959], 256],
+ 120645: [[960], 256],
+ 120646: [[961], 256],
+ 120647: [[962], 256],
+ 120648: [[963], 256],
+ 120649: [[964], 256],
+ 120650: [[965], 256],
+ 120651: [[966], 256],
+ 120652: [[967], 256],
+ 120653: [[968], 256],
+ 120654: [[969], 256],
+ 120655: [[8706], 256],
+ 120656: [[1013], 256],
+ 120657: [[977], 256],
+ 120658: [[1008], 256],
+ 120659: [[981], 256],
+ 120660: [[1009], 256],
+ 120661: [[982], 256],
+ 120662: [[913], 256],
+ 120663: [[914], 256],
+ 120664: [[915], 256],
+ 120665: [[916], 256],
+ 120666: [[917], 256],
+ 120667: [[918], 256],
+ 120668: [[919], 256],
+ 120669: [[920], 256],
+ 120670: [[921], 256],
+ 120671: [[922], 256],
+ 120672: [[923], 256],
+ 120673: [[924], 256],
+ 120674: [[925], 256],
+ 120675: [[926], 256],
+ 120676: [[927], 256],
+ 120677: [[928], 256],
+ 120678: [[929], 256],
+ 120679: [[1012], 256],
+ 120680: [[931], 256],
+ 120681: [[932], 256],
+ 120682: [[933], 256],
+ 120683: [[934], 256],
+ 120684: [[935], 256],
+ 120685: [[936], 256],
+ 120686: [[937], 256],
+ 120687: [[8711], 256],
+ 120688: [[945], 256],
+ 120689: [[946], 256],
+ 120690: [[947], 256],
+ 120691: [[948], 256],
+ 120692: [[949], 256],
+ 120693: [[950], 256],
+ 120694: [[951], 256],
+ 120695: [[952], 256],
+ 120696: [[953], 256],
+ 120697: [[954], 256],
+ 120698: [[955], 256],
+ 120699: [[956], 256],
+ 120700: [[957], 256],
+ 120701: [[958], 256],
+ 120702: [[959], 256],
+ 120703: [[960], 256],
+ 120704: [[961], 256],
+ 120705: [[962], 256],
+ 120706: [[963], 256],
+ 120707: [[964], 256],
+ 120708: [[965], 256],
+ 120709: [[966], 256],
+ 120710: [[967], 256],
+ 120711: [[968], 256],
+ 120712: [[969], 256],
+ 120713: [[8706], 256],
+ 120714: [[1013], 256],
+ 120715: [[977], 256],
+ 120716: [[1008], 256],
+ 120717: [[981], 256],
+ 120718: [[1009], 256],
+ 120719: [[982], 256],
+ 120720: [[913], 256],
+ 120721: [[914], 256],
+ 120722: [[915], 256],
+ 120723: [[916], 256],
+ 120724: [[917], 256],
+ 120725: [[918], 256],
+ 120726: [[919], 256],
+ 120727: [[920], 256],
+ 120728: [[921], 256],
+ 120729: [[922], 256],
+ 120730: [[923], 256],
+ 120731: [[924], 256],
+ 120732: [[925], 256],
+ 120733: [[926], 256],
+ 120734: [[927], 256],
+ 120735: [[928], 256],
+ 120736: [[929], 256],
+ 120737: [[1012], 256],
+ 120738: [[931], 256],
+ 120739: [[932], 256],
+ 120740: [[933], 256],
+ 120741: [[934], 256],
+ 120742: [[935], 256],
+ 120743: [[936], 256],
+ 120744: [[937], 256],
+ 120745: [[8711], 256],
+ 120746: [[945], 256],
+ 120747: [[946], 256],
+ 120748: [[947], 256],
+ 120749: [[948], 256],
+ 120750: [[949], 256],
+ 120751: [[950], 256],
+ 120752: [[951], 256],
+ 120753: [[952], 256],
+ 120754: [[953], 256],
+ 120755: [[954], 256],
+ 120756: [[955], 256],
+ 120757: [[956], 256],
+ 120758: [[957], 256],
+ 120759: [[958], 256],
+ 120760: [[959], 256],
+ 120761: [[960], 256],
+ 120762: [[961], 256],
+ 120763: [[962], 256],
+ 120764: [[963], 256],
+ 120765: [[964], 256],
+ 120766: [[965], 256],
+ 120767: [[966], 256],
+ 120768: [[967], 256],
+ 120769: [[968], 256],
+ 120770: [[969], 256],
+ 120771: [[8706], 256],
+ 120772: [[1013], 256],
+ 120773: [[977], 256],
+ 120774: [[1008], 256],
+ 120775: [[981], 256],
+ 120776: [[1009], 256],
+ 120777: [[982], 256],
+ 120778: [[988], 256],
+ 120779: [[989], 256],
+ 120782: [[48], 256],
+ 120783: [[49], 256],
+ 120784: [[50], 256],
+ 120785: [[51], 256],
+ 120786: [[52], 256],
+ 120787: [[53], 256],
+ 120788: [[54], 256],
+ 120789: [[55], 256],
+ 120790: [[56], 256],
+ 120791: [[57], 256],
+ 120792: [[48], 256],
+ 120793: [[49], 256],
+ 120794: [[50], 256],
+ 120795: [[51], 256],
+ 120796: [[52], 256],
+ 120797: [[53], 256],
+ 120798: [[54], 256],
+ 120799: [[55], 256],
+ 120800: [[56], 256],
+ 120801: [[57], 256],
+ 120802: [[48], 256],
+ 120803: [[49], 256],
+ 120804: [[50], 256],
+ 120805: [[51], 256],
+ 120806: [[52], 256],
+ 120807: [[53], 256],
+ 120808: [[54], 256],
+ 120809: [[55], 256],
+ 120810: [[56], 256],
+ 120811: [[57], 256],
+ 120812: [[48], 256],
+ 120813: [[49], 256],
+ 120814: [[50], 256],
+ 120815: [[51], 256],
+ 120816: [[52], 256],
+ 120817: [[53], 256],
+ 120818: [[54], 256],
+ 120819: [[55], 256],
+ 120820: [[56], 256],
+ 120821: [[57], 256],
+ 120822: [[48], 256],
+ 120823: [[49], 256],
+ 120824: [[50], 256],
+ 120825: [[51], 256],
+ 120826: [[52], 256],
+ 120827: [[53], 256],
+ 120828: [[54], 256],
+ 120829: [[55], 256],
+ 120830: [[56], 256],
+ 120831: [[57], 256]
+ },
+ 60928: {
+ 126464: [[1575], 256],
+ 126465: [[1576], 256],
+ 126466: [[1580], 256],
+ 126467: [[1583], 256],
+ 126469: [[1608], 256],
+ 126470: [[1586], 256],
+ 126471: [[1581], 256],
+ 126472: [[1591], 256],
+ 126473: [[1610], 256],
+ 126474: [[1603], 256],
+ 126475: [[1604], 256],
+ 126476: [[1605], 256],
+ 126477: [[1606], 256],
+ 126478: [[1587], 256],
+ 126479: [[1593], 256],
+ 126480: [[1601], 256],
+ 126481: [[1589], 256],
+ 126482: [[1602], 256],
+ 126483: [[1585], 256],
+ 126484: [[1588], 256],
+ 126485: [[1578], 256],
+ 126486: [[1579], 256],
+ 126487: [[1582], 256],
+ 126488: [[1584], 256],
+ 126489: [[1590], 256],
+ 126490: [[1592], 256],
+ 126491: [[1594], 256],
+ 126492: [[1646], 256],
+ 126493: [[1722], 256],
+ 126494: [[1697], 256],
+ 126495: [[1647], 256],
+ 126497: [[1576], 256],
+ 126498: [[1580], 256],
+ 126500: [[1607], 256],
+ 126503: [[1581], 256],
+ 126505: [[1610], 256],
+ 126506: [[1603], 256],
+ 126507: [[1604], 256],
+ 126508: [[1605], 256],
+ 126509: [[1606], 256],
+ 126510: [[1587], 256],
+ 126511: [[1593], 256],
+ 126512: [[1601], 256],
+ 126513: [[1589], 256],
+ 126514: [[1602], 256],
+ 126516: [[1588], 256],
+ 126517: [[1578], 256],
+ 126518: [[1579], 256],
+ 126519: [[1582], 256],
+ 126521: [[1590], 256],
+ 126523: [[1594], 256],
+ 126530: [[1580], 256],
+ 126535: [[1581], 256],
+ 126537: [[1610], 256],
+ 126539: [[1604], 256],
+ 126541: [[1606], 256],
+ 126542: [[1587], 256],
+ 126543: [[1593], 256],
+ 126545: [[1589], 256],
+ 126546: [[1602], 256],
+ 126548: [[1588], 256],
+ 126551: [[1582], 256],
+ 126553: [[1590], 256],
+ 126555: [[1594], 256],
+ 126557: [[1722], 256],
+ 126559: [[1647], 256],
+ 126561: [[1576], 256],
+ 126562: [[1580], 256],
+ 126564: [[1607], 256],
+ 126567: [[1581], 256],
+ 126568: [[1591], 256],
+ 126569: [[1610], 256],
+ 126570: [[1603], 256],
+ 126572: [[1605], 256],
+ 126573: [[1606], 256],
+ 126574: [[1587], 256],
+ 126575: [[1593], 256],
+ 126576: [[1601], 256],
+ 126577: [[1589], 256],
+ 126578: [[1602], 256],
+ 126580: [[1588], 256],
+ 126581: [[1578], 256],
+ 126582: [[1579], 256],
+ 126583: [[1582], 256],
+ 126585: [[1590], 256],
+ 126586: [[1592], 256],
+ 126587: [[1594], 256],
+ 126588: [[1646], 256],
+ 126590: [[1697], 256],
+ 126592: [[1575], 256],
+ 126593: [[1576], 256],
+ 126594: [[1580], 256],
+ 126595: [[1583], 256],
+ 126596: [[1607], 256],
+ 126597: [[1608], 256],
+ 126598: [[1586], 256],
+ 126599: [[1581], 256],
+ 126600: [[1591], 256],
+ 126601: [[1610], 256],
+ 126603: [[1604], 256],
+ 126604: [[1605], 256],
+ 126605: [[1606], 256],
+ 126606: [[1587], 256],
+ 126607: [[1593], 256],
+ 126608: [[1601], 256],
+ 126609: [[1589], 256],
+ 126610: [[1602], 256],
+ 126611: [[1585], 256],
+ 126612: [[1588], 256],
+ 126613: [[1578], 256],
+ 126614: [[1579], 256],
+ 126615: [[1582], 256],
+ 126616: [[1584], 256],
+ 126617: [[1590], 256],
+ 126618: [[1592], 256],
+ 126619: [[1594], 256],
+ 126625: [[1576], 256],
+ 126626: [[1580], 256],
+ 126627: [[1583], 256],
+ 126629: [[1608], 256],
+ 126630: [[1586], 256],
+ 126631: [[1581], 256],
+ 126632: [[1591], 256],
+ 126633: [[1610], 256],
+ 126635: [[1604], 256],
+ 126636: [[1605], 256],
+ 126637: [[1606], 256],
+ 126638: [[1587], 256],
+ 126639: [[1593], 256],
+ 126640: [[1601], 256],
+ 126641: [[1589], 256],
+ 126642: [[1602], 256],
+ 126643: [[1585], 256],
+ 126644: [[1588], 256],
+ 126645: [[1578], 256],
+ 126646: [[1579], 256],
+ 126647: [[1582], 256],
+ 126648: [[1584], 256],
+ 126649: [[1590], 256],
+ 126650: [[1592], 256],
+ 126651: [[1594], 256]
+ },
+ 61696: {
+ 127232: [[48, 46], 256],
+ 127233: [[48, 44], 256],
+ 127234: [[49, 44], 256],
+ 127235: [[50, 44], 256],
+ 127236: [[51, 44], 256],
+ 127237: [[52, 44], 256],
+ 127238: [[53, 44], 256],
+ 127239: [[54, 44], 256],
+ 127240: [[55, 44], 256],
+ 127241: [[56, 44], 256],
+ 127242: [[57, 44], 256],
+ 127248: [[40, 65, 41], 256],
+ 127249: [[40, 66, 41], 256],
+ 127250: [[40, 67, 41], 256],
+ 127251: [[40, 68, 41], 256],
+ 127252: [[40, 69, 41], 256],
+ 127253: [[40, 70, 41], 256],
+ 127254: [[40, 71, 41], 256],
+ 127255: [[40, 72, 41], 256],
+ 127256: [[40, 73, 41], 256],
+ 127257: [[40, 74, 41], 256],
+ 127258: [[40, 75, 41], 256],
+ 127259: [[40, 76, 41], 256],
+ 127260: [[40, 77, 41], 256],
+ 127261: [[40, 78, 41], 256],
+ 127262: [[40, 79, 41], 256],
+ 127263: [[40, 80, 41], 256],
+ 127264: [[40, 81, 41], 256],
+ 127265: [[40, 82, 41], 256],
+ 127266: [[40, 83, 41], 256],
+ 127267: [[40, 84, 41], 256],
+ 127268: [[40, 85, 41], 256],
+ 127269: [[40, 86, 41], 256],
+ 127270: [[40, 87, 41], 256],
+ 127271: [[40, 88, 41], 256],
+ 127272: [[40, 89, 41], 256],
+ 127273: [[40, 90, 41], 256],
+ 127274: [[12308, 83, 12309], 256],
+ 127275: [[67], 256],
+ 127276: [[82], 256],
+ 127277: [[67, 68], 256],
+ 127278: [[87, 90], 256],
+ 127280: [[65], 256],
+ 127281: [[66], 256],
+ 127282: [[67], 256],
+ 127283: [[68], 256],
+ 127284: [[69], 256],
+ 127285: [[70], 256],
+ 127286: [[71], 256],
+ 127287: [[72], 256],
+ 127288: [[73], 256],
+ 127289: [[74], 256],
+ 127290: [[75], 256],
+ 127291: [[76], 256],
+ 127292: [[77], 256],
+ 127293: [[78], 256],
+ 127294: [[79], 256],
+ 127295: [[80], 256],
+ 127296: [[81], 256],
+ 127297: [[82], 256],
+ 127298: [[83], 256],
+ 127299: [[84], 256],
+ 127300: [[85], 256],
+ 127301: [[86], 256],
+ 127302: [[87], 256],
+ 127303: [[88], 256],
+ 127304: [[89], 256],
+ 127305: [[90], 256],
+ 127306: [[72, 86], 256],
+ 127307: [[77, 86], 256],
+ 127308: [[83, 68], 256],
+ 127309: [[83, 83], 256],
+ 127310: [[80, 80, 86], 256],
+ 127311: [[87, 67], 256],
+ 127338: [[77, 67], 256],
+ 127339: [[77, 68], 256],
+ 127376: [[68, 74], 256]
+ },
+ 61952: {
+ 127488: [[12411, 12363], 256],
+ 127489: [[12467, 12467], 256],
+ 127490: [[12469], 256],
+ 127504: [[25163], 256],
+ 127505: [[23383], 256],
+ 127506: [[21452], 256],
+ 127507: [[12487], 256],
+ 127508: [[20108], 256],
+ 127509: [[22810], 256],
+ 127510: [[35299], 256],
+ 127511: [[22825], 256],
+ 127512: [[20132], 256],
+ 127513: [[26144], 256],
+ 127514: [[28961], 256],
+ 127515: [[26009], 256],
+ 127516: [[21069], 256],
+ 127517: [[24460], 256],
+ 127518: [[20877], 256],
+ 127519: [[26032], 256],
+ 127520: [[21021], 256],
+ 127521: [[32066], 256],
+ 127522: [[29983], 256],
+ 127523: [[36009], 256],
+ 127524: [[22768], 256],
+ 127525: [[21561], 256],
+ 127526: [[28436], 256],
+ 127527: [[25237], 256],
+ 127528: [[25429], 256],
+ 127529: [[19968], 256],
+ 127530: [[19977], 256],
+ 127531: [[36938], 256],
+ 127532: [[24038], 256],
+ 127533: [[20013], 256],
+ 127534: [[21491], 256],
+ 127535: [[25351], 256],
+ 127536: [[36208], 256],
+ 127537: [[25171], 256],
+ 127538: [[31105], 256],
+ 127539: [[31354], 256],
+ 127540: [[21512], 256],
+ 127541: [[28288], 256],
+ 127542: [[26377], 256],
+ 127543: [[26376], 256],
+ 127544: [[30003], 256],
+ 127545: [[21106], 256],
+ 127546: [[21942], 256],
+ 127552: [[12308, 26412, 12309], 256],
+ 127553: [[12308, 19977, 12309], 256],
+ 127554: [[12308, 20108, 12309], 256],
+ 127555: [[12308, 23433, 12309], 256],
+ 127556: [[12308, 28857, 12309], 256],
+ 127557: [[12308, 25171, 12309], 256],
+ 127558: [[12308, 30423, 12309], 256],
+ 127559: [[12308, 21213, 12309], 256],
+ 127560: [[12308, 25943, 12309], 256],
+ 127568: [[24471], 256],
+ 127569: [[21487], 256]
+ },
+ 63488: {
+ 194560: [[20029]],
+ 194561: [[20024]],
+ 194562: [[20033]],
+ 194563: [[131362]],
+ 194564: [[20320]],
+ 194565: [[20398]],
+ 194566: [[20411]],
+ 194567: [[20482]],
+ 194568: [[20602]],
+ 194569: [[20633]],
+ 194570: [[20711]],
+ 194571: [[20687]],
+ 194572: [[13470]],
+ 194573: [[132666]],
+ 194574: [[20813]],
+ 194575: [[20820]],
+ 194576: [[20836]],
+ 194577: [[20855]],
+ 194578: [[132380]],
+ 194579: [[13497]],
+ 194580: [[20839]],
+ 194581: [[20877]],
+ 194582: [[132427]],
+ 194583: [[20887]],
+ 194584: [[20900]],
+ 194585: [[20172]],
+ 194586: [[20908]],
+ 194587: [[20917]],
+ 194588: [[168415]],
+ 194589: [[20981]],
+ 194590: [[20995]],
+ 194591: [[13535]],
+ 194592: [[21051]],
+ 194593: [[21062]],
+ 194594: [[21106]],
+ 194595: [[21111]],
+ 194596: [[13589]],
+ 194597: [[21191]],
+ 194598: [[21193]],
+ 194599: [[21220]],
+ 194600: [[21242]],
+ 194601: [[21253]],
+ 194602: [[21254]],
+ 194603: [[21271]],
+ 194604: [[21321]],
+ 194605: [[21329]],
+ 194606: [[21338]],
+ 194607: [[21363]],
+ 194608: [[21373]],
+ 194609: [[21375]],
+ 194610: [[21375]],
+ 194611: [[21375]],
+ 194612: [[133676]],
+ 194613: [[28784]],
+ 194614: [[21450]],
+ 194615: [[21471]],
+ 194616: [[133987]],
+ 194617: [[21483]],
+ 194618: [[21489]],
+ 194619: [[21510]],
+ 194620: [[21662]],
+ 194621: [[21560]],
+ 194622: [[21576]],
+ 194623: [[21608]],
+ 194624: [[21666]],
+ 194625: [[21750]],
+ 194626: [[21776]],
+ 194627: [[21843]],
+ 194628: [[21859]],
+ 194629: [[21892]],
+ 194630: [[21892]],
+ 194631: [[21913]],
+ 194632: [[21931]],
+ 194633: [[21939]],
+ 194634: [[21954]],
+ 194635: [[22294]],
+ 194636: [[22022]],
+ 194637: [[22295]],
+ 194638: [[22097]],
+ 194639: [[22132]],
+ 194640: [[20999]],
+ 194641: [[22766]],
+ 194642: [[22478]],
+ 194643: [[22516]],
+ 194644: [[22541]],
+ 194645: [[22411]],
+ 194646: [[22578]],
+ 194647: [[22577]],
+ 194648: [[22700]],
+ 194649: [[136420]],
+ 194650: [[22770]],
+ 194651: [[22775]],
+ 194652: [[22790]],
+ 194653: [[22810]],
+ 194654: [[22818]],
+ 194655: [[22882]],
+ 194656: [[136872]],
+ 194657: [[136938]],
+ 194658: [[23020]],
+ 194659: [[23067]],
+ 194660: [[23079]],
+ 194661: [[23000]],
+ 194662: [[23142]],
+ 194663: [[14062]],
+ 194664: [[14076]],
+ 194665: [[23304]],
+ 194666: [[23358]],
+ 194667: [[23358]],
+ 194668: [[137672]],
+ 194669: [[23491]],
+ 194670: [[23512]],
+ 194671: [[23527]],
+ 194672: [[23539]],
+ 194673: [[138008]],
+ 194674: [[23551]],
+ 194675: [[23558]],
+ 194676: [[24403]],
+ 194677: [[23586]],
+ 194678: [[14209]],
+ 194679: [[23648]],
+ 194680: [[23662]],
+ 194681: [[23744]],
+ 194682: [[23693]],
+ 194683: [[138724]],
+ 194684: [[23875]],
+ 194685: [[138726]],
+ 194686: [[23918]],
+ 194687: [[23915]],
+ 194688: [[23932]],
+ 194689: [[24033]],
+ 194690: [[24034]],
+ 194691: [[14383]],
+ 194692: [[24061]],
+ 194693: [[24104]],
+ 194694: [[24125]],
+ 194695: [[24169]],
+ 194696: [[14434]],
+ 194697: [[139651]],
+ 194698: [[14460]],
+ 194699: [[24240]],
+ 194700: [[24243]],
+ 194701: [[24246]],
+ 194702: [[24266]],
+ 194703: [[172946]],
+ 194704: [[24318]],
+ 194705: [[140081]],
+ 194706: [[140081]],
+ 194707: [[33281]],
+ 194708: [[24354]],
+ 194709: [[24354]],
+ 194710: [[14535]],
+ 194711: [[144056]],
+ 194712: [[156122]],
+ 194713: [[24418]],
+ 194714: [[24427]],
+ 194715: [[14563]],
+ 194716: [[24474]],
+ 194717: [[24525]],
+ 194718: [[24535]],
+ 194719: [[24569]],
+ 194720: [[24705]],
+ 194721: [[14650]],
+ 194722: [[14620]],
+ 194723: [[24724]],
+ 194724: [[141012]],
+ 194725: [[24775]],
+ 194726: [[24904]],
+ 194727: [[24908]],
+ 194728: [[24910]],
+ 194729: [[24908]],
+ 194730: [[24954]],
+ 194731: [[24974]],
+ 194732: [[25010]],
+ 194733: [[24996]],
+ 194734: [[25007]],
+ 194735: [[25054]],
+ 194736: [[25074]],
+ 194737: [[25078]],
+ 194738: [[25104]],
+ 194739: [[25115]],
+ 194740: [[25181]],
+ 194741: [[25265]],
+ 194742: [[25300]],
+ 194743: [[25424]],
+ 194744: [[142092]],
+ 194745: [[25405]],
+ 194746: [[25340]],
+ 194747: [[25448]],
+ 194748: [[25475]],
+ 194749: [[25572]],
+ 194750: [[142321]],
+ 194751: [[25634]],
+ 194752: [[25541]],
+ 194753: [[25513]],
+ 194754: [[14894]],
+ 194755: [[25705]],
+ 194756: [[25726]],
+ 194757: [[25757]],
+ 194758: [[25719]],
+ 194759: [[14956]],
+ 194760: [[25935]],
+ 194761: [[25964]],
+ 194762: [[143370]],
+ 194763: [[26083]],
+ 194764: [[26360]],
+ 194765: [[26185]],
+ 194766: [[15129]],
+ 194767: [[26257]],
+ 194768: [[15112]],
+ 194769: [[15076]],
+ 194770: [[20882]],
+ 194771: [[20885]],
+ 194772: [[26368]],
+ 194773: [[26268]],
+ 194774: [[32941]],
+ 194775: [[17369]],
+ 194776: [[26391]],
+ 194777: [[26395]],
+ 194778: [[26401]],
+ 194779: [[26462]],
+ 194780: [[26451]],
+ 194781: [[144323]],
+ 194782: [[15177]],
+ 194783: [[26618]],
+ 194784: [[26501]],
+ 194785: [[26706]],
+ 194786: [[26757]],
+ 194787: [[144493]],
+ 194788: [[26766]],
+ 194789: [[26655]],
+ 194790: [[26900]],
+ 194791: [[15261]],
+ 194792: [[26946]],
+ 194793: [[27043]],
+ 194794: [[27114]],
+ 194795: [[27304]],
+ 194796: [[145059]],
+ 194797: [[27355]],
+ 194798: [[15384]],
+ 194799: [[27425]],
+ 194800: [[145575]],
+ 194801: [[27476]],
+ 194802: [[15438]],
+ 194803: [[27506]],
+ 194804: [[27551]],
+ 194805: [[27578]],
+ 194806: [[27579]],
+ 194807: [[146061]],
+ 194808: [[138507]],
+ 194809: [[146170]],
+ 194810: [[27726]],
+ 194811: [[146620]],
+ 194812: [[27839]],
+ 194813: [[27853]],
+ 194814: [[27751]],
+ 194815: [[27926]]
+ },
+ 63744: {
+ 63744: [[35912]],
+ 63745: [[26356]],
+ 63746: [[36554]],
+ 63747: [[36040]],
+ 63748: [[28369]],
+ 63749: [[20018]],
+ 63750: [[21477]],
+ 63751: [[40860]],
+ 63752: [[40860]],
+ 63753: [[22865]],
+ 63754: [[37329]],
+ 63755: [[21895]],
+ 63756: [[22856]],
+ 63757: [[25078]],
+ 63758: [[30313]],
+ 63759: [[32645]],
+ 63760: [[34367]],
+ 63761: [[34746]],
+ 63762: [[35064]],
+ 63763: [[37007]],
+ 63764: [[27138]],
+ 63765: [[27931]],
+ 63766: [[28889]],
+ 63767: [[29662]],
+ 63768: [[33853]],
+ 63769: [[37226]],
+ 63770: [[39409]],
+ 63771: [[20098]],
+ 63772: [[21365]],
+ 63773: [[27396]],
+ 63774: [[29211]],
+ 63775: [[34349]],
+ 63776: [[40478]],
+ 63777: [[23888]],
+ 63778: [[28651]],
+ 63779: [[34253]],
+ 63780: [[35172]],
+ 63781: [[25289]],
+ 63782: [[33240]],
+ 63783: [[34847]],
+ 63784: [[24266]],
+ 63785: [[26391]],
+ 63786: [[28010]],
+ 63787: [[29436]],
+ 63788: [[37070]],
+ 63789: [[20358]],
+ 63790: [[20919]],
+ 63791: [[21214]],
+ 63792: [[25796]],
+ 63793: [[27347]],
+ 63794: [[29200]],
+ 63795: [[30439]],
+ 63796: [[32769]],
+ 63797: [[34310]],
+ 63798: [[34396]],
+ 63799: [[36335]],
+ 63800: [[38706]],
+ 63801: [[39791]],
+ 63802: [[40442]],
+ 63803: [[30860]],
+ 63804: [[31103]],
+ 63805: [[32160]],
+ 63806: [[33737]],
+ 63807: [[37636]],
+ 63808: [[40575]],
+ 63809: [[35542]],
+ 63810: [[22751]],
+ 63811: [[24324]],
+ 63812: [[31840]],
+ 63813: [[32894]],
+ 63814: [[29282]],
+ 63815: [[30922]],
+ 63816: [[36034]],
+ 63817: [[38647]],
+ 63818: [[22744]],
+ 63819: [[23650]],
+ 63820: [[27155]],
+ 63821: [[28122]],
+ 63822: [[28431]],
+ 63823: [[32047]],
+ 63824: [[32311]],
+ 63825: [[38475]],
+ 63826: [[21202]],
+ 63827: [[32907]],
+ 63828: [[20956]],
+ 63829: [[20940]],
+ 63830: [[31260]],
+ 63831: [[32190]],
+ 63832: [[33777]],
+ 63833: [[38517]],
+ 63834: [[35712]],
+ 63835: [[25295]],
+ 63836: [[27138]],
+ 63837: [[35582]],
+ 63838: [[20025]],
+ 63839: [[23527]],
+ 63840: [[24594]],
+ 63841: [[29575]],
+ 63842: [[30064]],
+ 63843: [[21271]],
+ 63844: [[30971]],
+ 63845: [[20415]],
+ 63846: [[24489]],
+ 63847: [[19981]],
+ 63848: [[27852]],
+ 63849: [[25976]],
+ 63850: [[32034]],
+ 63851: [[21443]],
+ 63852: [[22622]],
+ 63853: [[30465]],
+ 63854: [[33865]],
+ 63855: [[35498]],
+ 63856: [[27578]],
+ 63857: [[36784]],
+ 63858: [[27784]],
+ 63859: [[25342]],
+ 63860: [[33509]],
+ 63861: [[25504]],
+ 63862: [[30053]],
+ 63863: [[20142]],
+ 63864: [[20841]],
+ 63865: [[20937]],
+ 63866: [[26753]],
+ 63867: [[31975]],
+ 63868: [[33391]],
+ 63869: [[35538]],
+ 63870: [[37327]],
+ 63871: [[21237]],
+ 63872: [[21570]],
+ 63873: [[22899]],
+ 63874: [[24300]],
+ 63875: [[26053]],
+ 63876: [[28670]],
+ 63877: [[31018]],
+ 63878: [[38317]],
+ 63879: [[39530]],
+ 63880: [[40599]],
+ 63881: [[40654]],
+ 63882: [[21147]],
+ 63883: [[26310]],
+ 63884: [[27511]],
+ 63885: [[36706]],
+ 63886: [[24180]],
+ 63887: [[24976]],
+ 63888: [[25088]],
+ 63889: [[25754]],
+ 63890: [[28451]],
+ 63891: [[29001]],
+ 63892: [[29833]],
+ 63893: [[31178]],
+ 63894: [[32244]],
+ 63895: [[32879]],
+ 63896: [[36646]],
+ 63897: [[34030]],
+ 63898: [[36899]],
+ 63899: [[37706]],
+ 63900: [[21015]],
+ 63901: [[21155]],
+ 63902: [[21693]],
+ 63903: [[28872]],
+ 63904: [[35010]],
+ 63905: [[35498]],
+ 63906: [[24265]],
+ 63907: [[24565]],
+ 63908: [[25467]],
+ 63909: [[27566]],
+ 63910: [[31806]],
+ 63911: [[29557]],
+ 63912: [[20196]],
+ 63913: [[22265]],
+ 63914: [[23527]],
+ 63915: [[23994]],
+ 63916: [[24604]],
+ 63917: [[29618]],
+ 63918: [[29801]],
+ 63919: [[32666]],
+ 63920: [[32838]],
+ 63921: [[37428]],
+ 63922: [[38646]],
+ 63923: [[38728]],
+ 63924: [[38936]],
+ 63925: [[20363]],
+ 63926: [[31150]],
+ 63927: [[37300]],
+ 63928: [[38584]],
+ 63929: [[24801]],
+ 63930: [[20102]],
+ 63931: [[20698]],
+ 63932: [[23534]],
+ 63933: [[23615]],
+ 63934: [[26009]],
+ 63935: [[27138]],
+ 63936: [[29134]],
+ 63937: [[30274]],
+ 63938: [[34044]],
+ 63939: [[36988]],
+ 63940: [[40845]],
+ 63941: [[26248]],
+ 63942: [[38446]],
+ 63943: [[21129]],
+ 63944: [[26491]],
+ 63945: [[26611]],
+ 63946: [[27969]],
+ 63947: [[28316]],
+ 63948: [[29705]],
+ 63949: [[30041]],
+ 63950: [[30827]],
+ 63951: [[32016]],
+ 63952: [[39006]],
+ 63953: [[20845]],
+ 63954: [[25134]],
+ 63955: [[38520]],
+ 63956: [[20523]],
+ 63957: [[23833]],
+ 63958: [[28138]],
+ 63959: [[36650]],
+ 63960: [[24459]],
+ 63961: [[24900]],
+ 63962: [[26647]],
+ 63963: [[29575]],
+ 63964: [[38534]],
+ 63965: [[21033]],
+ 63966: [[21519]],
+ 63967: [[23653]],
+ 63968: [[26131]],
+ 63969: [[26446]],
+ 63970: [[26792]],
+ 63971: [[27877]],
+ 63972: [[29702]],
+ 63973: [[30178]],
+ 63974: [[32633]],
+ 63975: [[35023]],
+ 63976: [[35041]],
+ 63977: [[37324]],
+ 63978: [[38626]],
+ 63979: [[21311]],
+ 63980: [[28346]],
+ 63981: [[21533]],
+ 63982: [[29136]],
+ 63983: [[29848]],
+ 63984: [[34298]],
+ 63985: [[38563]],
+ 63986: [[40023]],
+ 63987: [[40607]],
+ 63988: [[26519]],
+ 63989: [[28107]],
+ 63990: [[33256]],
+ 63991: [[31435]],
+ 63992: [[31520]],
+ 63993: [[31890]],
+ 63994: [[29376]],
+ 63995: [[28825]],
+ 63996: [[35672]],
+ 63997: [[20160]],
+ 63998: [[33590]],
+ 63999: [[21050]],
+ 194816: [[27966]],
+ 194817: [[28023]],
+ 194818: [[27969]],
+ 194819: [[28009]],
+ 194820: [[28024]],
+ 194821: [[28037]],
+ 194822: [[146718]],
+ 194823: [[27956]],
+ 194824: [[28207]],
+ 194825: [[28270]],
+ 194826: [[15667]],
+ 194827: [[28363]],
+ 194828: [[28359]],
+ 194829: [[147153]],
+ 194830: [[28153]],
+ 194831: [[28526]],
+ 194832: [[147294]],
+ 194833: [[147342]],
+ 194834: [[28614]],
+ 194835: [[28729]],
+ 194836: [[28702]],
+ 194837: [[28699]],
+ 194838: [[15766]],
+ 194839: [[28746]],
+ 194840: [[28797]],
+ 194841: [[28791]],
+ 194842: [[28845]],
+ 194843: [[132389]],
+ 194844: [[28997]],
+ 194845: [[148067]],
+ 194846: [[29084]],
+ 194847: [[148395]],
+ 194848: [[29224]],
+ 194849: [[29237]],
+ 194850: [[29264]],
+ 194851: [[149000]],
+ 194852: [[29312]],
+ 194853: [[29333]],
+ 194854: [[149301]],
+ 194855: [[149524]],
+ 194856: [[29562]],
+ 194857: [[29579]],
+ 194858: [[16044]],
+ 194859: [[29605]],
+ 194860: [[16056]],
+ 194861: [[16056]],
+ 194862: [[29767]],
+ 194863: [[29788]],
+ 194864: [[29809]],
+ 194865: [[29829]],
+ 194866: [[29898]],
+ 194867: [[16155]],
+ 194868: [[29988]],
+ 194869: [[150582]],
+ 194870: [[30014]],
+ 194871: [[150674]],
+ 194872: [[30064]],
+ 194873: [[139679]],
+ 194874: [[30224]],
+ 194875: [[151457]],
+ 194876: [[151480]],
+ 194877: [[151620]],
+ 194878: [[16380]],
+ 194879: [[16392]],
+ 194880: [[30452]],
+ 194881: [[151795]],
+ 194882: [[151794]],
+ 194883: [[151833]],
+ 194884: [[151859]],
+ 194885: [[30494]],
+ 194886: [[30495]],
+ 194887: [[30495]],
+ 194888: [[30538]],
+ 194889: [[16441]],
+ 194890: [[30603]],
+ 194891: [[16454]],
+ 194892: [[16534]],
+ 194893: [[152605]],
+ 194894: [[30798]],
+ 194895: [[30860]],
+ 194896: [[30924]],
+ 194897: [[16611]],
+ 194898: [[153126]],
+ 194899: [[31062]],
+ 194900: [[153242]],
+ 194901: [[153285]],
+ 194902: [[31119]],
+ 194903: [[31211]],
+ 194904: [[16687]],
+ 194905: [[31296]],
+ 194906: [[31306]],
+ 194907: [[31311]],
+ 194908: [[153980]],
+ 194909: [[154279]],
+ 194910: [[154279]],
+ 194911: [[31470]],
+ 194912: [[16898]],
+ 194913: [[154539]],
+ 194914: [[31686]],
+ 194915: [[31689]],
+ 194916: [[16935]],
+ 194917: [[154752]],
+ 194918: [[31954]],
+ 194919: [[17056]],
+ 194920: [[31976]],
+ 194921: [[31971]],
+ 194922: [[32000]],
+ 194923: [[155526]],
+ 194924: [[32099]],
+ 194925: [[17153]],
+ 194926: [[32199]],
+ 194927: [[32258]],
+ 194928: [[32325]],
+ 194929: [[17204]],
+ 194930: [[156200]],
+ 194931: [[156231]],
+ 194932: [[17241]],
+ 194933: [[156377]],
+ 194934: [[32634]],
+ 194935: [[156478]],
+ 194936: [[32661]],
+ 194937: [[32762]],
+ 194938: [[32773]],
+ 194939: [[156890]],
+ 194940: [[156963]],
+ 194941: [[32864]],
+ 194942: [[157096]],
+ 194943: [[32880]],
+ 194944: [[144223]],
+ 194945: [[17365]],
+ 194946: [[32946]],
+ 194947: [[33027]],
+ 194948: [[17419]],
+ 194949: [[33086]],
+ 194950: [[23221]],
+ 194951: [[157607]],
+ 194952: [[157621]],
+ 194953: [[144275]],
+ 194954: [[144284]],
+ 194955: [[33281]],
+ 194956: [[33284]],
+ 194957: [[36766]],
+ 194958: [[17515]],
+ 194959: [[33425]],
+ 194960: [[33419]],
+ 194961: [[33437]],
+ 194962: [[21171]],
+ 194963: [[33457]],
+ 194964: [[33459]],
+ 194965: [[33469]],
+ 194966: [[33510]],
+ 194967: [[158524]],
+ 194968: [[33509]],
+ 194969: [[33565]],
+ 194970: [[33635]],
+ 194971: [[33709]],
+ 194972: [[33571]],
+ 194973: [[33725]],
+ 194974: [[33767]],
+ 194975: [[33879]],
+ 194976: [[33619]],
+ 194977: [[33738]],
+ 194978: [[33740]],
+ 194979: [[33756]],
+ 194980: [[158774]],
+ 194981: [[159083]],
+ 194982: [[158933]],
+ 194983: [[17707]],
+ 194984: [[34033]],
+ 194985: [[34035]],
+ 194986: [[34070]],
+ 194987: [[160714]],
+ 194988: [[34148]],
+ 194989: [[159532]],
+ 194990: [[17757]],
+ 194991: [[17761]],
+ 194992: [[159665]],
+ 194993: [[159954]],
+ 194994: [[17771]],
+ 194995: [[34384]],
+ 194996: [[34396]],
+ 194997: [[34407]],
+ 194998: [[34409]],
+ 194999: [[34473]],
+ 195000: [[34440]],
+ 195001: [[34574]],
+ 195002: [[34530]],
+ 195003: [[34681]],
+ 195004: [[34600]],
+ 195005: [[34667]],
+ 195006: [[34694]],
+ 195007: [[17879]],
+ 195008: [[34785]],
+ 195009: [[34817]],
+ 195010: [[17913]],
+ 195011: [[34912]],
+ 195012: [[34915]],
+ 195013: [[161383]],
+ 195014: [[35031]],
+ 195015: [[35038]],
+ 195016: [[17973]],
+ 195017: [[35066]],
+ 195018: [[13499]],
+ 195019: [[161966]],
+ 195020: [[162150]],
+ 195021: [[18110]],
+ 195022: [[18119]],
+ 195023: [[35488]],
+ 195024: [[35565]],
+ 195025: [[35722]],
+ 195026: [[35925]],
+ 195027: [[162984]],
+ 195028: [[36011]],
+ 195029: [[36033]],
+ 195030: [[36123]],
+ 195031: [[36215]],
+ 195032: [[163631]],
+ 195033: [[133124]],
+ 195034: [[36299]],
+ 195035: [[36284]],
+ 195036: [[36336]],
+ 195037: [[133342]],
+ 195038: [[36564]],
+ 195039: [[36664]],
+ 195040: [[165330]],
+ 195041: [[165357]],
+ 195042: [[37012]],
+ 195043: [[37105]],
+ 195044: [[37137]],
+ 195045: [[165678]],
+ 195046: [[37147]],
+ 195047: [[37432]],
+ 195048: [[37591]],
+ 195049: [[37592]],
+ 195050: [[37500]],
+ 195051: [[37881]],
+ 195052: [[37909]],
+ 195053: [[166906]],
+ 195054: [[38283]],
+ 195055: [[18837]],
+ 195056: [[38327]],
+ 195057: [[167287]],
+ 195058: [[18918]],
+ 195059: [[38595]],
+ 195060: [[23986]],
+ 195061: [[38691]],
+ 195062: [[168261]],
+ 195063: [[168474]],
+ 195064: [[19054]],
+ 195065: [[19062]],
+ 195066: [[38880]],
+ 195067: [[168970]],
+ 195068: [[19122]],
+ 195069: [[169110]],
+ 195070: [[38923]],
+ 195071: [[38923]]
+ },
+ 64000: {
+ 64000: [[20999]],
+ 64001: [[24230]],
+ 64002: [[25299]],
+ 64003: [[31958]],
+ 64004: [[23429]],
+ 64005: [[27934]],
+ 64006: [[26292]],
+ 64007: [[36667]],
+ 64008: [[34892]],
+ 64009: [[38477]],
+ 64010: [[35211]],
+ 64011: [[24275]],
+ 64012: [[20800]],
+ 64013: [[21952]],
+ 64016: [[22618]],
+ 64018: [[26228]],
+ 64021: [[20958]],
+ 64022: [[29482]],
+ 64023: [[30410]],
+ 64024: [[31036]],
+ 64025: [[31070]],
+ 64026: [[31077]],
+ 64027: [[31119]],
+ 64028: [[38742]],
+ 64029: [[31934]],
+ 64030: [[32701]],
+ 64032: [[34322]],
+ 64034: [[35576]],
+ 64037: [[36920]],
+ 64038: [[37117]],
+ 64042: [[39151]],
+ 64043: [[39164]],
+ 64044: [[39208]],
+ 64045: [[40372]],
+ 64046: [[37086]],
+ 64047: [[38583]],
+ 64048: [[20398]],
+ 64049: [[20711]],
+ 64050: [[20813]],
+ 64051: [[21193]],
+ 64052: [[21220]],
+ 64053: [[21329]],
+ 64054: [[21917]],
+ 64055: [[22022]],
+ 64056: [[22120]],
+ 64057: [[22592]],
+ 64058: [[22696]],
+ 64059: [[23652]],
+ 64060: [[23662]],
+ 64061: [[24724]],
+ 64062: [[24936]],
+ 64063: [[24974]],
+ 64064: [[25074]],
+ 64065: [[25935]],
+ 64066: [[26082]],
+ 64067: [[26257]],
+ 64068: [[26757]],
+ 64069: [[28023]],
+ 64070: [[28186]],
+ 64071: [[28450]],
+ 64072: [[29038]],
+ 64073: [[29227]],
+ 64074: [[29730]],
+ 64075: [[30865]],
+ 64076: [[31038]],
+ 64077: [[31049]],
+ 64078: [[31048]],
+ 64079: [[31056]],
+ 64080: [[31062]],
+ 64081: [[31069]],
+ 64082: [[31117]],
+ 64083: [[31118]],
+ 64084: [[31296]],
+ 64085: [[31361]],
+ 64086: [[31680]],
+ 64087: [[32244]],
+ 64088: [[32265]],
+ 64089: [[32321]],
+ 64090: [[32626]],
+ 64091: [[32773]],
+ 64092: [[33261]],
+ 64093: [[33401]],
+ 64094: [[33401]],
+ 64095: [[33879]],
+ 64096: [[35088]],
+ 64097: [[35222]],
+ 64098: [[35585]],
+ 64099: [[35641]],
+ 64100: [[36051]],
+ 64101: [[36104]],
+ 64102: [[36790]],
+ 64103: [[36920]],
+ 64104: [[38627]],
+ 64105: [[38911]],
+ 64106: [[38971]],
+ 64107: [[24693]],
+ 64108: [[148206]],
+ 64109: [[33304]],
+ 64112: [[20006]],
+ 64113: [[20917]],
+ 64114: [[20840]],
+ 64115: [[20352]],
+ 64116: [[20805]],
+ 64117: [[20864]],
+ 64118: [[21191]],
+ 64119: [[21242]],
+ 64120: [[21917]],
+ 64121: [[21845]],
+ 64122: [[21913]],
+ 64123: [[21986]],
+ 64124: [[22618]],
+ 64125: [[22707]],
+ 64126: [[22852]],
+ 64127: [[22868]],
+ 64128: [[23138]],
+ 64129: [[23336]],
+ 64130: [[24274]],
+ 64131: [[24281]],
+ 64132: [[24425]],
+ 64133: [[24493]],
+ 64134: [[24792]],
+ 64135: [[24910]],
+ 64136: [[24840]],
+ 64137: [[24974]],
+ 64138: [[24928]],
+ 64139: [[25074]],
+ 64140: [[25140]],
+ 64141: [[25540]],
+ 64142: [[25628]],
+ 64143: [[25682]],
+ 64144: [[25942]],
+ 64145: [[26228]],
+ 64146: [[26391]],
+ 64147: [[26395]],
+ 64148: [[26454]],
+ 64149: [[27513]],
+ 64150: [[27578]],
+ 64151: [[27969]],
+ 64152: [[28379]],
+ 64153: [[28363]],
+ 64154: [[28450]],
+ 64155: [[28702]],
+ 64156: [[29038]],
+ 64157: [[30631]],
+ 64158: [[29237]],
+ 64159: [[29359]],
+ 64160: [[29482]],
+ 64161: [[29809]],
+ 64162: [[29958]],
+ 64163: [[30011]],
+ 64164: [[30237]],
+ 64165: [[30239]],
+ 64166: [[30410]],
+ 64167: [[30427]],
+ 64168: [[30452]],
+ 64169: [[30538]],
+ 64170: [[30528]],
+ 64171: [[30924]],
+ 64172: [[31409]],
+ 64173: [[31680]],
+ 64174: [[31867]],
+ 64175: [[32091]],
+ 64176: [[32244]],
+ 64177: [[32574]],
+ 64178: [[32773]],
+ 64179: [[33618]],
+ 64180: [[33775]],
+ 64181: [[34681]],
+ 64182: [[35137]],
+ 64183: [[35206]],
+ 64184: [[35222]],
+ 64185: [[35519]],
+ 64186: [[35576]],
+ 64187: [[35531]],
+ 64188: [[35585]],
+ 64189: [[35582]],
+ 64190: [[35565]],
+ 64191: [[35641]],
+ 64192: [[35722]],
+ 64193: [[36104]],
+ 64194: [[36664]],
+ 64195: [[36978]],
+ 64196: [[37273]],
+ 64197: [[37494]],
+ 64198: [[38524]],
+ 64199: [[38627]],
+ 64200: [[38742]],
+ 64201: [[38875]],
+ 64202: [[38911]],
+ 64203: [[38923]],
+ 64204: [[38971]],
+ 64205: [[39698]],
+ 64206: [[40860]],
+ 64207: [[141386]],
+ 64208: [[141380]],
+ 64209: [[144341]],
+ 64210: [[15261]],
+ 64211: [[16408]],
+ 64212: [[16441]],
+ 64213: [[152137]],
+ 64214: [[154832]],
+ 64215: [[163539]],
+ 64216: [[40771]],
+ 64217: [[40846]],
+ 195072: [[38953]],
+ 195073: [[169398]],
+ 195074: [[39138]],
+ 195075: [[19251]],
+ 195076: [[39209]],
+ 195077: [[39335]],
+ 195078: [[39362]],
+ 195079: [[39422]],
+ 195080: [[19406]],
+ 195081: [[170800]],
+ 195082: [[39698]],
+ 195083: [[40000]],
+ 195084: [[40189]],
+ 195085: [[19662]],
+ 195086: [[19693]],
+ 195087: [[40295]],
+ 195088: [[172238]],
+ 195089: [[19704]],
+ 195090: [[172293]],
+ 195091: [[172558]],
+ 195092: [[172689]],
+ 195093: [[40635]],
+ 195094: [[19798]],
+ 195095: [[40697]],
+ 195096: [[40702]],
+ 195097: [[40709]],
+ 195098: [[40719]],
+ 195099: [[40726]],
+ 195100: [[40763]],
+ 195101: [[173568]]
+ },
+ 64256: {
+ 64256: [[102, 102], 256],
+ 64257: [[102, 105], 256],
+ 64258: [[102, 108], 256],
+ 64259: [[102, 102, 105], 256],
+ 64260: [[102, 102, 108], 256],
+ 64261: [[383, 116], 256],
+ 64262: [[115, 116], 256],
+ 64275: [[1396, 1398], 256],
+ 64276: [[1396, 1381], 256],
+ 64277: [[1396, 1387], 256],
+ 64278: [[1406, 1398], 256],
+ 64279: [[1396, 1389], 256],
+ 64285: [[1497, 1460], 512],
+ 64286: [, 26],
+ 64287: [[1522, 1463], 512],
+ 64288: [[1506], 256],
+ 64289: [[1488], 256],
+ 64290: [[1491], 256],
+ 64291: [[1492], 256],
+ 64292: [[1499], 256],
+ 64293: [[1500], 256],
+ 64294: [[1501], 256],
+ 64295: [[1512], 256],
+ 64296: [[1514], 256],
+ 64297: [[43], 256],
+ 64298: [[1513, 1473], 512],
+ 64299: [[1513, 1474], 512],
+ 64300: [[64329, 1473], 512],
+ 64301: [[64329, 1474], 512],
+ 64302: [[1488, 1463], 512],
+ 64303: [[1488, 1464], 512],
+ 64304: [[1488, 1468], 512],
+ 64305: [[1489, 1468], 512],
+ 64306: [[1490, 1468], 512],
+ 64307: [[1491, 1468], 512],
+ 64308: [[1492, 1468], 512],
+ 64309: [[1493, 1468], 512],
+ 64310: [[1494, 1468], 512],
+ 64312: [[1496, 1468], 512],
+ 64313: [[1497, 1468], 512],
+ 64314: [[1498, 1468], 512],
+ 64315: [[1499, 1468], 512],
+ 64316: [[1500, 1468], 512],
+ 64318: [[1502, 1468], 512],
+ 64320: [[1504, 1468], 512],
+ 64321: [[1505, 1468], 512],
+ 64323: [[1507, 1468], 512],
+ 64324: [[1508, 1468], 512],
+ 64326: [[1510, 1468], 512],
+ 64327: [[1511, 1468], 512],
+ 64328: [[1512, 1468], 512],
+ 64329: [[1513, 1468], 512],
+ 64330: [[1514, 1468], 512],
+ 64331: [[1493, 1465], 512],
+ 64332: [[1489, 1471], 512],
+ 64333: [[1499, 1471], 512],
+ 64334: [[1508, 1471], 512],
+ 64335: [[1488, 1500], 256],
+ 64336: [[1649], 256],
+ 64337: [[1649], 256],
+ 64338: [[1659], 256],
+ 64339: [[1659], 256],
+ 64340: [[1659], 256],
+ 64341: [[1659], 256],
+ 64342: [[1662], 256],
+ 64343: [[1662], 256],
+ 64344: [[1662], 256],
+ 64345: [[1662], 256],
+ 64346: [[1664], 256],
+ 64347: [[1664], 256],
+ 64348: [[1664], 256],
+ 64349: [[1664], 256],
+ 64350: [[1658], 256],
+ 64351: [[1658], 256],
+ 64352: [[1658], 256],
+ 64353: [[1658], 256],
+ 64354: [[1663], 256],
+ 64355: [[1663], 256],
+ 64356: [[1663], 256],
+ 64357: [[1663], 256],
+ 64358: [[1657], 256],
+ 64359: [[1657], 256],
+ 64360: [[1657], 256],
+ 64361: [[1657], 256],
+ 64362: [[1700], 256],
+ 64363: [[1700], 256],
+ 64364: [[1700], 256],
+ 64365: [[1700], 256],
+ 64366: [[1702], 256],
+ 64367: [[1702], 256],
+ 64368: [[1702], 256],
+ 64369: [[1702], 256],
+ 64370: [[1668], 256],
+ 64371: [[1668], 256],
+ 64372: [[1668], 256],
+ 64373: [[1668], 256],
+ 64374: [[1667], 256],
+ 64375: [[1667], 256],
+ 64376: [[1667], 256],
+ 64377: [[1667], 256],
+ 64378: [[1670], 256],
+ 64379: [[1670], 256],
+ 64380: [[1670], 256],
+ 64381: [[1670], 256],
+ 64382: [[1671], 256],
+ 64383: [[1671], 256],
+ 64384: [[1671], 256],
+ 64385: [[1671], 256],
+ 64386: [[1677], 256],
+ 64387: [[1677], 256],
+ 64388: [[1676], 256],
+ 64389: [[1676], 256],
+ 64390: [[1678], 256],
+ 64391: [[1678], 256],
+ 64392: [[1672], 256],
+ 64393: [[1672], 256],
+ 64394: [[1688], 256],
+ 64395: [[1688], 256],
+ 64396: [[1681], 256],
+ 64397: [[1681], 256],
+ 64398: [[1705], 256],
+ 64399: [[1705], 256],
+ 64400: [[1705], 256],
+ 64401: [[1705], 256],
+ 64402: [[1711], 256],
+ 64403: [[1711], 256],
+ 64404: [[1711], 256],
+ 64405: [[1711], 256],
+ 64406: [[1715], 256],
+ 64407: [[1715], 256],
+ 64408: [[1715], 256],
+ 64409: [[1715], 256],
+ 64410: [[1713], 256],
+ 64411: [[1713], 256],
+ 64412: [[1713], 256],
+ 64413: [[1713], 256],
+ 64414: [[1722], 256],
+ 64415: [[1722], 256],
+ 64416: [[1723], 256],
+ 64417: [[1723], 256],
+ 64418: [[1723], 256],
+ 64419: [[1723], 256],
+ 64420: [[1728], 256],
+ 64421: [[1728], 256],
+ 64422: [[1729], 256],
+ 64423: [[1729], 256],
+ 64424: [[1729], 256],
+ 64425: [[1729], 256],
+ 64426: [[1726], 256],
+ 64427: [[1726], 256],
+ 64428: [[1726], 256],
+ 64429: [[1726], 256],
+ 64430: [[1746], 256],
+ 64431: [[1746], 256],
+ 64432: [[1747], 256],
+ 64433: [[1747], 256],
+ 64467: [[1709], 256],
+ 64468: [[1709], 256],
+ 64469: [[1709], 256],
+ 64470: [[1709], 256],
+ 64471: [[1735], 256],
+ 64472: [[1735], 256],
+ 64473: [[1734], 256],
+ 64474: [[1734], 256],
+ 64475: [[1736], 256],
+ 64476: [[1736], 256],
+ 64477: [[1655], 256],
+ 64478: [[1739], 256],
+ 64479: [[1739], 256],
+ 64480: [[1733], 256],
+ 64481: [[1733], 256],
+ 64482: [[1737], 256],
+ 64483: [[1737], 256],
+ 64484: [[1744], 256],
+ 64485: [[1744], 256],
+ 64486: [[1744], 256],
+ 64487: [[1744], 256],
+ 64488: [[1609], 256],
+ 64489: [[1609], 256],
+ 64490: [[1574, 1575], 256],
+ 64491: [[1574, 1575], 256],
+ 64492: [[1574, 1749], 256],
+ 64493: [[1574, 1749], 256],
+ 64494: [[1574, 1608], 256],
+ 64495: [[1574, 1608], 256],
+ 64496: [[1574, 1735], 256],
+ 64497: [[1574, 1735], 256],
+ 64498: [[1574, 1734], 256],
+ 64499: [[1574, 1734], 256],
+ 64500: [[1574, 1736], 256],
+ 64501: [[1574, 1736], 256],
+ 64502: [[1574, 1744], 256],
+ 64503: [[1574, 1744], 256],
+ 64504: [[1574, 1744], 256],
+ 64505: [[1574, 1609], 256],
+ 64506: [[1574, 1609], 256],
+ 64507: [[1574, 1609], 256],
+ 64508: [[1740], 256],
+ 64509: [[1740], 256],
+ 64510: [[1740], 256],
+ 64511: [[1740], 256]
+ },
+ 64512: {
+ 64512: [[1574, 1580], 256],
+ 64513: [[1574, 1581], 256],
+ 64514: [[1574, 1605], 256],
+ 64515: [[1574, 1609], 256],
+ 64516: [[1574, 1610], 256],
+ 64517: [[1576, 1580], 256],
+ 64518: [[1576, 1581], 256],
+ 64519: [[1576, 1582], 256],
+ 64520: [[1576, 1605], 256],
+ 64521: [[1576, 1609], 256],
+ 64522: [[1576, 1610], 256],
+ 64523: [[1578, 1580], 256],
+ 64524: [[1578, 1581], 256],
+ 64525: [[1578, 1582], 256],
+ 64526: [[1578, 1605], 256],
+ 64527: [[1578, 1609], 256],
+ 64528: [[1578, 1610], 256],
+ 64529: [[1579, 1580], 256],
+ 64530: [[1579, 1605], 256],
+ 64531: [[1579, 1609], 256],
+ 64532: [[1579, 1610], 256],
+ 64533: [[1580, 1581], 256],
+ 64534: [[1580, 1605], 256],
+ 64535: [[1581, 1580], 256],
+ 64536: [[1581, 1605], 256],
+ 64537: [[1582, 1580], 256],
+ 64538: [[1582, 1581], 256],
+ 64539: [[1582, 1605], 256],
+ 64540: [[1587, 1580], 256],
+ 64541: [[1587, 1581], 256],
+ 64542: [[1587, 1582], 256],
+ 64543: [[1587, 1605], 256],
+ 64544: [[1589, 1581], 256],
+ 64545: [[1589, 1605], 256],
+ 64546: [[1590, 1580], 256],
+ 64547: [[1590, 1581], 256],
+ 64548: [[1590, 1582], 256],
+ 64549: [[1590, 1605], 256],
+ 64550: [[1591, 1581], 256],
+ 64551: [[1591, 1605], 256],
+ 64552: [[1592, 1605], 256],
+ 64553: [[1593, 1580], 256],
+ 64554: [[1593, 1605], 256],
+ 64555: [[1594, 1580], 256],
+ 64556: [[1594, 1605], 256],
+ 64557: [[1601, 1580], 256],
+ 64558: [[1601, 1581], 256],
+ 64559: [[1601, 1582], 256],
+ 64560: [[1601, 1605], 256],
+ 64561: [[1601, 1609], 256],
+ 64562: [[1601, 1610], 256],
+ 64563: [[1602, 1581], 256],
+ 64564: [[1602, 1605], 256],
+ 64565: [[1602, 1609], 256],
+ 64566: [[1602, 1610], 256],
+ 64567: [[1603, 1575], 256],
+ 64568: [[1603, 1580], 256],
+ 64569: [[1603, 1581], 256],
+ 64570: [[1603, 1582], 256],
+ 64571: [[1603, 1604], 256],
+ 64572: [[1603, 1605], 256],
+ 64573: [[1603, 1609], 256],
+ 64574: [[1603, 1610], 256],
+ 64575: [[1604, 1580], 256],
+ 64576: [[1604, 1581], 256],
+ 64577: [[1604, 1582], 256],
+ 64578: [[1604, 1605], 256],
+ 64579: [[1604, 1609], 256],
+ 64580: [[1604, 1610], 256],
+ 64581: [[1605, 1580], 256],
+ 64582: [[1605, 1581], 256],
+ 64583: [[1605, 1582], 256],
+ 64584: [[1605, 1605], 256],
+ 64585: [[1605, 1609], 256],
+ 64586: [[1605, 1610], 256],
+ 64587: [[1606, 1580], 256],
+ 64588: [[1606, 1581], 256],
+ 64589: [[1606, 1582], 256],
+ 64590: [[1606, 1605], 256],
+ 64591: [[1606, 1609], 256],
+ 64592: [[1606, 1610], 256],
+ 64593: [[1607, 1580], 256],
+ 64594: [[1607, 1605], 256],
+ 64595: [[1607, 1609], 256],
+ 64596: [[1607, 1610], 256],
+ 64597: [[1610, 1580], 256],
+ 64598: [[1610, 1581], 256],
+ 64599: [[1610, 1582], 256],
+ 64600: [[1610, 1605], 256],
+ 64601: [[1610, 1609], 256],
+ 64602: [[1610, 1610], 256],
+ 64603: [[1584, 1648], 256],
+ 64604: [[1585, 1648], 256],
+ 64605: [[1609, 1648], 256],
+ 64606: [[32, 1612, 1617], 256],
+ 64607: [[32, 1613, 1617], 256],
+ 64608: [[32, 1614, 1617], 256],
+ 64609: [[32, 1615, 1617], 256],
+ 64610: [[32, 1616, 1617], 256],
+ 64611: [[32, 1617, 1648], 256],
+ 64612: [[1574, 1585], 256],
+ 64613: [[1574, 1586], 256],
+ 64614: [[1574, 1605], 256],
+ 64615: [[1574, 1606], 256],
+ 64616: [[1574, 1609], 256],
+ 64617: [[1574, 1610], 256],
+ 64618: [[1576, 1585], 256],
+ 64619: [[1576, 1586], 256],
+ 64620: [[1576, 1605], 256],
+ 64621: [[1576, 1606], 256],
+ 64622: [[1576, 1609], 256],
+ 64623: [[1576, 1610], 256],
+ 64624: [[1578, 1585], 256],
+ 64625: [[1578, 1586], 256],
+ 64626: [[1578, 1605], 256],
+ 64627: [[1578, 1606], 256],
+ 64628: [[1578, 1609], 256],
+ 64629: [[1578, 1610], 256],
+ 64630: [[1579, 1585], 256],
+ 64631: [[1579, 1586], 256],
+ 64632: [[1579, 1605], 256],
+ 64633: [[1579, 1606], 256],
+ 64634: [[1579, 1609], 256],
+ 64635: [[1579, 1610], 256],
+ 64636: [[1601, 1609], 256],
+ 64637: [[1601, 1610], 256],
+ 64638: [[1602, 1609], 256],
+ 64639: [[1602, 1610], 256],
+ 64640: [[1603, 1575], 256],
+ 64641: [[1603, 1604], 256],
+ 64642: [[1603, 1605], 256],
+ 64643: [[1603, 1609], 256],
+ 64644: [[1603, 1610], 256],
+ 64645: [[1604, 1605], 256],
+ 64646: [[1604, 1609], 256],
+ 64647: [[1604, 1610], 256],
+ 64648: [[1605, 1575], 256],
+ 64649: [[1605, 1605], 256],
+ 64650: [[1606, 1585], 256],
+ 64651: [[1606, 1586], 256],
+ 64652: [[1606, 1605], 256],
+ 64653: [[1606, 1606], 256],
+ 64654: [[1606, 1609], 256],
+ 64655: [[1606, 1610], 256],
+ 64656: [[1609, 1648], 256],
+ 64657: [[1610, 1585], 256],
+ 64658: [[1610, 1586], 256],
+ 64659: [[1610, 1605], 256],
+ 64660: [[1610, 1606], 256],
+ 64661: [[1610, 1609], 256],
+ 64662: [[1610, 1610], 256],
+ 64663: [[1574, 1580], 256],
+ 64664: [[1574, 1581], 256],
+ 64665: [[1574, 1582], 256],
+ 64666: [[1574, 1605], 256],
+ 64667: [[1574, 1607], 256],
+ 64668: [[1576, 1580], 256],
+ 64669: [[1576, 1581], 256],
+ 64670: [[1576, 1582], 256],
+ 64671: [[1576, 1605], 256],
+ 64672: [[1576, 1607], 256],
+ 64673: [[1578, 1580], 256],
+ 64674: [[1578, 1581], 256],
+ 64675: [[1578, 1582], 256],
+ 64676: [[1578, 1605], 256],
+ 64677: [[1578, 1607], 256],
+ 64678: [[1579, 1605], 256],
+ 64679: [[1580, 1581], 256],
+ 64680: [[1580, 1605], 256],
+ 64681: [[1581, 1580], 256],
+ 64682: [[1581, 1605], 256],
+ 64683: [[1582, 1580], 256],
+ 64684: [[1582, 1605], 256],
+ 64685: [[1587, 1580], 256],
+ 64686: [[1587, 1581], 256],
+ 64687: [[1587, 1582], 256],
+ 64688: [[1587, 1605], 256],
+ 64689: [[1589, 1581], 256],
+ 64690: [[1589, 1582], 256],
+ 64691: [[1589, 1605], 256],
+ 64692: [[1590, 1580], 256],
+ 64693: [[1590, 1581], 256],
+ 64694: [[1590, 1582], 256],
+ 64695: [[1590, 1605], 256],
+ 64696: [[1591, 1581], 256],
+ 64697: [[1592, 1605], 256],
+ 64698: [[1593, 1580], 256],
+ 64699: [[1593, 1605], 256],
+ 64700: [[1594, 1580], 256],
+ 64701: [[1594, 1605], 256],
+ 64702: [[1601, 1580], 256],
+ 64703: [[1601, 1581], 256],
+ 64704: [[1601, 1582], 256],
+ 64705: [[1601, 1605], 256],
+ 64706: [[1602, 1581], 256],
+ 64707: [[1602, 1605], 256],
+ 64708: [[1603, 1580], 256],
+ 64709: [[1603, 1581], 256],
+ 64710: [[1603, 1582], 256],
+ 64711: [[1603, 1604], 256],
+ 64712: [[1603, 1605], 256],
+ 64713: [[1604, 1580], 256],
+ 64714: [[1604, 1581], 256],
+ 64715: [[1604, 1582], 256],
+ 64716: [[1604, 1605], 256],
+ 64717: [[1604, 1607], 256],
+ 64718: [[1605, 1580], 256],
+ 64719: [[1605, 1581], 256],
+ 64720: [[1605, 1582], 256],
+ 64721: [[1605, 1605], 256],
+ 64722: [[1606, 1580], 256],
+ 64723: [[1606, 1581], 256],
+ 64724: [[1606, 1582], 256],
+ 64725: [[1606, 1605], 256],
+ 64726: [[1606, 1607], 256],
+ 64727: [[1607, 1580], 256],
+ 64728: [[1607, 1605], 256],
+ 64729: [[1607, 1648], 256],
+ 64730: [[1610, 1580], 256],
+ 64731: [[1610, 1581], 256],
+ 64732: [[1610, 1582], 256],
+ 64733: [[1610, 1605], 256],
+ 64734: [[1610, 1607], 256],
+ 64735: [[1574, 1605], 256],
+ 64736: [[1574, 1607], 256],
+ 64737: [[1576, 1605], 256],
+ 64738: [[1576, 1607], 256],
+ 64739: [[1578, 1605], 256],
+ 64740: [[1578, 1607], 256],
+ 64741: [[1579, 1605], 256],
+ 64742: [[1579, 1607], 256],
+ 64743: [[1587, 1605], 256],
+ 64744: [[1587, 1607], 256],
+ 64745: [[1588, 1605], 256],
+ 64746: [[1588, 1607], 256],
+ 64747: [[1603, 1604], 256],
+ 64748: [[1603, 1605], 256],
+ 64749: [[1604, 1605], 256],
+ 64750: [[1606, 1605], 256],
+ 64751: [[1606, 1607], 256],
+ 64752: [[1610, 1605], 256],
+ 64753: [[1610, 1607], 256],
+ 64754: [[1600, 1614, 1617], 256],
+ 64755: [[1600, 1615, 1617], 256],
+ 64756: [[1600, 1616, 1617], 256],
+ 64757: [[1591, 1609], 256],
+ 64758: [[1591, 1610], 256],
+ 64759: [[1593, 1609], 256],
+ 64760: [[1593, 1610], 256],
+ 64761: [[1594, 1609], 256],
+ 64762: [[1594, 1610], 256],
+ 64763: [[1587, 1609], 256],
+ 64764: [[1587, 1610], 256],
+ 64765: [[1588, 1609], 256],
+ 64766: [[1588, 1610], 256],
+ 64767: [[1581, 1609], 256]
+ },
+ 64768: {
+ 64768: [[1581, 1610], 256],
+ 64769: [[1580, 1609], 256],
+ 64770: [[1580, 1610], 256],
+ 64771: [[1582, 1609], 256],
+ 64772: [[1582, 1610], 256],
+ 64773: [[1589, 1609], 256],
+ 64774: [[1589, 1610], 256],
+ 64775: [[1590, 1609], 256],
+ 64776: [[1590, 1610], 256],
+ 64777: [[1588, 1580], 256],
+ 64778: [[1588, 1581], 256],
+ 64779: [[1588, 1582], 256],
+ 64780: [[1588, 1605], 256],
+ 64781: [[1588, 1585], 256],
+ 64782: [[1587, 1585], 256],
+ 64783: [[1589, 1585], 256],
+ 64784: [[1590, 1585], 256],
+ 64785: [[1591, 1609], 256],
+ 64786: [[1591, 1610], 256],
+ 64787: [[1593, 1609], 256],
+ 64788: [[1593, 1610], 256],
+ 64789: [[1594, 1609], 256],
+ 64790: [[1594, 1610], 256],
+ 64791: [[1587, 1609], 256],
+ 64792: [[1587, 1610], 256],
+ 64793: [[1588, 1609], 256],
+ 64794: [[1588, 1610], 256],
+ 64795: [[1581, 1609], 256],
+ 64796: [[1581, 1610], 256],
+ 64797: [[1580, 1609], 256],
+ 64798: [[1580, 1610], 256],
+ 64799: [[1582, 1609], 256],
+ 64800: [[1582, 1610], 256],
+ 64801: [[1589, 1609], 256],
+ 64802: [[1589, 1610], 256],
+ 64803: [[1590, 1609], 256],
+ 64804: [[1590, 1610], 256],
+ 64805: [[1588, 1580], 256],
+ 64806: [[1588, 1581], 256],
+ 64807: [[1588, 1582], 256],
+ 64808: [[1588, 1605], 256],
+ 64809: [[1588, 1585], 256],
+ 64810: [[1587, 1585], 256],
+ 64811: [[1589, 1585], 256],
+ 64812: [[1590, 1585], 256],
+ 64813: [[1588, 1580], 256],
+ 64814: [[1588, 1581], 256],
+ 64815: [[1588, 1582], 256],
+ 64816: [[1588, 1605], 256],
+ 64817: [[1587, 1607], 256],
+ 64818: [[1588, 1607], 256],
+ 64819: [[1591, 1605], 256],
+ 64820: [[1587, 1580], 256],
+ 64821: [[1587, 1581], 256],
+ 64822: [[1587, 1582], 256],
+ 64823: [[1588, 1580], 256],
+ 64824: [[1588, 1581], 256],
+ 64825: [[1588, 1582], 256],
+ 64826: [[1591, 1605], 256],
+ 64827: [[1592, 1605], 256],
+ 64828: [[1575, 1611], 256],
+ 64829: [[1575, 1611], 256],
+ 64848: [[1578, 1580, 1605], 256],
+ 64849: [[1578, 1581, 1580], 256],
+ 64850: [[1578, 1581, 1580], 256],
+ 64851: [[1578, 1581, 1605], 256],
+ 64852: [[1578, 1582, 1605], 256],
+ 64853: [[1578, 1605, 1580], 256],
+ 64854: [[1578, 1605, 1581], 256],
+ 64855: [[1578, 1605, 1582], 256],
+ 64856: [[1580, 1605, 1581], 256],
+ 64857: [[1580, 1605, 1581], 256],
+ 64858: [[1581, 1605, 1610], 256],
+ 64859: [[1581, 1605, 1609], 256],
+ 64860: [[1587, 1581, 1580], 256],
+ 64861: [[1587, 1580, 1581], 256],
+ 64862: [[1587, 1580, 1609], 256],
+ 64863: [[1587, 1605, 1581], 256],
+ 64864: [[1587, 1605, 1581], 256],
+ 64865: [[1587, 1605, 1580], 256],
+ 64866: [[1587, 1605, 1605], 256],
+ 64867: [[1587, 1605, 1605], 256],
+ 64868: [[1589, 1581, 1581], 256],
+ 64869: [[1589, 1581, 1581], 256],
+ 64870: [[1589, 1605, 1605], 256],
+ 64871: [[1588, 1581, 1605], 256],
+ 64872: [[1588, 1581, 1605], 256],
+ 64873: [[1588, 1580, 1610], 256],
+ 64874: [[1588, 1605, 1582], 256],
+ 64875: [[1588, 1605, 1582], 256],
+ 64876: [[1588, 1605, 1605], 256],
+ 64877: [[1588, 1605, 1605], 256],
+ 64878: [[1590, 1581, 1609], 256],
+ 64879: [[1590, 1582, 1605], 256],
+ 64880: [[1590, 1582, 1605], 256],
+ 64881: [[1591, 1605, 1581], 256],
+ 64882: [[1591, 1605, 1581], 256],
+ 64883: [[1591, 1605, 1605], 256],
+ 64884: [[1591, 1605, 1610], 256],
+ 64885: [[1593, 1580, 1605], 256],
+ 64886: [[1593, 1605, 1605], 256],
+ 64887: [[1593, 1605, 1605], 256],
+ 64888: [[1593, 1605, 1609], 256],
+ 64889: [[1594, 1605, 1605], 256],
+ 64890: [[1594, 1605, 1610], 256],
+ 64891: [[1594, 1605, 1609], 256],
+ 64892: [[1601, 1582, 1605], 256],
+ 64893: [[1601, 1582, 1605], 256],
+ 64894: [[1602, 1605, 1581], 256],
+ 64895: [[1602, 1605, 1605], 256],
+ 64896: [[1604, 1581, 1605], 256],
+ 64897: [[1604, 1581, 1610], 256],
+ 64898: [[1604, 1581, 1609], 256],
+ 64899: [[1604, 1580, 1580], 256],
+ 64900: [[1604, 1580, 1580], 256],
+ 64901: [[1604, 1582, 1605], 256],
+ 64902: [[1604, 1582, 1605], 256],
+ 64903: [[1604, 1605, 1581], 256],
+ 64904: [[1604, 1605, 1581], 256],
+ 64905: [[1605, 1581, 1580], 256],
+ 64906: [[1605, 1581, 1605], 256],
+ 64907: [[1605, 1581, 1610], 256],
+ 64908: [[1605, 1580, 1581], 256],
+ 64909: [[1605, 1580, 1605], 256],
+ 64910: [[1605, 1582, 1580], 256],
+ 64911: [[1605, 1582, 1605], 256],
+ 64914: [[1605, 1580, 1582], 256],
+ 64915: [[1607, 1605, 1580], 256],
+ 64916: [[1607, 1605, 1605], 256],
+ 64917: [[1606, 1581, 1605], 256],
+ 64918: [[1606, 1581, 1609], 256],
+ 64919: [[1606, 1580, 1605], 256],
+ 64920: [[1606, 1580, 1605], 256],
+ 64921: [[1606, 1580, 1609], 256],
+ 64922: [[1606, 1605, 1610], 256],
+ 64923: [[1606, 1605, 1609], 256],
+ 64924: [[1610, 1605, 1605], 256],
+ 64925: [[1610, 1605, 1605], 256],
+ 64926: [[1576, 1582, 1610], 256],
+ 64927: [[1578, 1580, 1610], 256],
+ 64928: [[1578, 1580, 1609], 256],
+ 64929: [[1578, 1582, 1610], 256],
+ 64930: [[1578, 1582, 1609], 256],
+ 64931: [[1578, 1605, 1610], 256],
+ 64932: [[1578, 1605, 1609], 256],
+ 64933: [[1580, 1605, 1610], 256],
+ 64934: [[1580, 1581, 1609], 256],
+ 64935: [[1580, 1605, 1609], 256],
+ 64936: [[1587, 1582, 1609], 256],
+ 64937: [[1589, 1581, 1610], 256],
+ 64938: [[1588, 1581, 1610], 256],
+ 64939: [[1590, 1581, 1610], 256],
+ 64940: [[1604, 1580, 1610], 256],
+ 64941: [[1604, 1605, 1610], 256],
+ 64942: [[1610, 1581, 1610], 256],
+ 64943: [[1610, 1580, 1610], 256],
+ 64944: [[1610, 1605, 1610], 256],
+ 64945: [[1605, 1605, 1610], 256],
+ 64946: [[1602, 1605, 1610], 256],
+ 64947: [[1606, 1581, 1610], 256],
+ 64948: [[1602, 1605, 1581], 256],
+ 64949: [[1604, 1581, 1605], 256],
+ 64950: [[1593, 1605, 1610], 256],
+ 64951: [[1603, 1605, 1610], 256],
+ 64952: [[1606, 1580, 1581], 256],
+ 64953: [[1605, 1582, 1610], 256],
+ 64954: [[1604, 1580, 1605], 256],
+ 64955: [[1603, 1605, 1605], 256],
+ 64956: [[1604, 1580, 1605], 256],
+ 64957: [[1606, 1580, 1581], 256],
+ 64958: [[1580, 1581, 1610], 256],
+ 64959: [[1581, 1580, 1610], 256],
+ 64960: [[1605, 1580, 1610], 256],
+ 64961: [[1601, 1605, 1610], 256],
+ 64962: [[1576, 1581, 1610], 256],
+ 64963: [[1603, 1605, 1605], 256],
+ 64964: [[1593, 1580, 1605], 256],
+ 64965: [[1589, 1605, 1605], 256],
+ 64966: [[1587, 1582, 1610], 256],
+ 64967: [[1606, 1580, 1610], 256],
+ 65008: [[1589, 1604, 1746], 256],
+ 65009: [[1602, 1604, 1746], 256],
+ 65010: [[1575, 1604, 1604, 1607], 256],
+ 65011: [[1575, 1603, 1576, 1585], 256],
+ 65012: [[1605, 1581, 1605, 1583], 256],
+ 65013: [[1589, 1604, 1593, 1605], 256],
+ 65014: [[1585, 1587, 1608, 1604], 256],
+ 65015: [[1593, 1604, 1610, 1607], 256],
+ 65016: [[1608, 1587, 1604, 1605], 256],
+ 65017: [[1589, 1604, 1609], 256],
+ 65018: [
+ [
+ 1589, 1604, 1609, 32, 1575, 1604, 1604, 1607, 32, 1593, 1604, 1610, 1607, 32, 1608,
+ 1587, 1604, 1605
+ ],
+ 256
+ ],
+ 65019: [[1580, 1604, 32, 1580, 1604, 1575, 1604, 1607], 256],
+ 65020: [[1585, 1740, 1575, 1604], 256]
+ },
+ 65024: {
+ 65040: [[44], 256],
+ 65041: [[12289], 256],
+ 65042: [[12290], 256],
+ 65043: [[58], 256],
+ 65044: [[59], 256],
+ 65045: [[33], 256],
+ 65046: [[63], 256],
+ 65047: [[12310], 256],
+ 65048: [[12311], 256],
+ 65049: [[8230], 256],
+ 65056: [, 230],
+ 65057: [, 230],
+ 65058: [, 230],
+ 65059: [, 230],
+ 65060: [, 230],
+ 65061: [, 230],
+ 65062: [, 230],
+ 65072: [[8229], 256],
+ 65073: [[8212], 256],
+ 65074: [[8211], 256],
+ 65075: [[95], 256],
+ 65076: [[95], 256],
+ 65077: [[40], 256],
+ 65078: [[41], 256],
+ 65079: [[123], 256],
+ 65080: [[125], 256],
+ 65081: [[12308], 256],
+ 65082: [[12309], 256],
+ 65083: [[12304], 256],
+ 65084: [[12305], 256],
+ 65085: [[12298], 256],
+ 65086: [[12299], 256],
+ 65087: [[12296], 256],
+ 65088: [[12297], 256],
+ 65089: [[12300], 256],
+ 65090: [[12301], 256],
+ 65091: [[12302], 256],
+ 65092: [[12303], 256],
+ 65095: [[91], 256],
+ 65096: [[93], 256],
+ 65097: [[8254], 256],
+ 65098: [[8254], 256],
+ 65099: [[8254], 256],
+ 65100: [[8254], 256],
+ 65101: [[95], 256],
+ 65102: [[95], 256],
+ 65103: [[95], 256],
+ 65104: [[44], 256],
+ 65105: [[12289], 256],
+ 65106: [[46], 256],
+ 65108: [[59], 256],
+ 65109: [[58], 256],
+ 65110: [[63], 256],
+ 65111: [[33], 256],
+ 65112: [[8212], 256],
+ 65113: [[40], 256],
+ 65114: [[41], 256],
+ 65115: [[123], 256],
+ 65116: [[125], 256],
+ 65117: [[12308], 256],
+ 65118: [[12309], 256],
+ 65119: [[35], 256],
+ 65120: [[38], 256],
+ 65121: [[42], 256],
+ 65122: [[43], 256],
+ 65123: [[45], 256],
+ 65124: [[60], 256],
+ 65125: [[62], 256],
+ 65126: [[61], 256],
+ 65128: [[92], 256],
+ 65129: [[36], 256],
+ 65130: [[37], 256],
+ 65131: [[64], 256],
+ 65136: [[32, 1611], 256],
+ 65137: [[1600, 1611], 256],
+ 65138: [[32, 1612], 256],
+ 65140: [[32, 1613], 256],
+ 65142: [[32, 1614], 256],
+ 65143: [[1600, 1614], 256],
+ 65144: [[32, 1615], 256],
+ 65145: [[1600, 1615], 256],
+ 65146: [[32, 1616], 256],
+ 65147: [[1600, 1616], 256],
+ 65148: [[32, 1617], 256],
+ 65149: [[1600, 1617], 256],
+ 65150: [[32, 1618], 256],
+ 65151: [[1600, 1618], 256],
+ 65152: [[1569], 256],
+ 65153: [[1570], 256],
+ 65154: [[1570], 256],
+ 65155: [[1571], 256],
+ 65156: [[1571], 256],
+ 65157: [[1572], 256],
+ 65158: [[1572], 256],
+ 65159: [[1573], 256],
+ 65160: [[1573], 256],
+ 65161: [[1574], 256],
+ 65162: [[1574], 256],
+ 65163: [[1574], 256],
+ 65164: [[1574], 256],
+ 65165: [[1575], 256],
+ 65166: [[1575], 256],
+ 65167: [[1576], 256],
+ 65168: [[1576], 256],
+ 65169: [[1576], 256],
+ 65170: [[1576], 256],
+ 65171: [[1577], 256],
+ 65172: [[1577], 256],
+ 65173: [[1578], 256],
+ 65174: [[1578], 256],
+ 65175: [[1578], 256],
+ 65176: [[1578], 256],
+ 65177: [[1579], 256],
+ 65178: [[1579], 256],
+ 65179: [[1579], 256],
+ 65180: [[1579], 256],
+ 65181: [[1580], 256],
+ 65182: [[1580], 256],
+ 65183: [[1580], 256],
+ 65184: [[1580], 256],
+ 65185: [[1581], 256],
+ 65186: [[1581], 256],
+ 65187: [[1581], 256],
+ 65188: [[1581], 256],
+ 65189: [[1582], 256],
+ 65190: [[1582], 256],
+ 65191: [[1582], 256],
+ 65192: [[1582], 256],
+ 65193: [[1583], 256],
+ 65194: [[1583], 256],
+ 65195: [[1584], 256],
+ 65196: [[1584], 256],
+ 65197: [[1585], 256],
+ 65198: [[1585], 256],
+ 65199: [[1586], 256],
+ 65200: [[1586], 256],
+ 65201: [[1587], 256],
+ 65202: [[1587], 256],
+ 65203: [[1587], 256],
+ 65204: [[1587], 256],
+ 65205: [[1588], 256],
+ 65206: [[1588], 256],
+ 65207: [[1588], 256],
+ 65208: [[1588], 256],
+ 65209: [[1589], 256],
+ 65210: [[1589], 256],
+ 65211: [[1589], 256],
+ 65212: [[1589], 256],
+ 65213: [[1590], 256],
+ 65214: [[1590], 256],
+ 65215: [[1590], 256],
+ 65216: [[1590], 256],
+ 65217: [[1591], 256],
+ 65218: [[1591], 256],
+ 65219: [[1591], 256],
+ 65220: [[1591], 256],
+ 65221: [[1592], 256],
+ 65222: [[1592], 256],
+ 65223: [[1592], 256],
+ 65224: [[1592], 256],
+ 65225: [[1593], 256],
+ 65226: [[1593], 256],
+ 65227: [[1593], 256],
+ 65228: [[1593], 256],
+ 65229: [[1594], 256],
+ 65230: [[1594], 256],
+ 65231: [[1594], 256],
+ 65232: [[1594], 256],
+ 65233: [[1601], 256],
+ 65234: [[1601], 256],
+ 65235: [[1601], 256],
+ 65236: [[1601], 256],
+ 65237: [[1602], 256],
+ 65238: [[1602], 256],
+ 65239: [[1602], 256],
+ 65240: [[1602], 256],
+ 65241: [[1603], 256],
+ 65242: [[1603], 256],
+ 65243: [[1603], 256],
+ 65244: [[1603], 256],
+ 65245: [[1604], 256],
+ 65246: [[1604], 256],
+ 65247: [[1604], 256],
+ 65248: [[1604], 256],
+ 65249: [[1605], 256],
+ 65250: [[1605], 256],
+ 65251: [[1605], 256],
+ 65252: [[1605], 256],
+ 65253: [[1606], 256],
+ 65254: [[1606], 256],
+ 65255: [[1606], 256],
+ 65256: [[1606], 256],
+ 65257: [[1607], 256],
+ 65258: [[1607], 256],
+ 65259: [[1607], 256],
+ 65260: [[1607], 256],
+ 65261: [[1608], 256],
+ 65262: [[1608], 256],
+ 65263: [[1609], 256],
+ 65264: [[1609], 256],
+ 65265: [[1610], 256],
+ 65266: [[1610], 256],
+ 65267: [[1610], 256],
+ 65268: [[1610], 256],
+ 65269: [[1604, 1570], 256],
+ 65270: [[1604, 1570], 256],
+ 65271: [[1604, 1571], 256],
+ 65272: [[1604, 1571], 256],
+ 65273: [[1604, 1573], 256],
+ 65274: [[1604, 1573], 256],
+ 65275: [[1604, 1575], 256],
+ 65276: [[1604, 1575], 256]
+ },
+ 65280: {
+ 65281: [[33], 256],
+ 65282: [[34], 256],
+ 65283: [[35], 256],
+ 65284: [[36], 256],
+ 65285: [[37], 256],
+ 65286: [[38], 256],
+ 65287: [[39], 256],
+ 65288: [[40], 256],
+ 65289: [[41], 256],
+ 65290: [[42], 256],
+ 65291: [[43], 256],
+ 65292: [[44], 256],
+ 65293: [[45], 256],
+ 65294: [[46], 256],
+ 65295: [[47], 256],
+ 65296: [[48], 256],
+ 65297: [[49], 256],
+ 65298: [[50], 256],
+ 65299: [[51], 256],
+ 65300: [[52], 256],
+ 65301: [[53], 256],
+ 65302: [[54], 256],
+ 65303: [[55], 256],
+ 65304: [[56], 256],
+ 65305: [[57], 256],
+ 65306: [[58], 256],
+ 65307: [[59], 256],
+ 65308: [[60], 256],
+ 65309: [[61], 256],
+ 65310: [[62], 256],
+ 65311: [[63], 256],
+ 65312: [[64], 256],
+ 65313: [[65], 256],
+ 65314: [[66], 256],
+ 65315: [[67], 256],
+ 65316: [[68], 256],
+ 65317: [[69], 256],
+ 65318: [[70], 256],
+ 65319: [[71], 256],
+ 65320: [[72], 256],
+ 65321: [[73], 256],
+ 65322: [[74], 256],
+ 65323: [[75], 256],
+ 65324: [[76], 256],
+ 65325: [[77], 256],
+ 65326: [[78], 256],
+ 65327: [[79], 256],
+ 65328: [[80], 256],
+ 65329: [[81], 256],
+ 65330: [[82], 256],
+ 65331: [[83], 256],
+ 65332: [[84], 256],
+ 65333: [[85], 256],
+ 65334: [[86], 256],
+ 65335: [[87], 256],
+ 65336: [[88], 256],
+ 65337: [[89], 256],
+ 65338: [[90], 256],
+ 65339: [[91], 256],
+ 65340: [[92], 256],
+ 65341: [[93], 256],
+ 65342: [[94], 256],
+ 65343: [[95], 256],
+ 65344: [[96], 256],
+ 65345: [[97], 256],
+ 65346: [[98], 256],
+ 65347: [[99], 256],
+ 65348: [[100], 256],
+ 65349: [[101], 256],
+ 65350: [[102], 256],
+ 65351: [[103], 256],
+ 65352: [[104], 256],
+ 65353: [[105], 256],
+ 65354: [[106], 256],
+ 65355: [[107], 256],
+ 65356: [[108], 256],
+ 65357: [[109], 256],
+ 65358: [[110], 256],
+ 65359: [[111], 256],
+ 65360: [[112], 256],
+ 65361: [[113], 256],
+ 65362: [[114], 256],
+ 65363: [[115], 256],
+ 65364: [[116], 256],
+ 65365: [[117], 256],
+ 65366: [[118], 256],
+ 65367: [[119], 256],
+ 65368: [[120], 256],
+ 65369: [[121], 256],
+ 65370: [[122], 256],
+ 65371: [[123], 256],
+ 65372: [[124], 256],
+ 65373: [[125], 256],
+ 65374: [[126], 256],
+ 65375: [[10629], 256],
+ 65376: [[10630], 256],
+ 65377: [[12290], 256],
+ 65378: [[12300], 256],
+ 65379: [[12301], 256],
+ 65380: [[12289], 256],
+ 65381: [[12539], 256],
+ 65382: [[12530], 256],
+ 65383: [[12449], 256],
+ 65384: [[12451], 256],
+ 65385: [[12453], 256],
+ 65386: [[12455], 256],
+ 65387: [[12457], 256],
+ 65388: [[12515], 256],
+ 65389: [[12517], 256],
+ 65390: [[12519], 256],
+ 65391: [[12483], 256],
+ 65392: [[12540], 256],
+ 65393: [[12450], 256],
+ 65394: [[12452], 256],
+ 65395: [[12454], 256],
+ 65396: [[12456], 256],
+ 65397: [[12458], 256],
+ 65398: [[12459], 256],
+ 65399: [[12461], 256],
+ 65400: [[12463], 256],
+ 65401: [[12465], 256],
+ 65402: [[12467], 256],
+ 65403: [[12469], 256],
+ 65404: [[12471], 256],
+ 65405: [[12473], 256],
+ 65406: [[12475], 256],
+ 65407: [[12477], 256],
+ 65408: [[12479], 256],
+ 65409: [[12481], 256],
+ 65410: [[12484], 256],
+ 65411: [[12486], 256],
+ 65412: [[12488], 256],
+ 65413: [[12490], 256],
+ 65414: [[12491], 256],
+ 65415: [[12492], 256],
+ 65416: [[12493], 256],
+ 65417: [[12494], 256],
+ 65418: [[12495], 256],
+ 65419: [[12498], 256],
+ 65420: [[12501], 256],
+ 65421: [[12504], 256],
+ 65422: [[12507], 256],
+ 65423: [[12510], 256],
+ 65424: [[12511], 256],
+ 65425: [[12512], 256],
+ 65426: [[12513], 256],
+ 65427: [[12514], 256],
+ 65428: [[12516], 256],
+ 65429: [[12518], 256],
+ 65430: [[12520], 256],
+ 65431: [[12521], 256],
+ 65432: [[12522], 256],
+ 65433: [[12523], 256],
+ 65434: [[12524], 256],
+ 65435: [[12525], 256],
+ 65436: [[12527], 256],
+ 65437: [[12531], 256],
+ 65438: [[12441], 256],
+ 65439: [[12442], 256],
+ 65440: [[12644], 256],
+ 65441: [[12593], 256],
+ 65442: [[12594], 256],
+ 65443: [[12595], 256],
+ 65444: [[12596], 256],
+ 65445: [[12597], 256],
+ 65446: [[12598], 256],
+ 65447: [[12599], 256],
+ 65448: [[12600], 256],
+ 65449: [[12601], 256],
+ 65450: [[12602], 256],
+ 65451: [[12603], 256],
+ 65452: [[12604], 256],
+ 65453: [[12605], 256],
+ 65454: [[12606], 256],
+ 65455: [[12607], 256],
+ 65456: [[12608], 256],
+ 65457: [[12609], 256],
+ 65458: [[12610], 256],
+ 65459: [[12611], 256],
+ 65460: [[12612], 256],
+ 65461: [[12613], 256],
+ 65462: [[12614], 256],
+ 65463: [[12615], 256],
+ 65464: [[12616], 256],
+ 65465: [[12617], 256],
+ 65466: [[12618], 256],
+ 65467: [[12619], 256],
+ 65468: [[12620], 256],
+ 65469: [[12621], 256],
+ 65470: [[12622], 256],
+ 65474: [[12623], 256],
+ 65475: [[12624], 256],
+ 65476: [[12625], 256],
+ 65477: [[12626], 256],
+ 65478: [[12627], 256],
+ 65479: [[12628], 256],
+ 65482: [[12629], 256],
+ 65483: [[12630], 256],
+ 65484: [[12631], 256],
+ 65485: [[12632], 256],
+ 65486: [[12633], 256],
+ 65487: [[12634], 256],
+ 65490: [[12635], 256],
+ 65491: [[12636], 256],
+ 65492: [[12637], 256],
+ 65493: [[12638], 256],
+ 65494: [[12639], 256],
+ 65495: [[12640], 256],
+ 65498: [[12641], 256],
+ 65499: [[12642], 256],
+ 65500: [[12643], 256],
+ 65504: [[162], 256],
+ 65505: [[163], 256],
+ 65506: [[172], 256],
+ 65507: [[175], 256],
+ 65508: [[166], 256],
+ 65509: [[165], 256],
+ 65510: [[8361], 256],
+ 65512: [[9474], 256],
+ 65513: [[8592], 256],
+ 65514: [[8593], 256],
+ 65515: [[8594], 256],
+ 65516: [[8595], 256],
+ 65517: [[9632], 256],
+ 65518: [[9675], 256]
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/normalize/implement.js b/Nodejs/node_modules/es5-ext/string/#/normalize/implement.js
new file mode 100644
index 0000000..deb6089
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/normalize/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String.prototype, "normalize", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/#/normalize/index.js b/Nodejs/node_modules/es5-ext/string/#/normalize/index.js
new file mode 100644
index 0000000..a8c04db
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/normalize/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.prototype.normalize : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/#/normalize/is-implemented.js b/Nodejs/node_modules/es5-ext/string/#/normalize/is-implemented.js
new file mode 100644
index 0000000..01b48a9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/normalize/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var str = "æøåäüö";
+
+module.exports = function () {
+ if (typeof str.normalize !== "function") return false;
+ return str.normalize("NFKD") === "æøåäüö";
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/normalize/shim.js b/Nodejs/node_modules/es5-ext/string/#/normalize/shim.js
new file mode 100644
index 0000000..95bae26
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/normalize/shim.js
@@ -0,0 +1,309 @@
+/* eslint no-bitwise: "off", max-statements: "off", max-lines: "off" */
+
+// Taken from: https://github.com/walling/unorm/blob/master/lib/unorm.js
+
+/*
+ * UnicodeNormalizer 1.0.0
+ * Copyright (c) 2008 Matsuza
+ * Dual licensed under the MIT (MIT-LICENSE.txt) and
+ * GPL (GPL-LICENSE.txt) licenses.
+ * $Date: 2008-06-05 16:44:17 +0200 (Thu, 05 Jun 2008) $
+ * $Rev: 13309 $
+ */
+
+"use strict";
+
+var primitiveSet = require("../../../object/primitive-set")
+ , validValue = require("../../../object/valid-value")
+ , data = require("./_data");
+
+var floor = Math.floor
+ , forms = primitiveSet("NFC", "NFD", "NFKC", "NFKD")
+ , DEFAULT_FEATURE = [null, 0, {}]
+ , CACHE_THRESHOLD = 10
+ , SBase = 0xac00
+ , LBase = 0x1100
+ , VBase = 0x1161
+ , TBase = 0x11a7
+ , LCount = 19
+ , VCount = 21
+ , TCount = 28
+ , NCount = VCount * TCount
+ , SCount = LCount * NCount
+ , UChar
+ , cache = {}
+ , cacheCounter = []
+ , fromCache
+ , fromData
+ , fromCpOnly
+ , fromRuleBasedJamo
+ , fromCpFilter
+ , strategies
+ , UCharIterator
+ , RecursDecompIterator
+ , DecompIterator
+ , CompIterator
+ , createIterator
+ , normalize;
+
+UChar = function (cp, feature) {
+ this.codepoint = cp;
+ this.feature = feature;
+};
+
+// Strategies
+(function () { for (var i = 0; i <= 0xff; ++i) cacheCounter[i] = 0; })();
+
+fromCache = function (nextStep, cp, needFeature) {
+ var ret = cache[cp];
+ if (!ret) {
+ ret = nextStep(cp, needFeature);
+ if (Boolean(ret.feature) && ++cacheCounter[(cp >> 8) & 0xff] > CACHE_THRESHOLD) {
+ cache[cp] = ret;
+ }
+ }
+ return ret;
+};
+
+fromData = function (next, cp) {
+ var hash = cp & 0xff00, dunit = UChar.udata[hash] || {}, feature = dunit[cp];
+ return feature ? new UChar(cp, feature) : new UChar(cp, DEFAULT_FEATURE);
+};
+fromCpOnly = function (next, cp, needFeature) {
+ return needFeature ? next(cp, needFeature) : new UChar(cp, null);
+};
+
+fromRuleBasedJamo = function (next, cp, needFeature) {
+ var char, base, i, arr, SIndex, TIndex, feature, j;
+ if (cp < LBase || (LBase + LCount <= cp && cp < SBase) || SBase + SCount < cp) {
+ return next(cp, needFeature);
+ }
+ if (LBase <= cp && cp < LBase + LCount) {
+ char = {};
+ base = (cp - LBase) * VCount;
+ for (i = 0; i < VCount; ++i) {
+ char[VBase + i] = SBase + TCount * (i + base);
+ }
+ arr = new Array(3);
+ arr[2] = char;
+ return new UChar(cp, arr);
+ }
+
+ SIndex = cp - SBase;
+ TIndex = SIndex % TCount;
+ feature = [];
+ if (TIndex === 0) {
+ feature[0] = [LBase + floor(SIndex / NCount), VBase + floor((SIndex % NCount) / TCount)];
+ feature[2] = {};
+ for (j = 1; j < TCount; ++j) {
+ feature[2][TBase + j] = cp + j;
+ }
+ } else {
+ feature[0] = [SBase + SIndex - TIndex, TBase + TIndex];
+ }
+ return new UChar(cp, feature);
+};
+
+fromCpFilter = function (next, cp, needFeature) {
+ return cp < 60 || (cp > 13311 && cp < 42607)
+ ? new UChar(cp, DEFAULT_FEATURE)
+ : next(cp, needFeature);
+};
+
+strategies = [fromCpFilter, fromCache, fromCpOnly, fromRuleBasedJamo, fromData];
+
+UChar.fromCharCode = strategies.reduceRight(function (next, strategy) {
+ return function (cp, needFeature) { return strategy(next, cp, needFeature); };
+}, null);
+
+UChar.isHighSurrogate = function (cp) { return cp >= 0xd800 && cp <= 0xdbff; };
+UChar.isLowSurrogate = function (cp) { return cp >= 0xdc00 && cp <= 0xdfff; };
+
+UChar.prototype.prepFeature = function () {
+ if (!this.feature) {
+ this.feature = UChar.fromCharCode(this.codepoint, true).feature;
+ }
+};
+
+UChar.prototype.toString = function () {
+ var num;
+ if (this.codepoint < 0x10000) return String.fromCharCode(this.codepoint);
+ num = this.codepoint - 0x10000;
+ return String.fromCharCode(floor(num / 0x400) + 0xd800, (num % 0x400) + 0xdc00);
+};
+
+UChar.prototype.getDecomp = function () {
+ this.prepFeature();
+ return this.feature[0] || null;
+};
+
+UChar.prototype.isCompatibility = function () {
+ this.prepFeature();
+ return Boolean(this.feature[1]) && this.feature[1] & (1 << 8);
+};
+UChar.prototype.isExclude = function () {
+ this.prepFeature();
+ return Boolean(this.feature[1]) && this.feature[1] & (1 << 9);
+};
+UChar.prototype.getCanonicalClass = function () {
+ this.prepFeature();
+ return this.feature[1] ? this.feature[1] & 0xff : 0;
+};
+UChar.prototype.getComposite = function (following) {
+ var cp;
+ this.prepFeature();
+ if (!this.feature[2]) return null;
+ cp = this.feature[2][following.codepoint];
+ return cp ? UChar.fromCharCode(cp) : null;
+};
+
+UCharIterator = function (str) {
+ this.str = str;
+ this.cursor = 0;
+};
+UCharIterator.prototype.next = function () {
+ if (Boolean(this.str) && this.cursor < this.str.length) {
+ var cp = this.str.charCodeAt(this.cursor++), d;
+ if (
+ UChar.isHighSurrogate(cp) &&
+ this.cursor < this.str.length &&
+ UChar.isLowSurrogate((d = this.str.charCodeAt(this.cursor)))
+ ) {
+ cp = (cp - 0xd800) * 0x400 + (d - 0xdc00) + 0x10000;
+ ++this.cursor;
+ }
+ return UChar.fromCharCode(cp);
+ }
+ this.str = null;
+ return null;
+};
+
+RecursDecompIterator = function (it, cano) {
+ this.it = it;
+ this.canonical = cano;
+ this.resBuf = [];
+};
+
+RecursDecompIterator.prototype.next = function () {
+ var recursiveDecomp, uchar;
+ recursiveDecomp = function (cano, ucharLoc) {
+ var decomp = ucharLoc.getDecomp(), ret, i, a, j;
+ if (Boolean(decomp) && !(cano && ucharLoc.isCompatibility())) {
+ ret = [];
+ for (i = 0; i < decomp.length; ++i) {
+ a = recursiveDecomp(cano, UChar.fromCharCode(decomp[i]));
+ // Ret.concat(a); //<-why does not this work?
+ // following block is a workaround.
+ for (j = 0; j < a.length; ++j) ret.push(a[j]);
+ }
+ return ret;
+ }
+ return [ucharLoc];
+ };
+ if (this.resBuf.length === 0) {
+ uchar = this.it.next();
+ if (!uchar) return null;
+ this.resBuf = recursiveDecomp(this.canonical, uchar);
+ }
+ return this.resBuf.shift();
+};
+
+DecompIterator = function (it) {
+ this.it = it;
+ this.resBuf = [];
+};
+
+DecompIterator.prototype.next = function () {
+ var cc, uchar, inspt, uchar2, cc2;
+ if (this.resBuf.length === 0) {
+ do {
+ uchar = this.it.next();
+ if (!uchar) break;
+ cc = uchar.getCanonicalClass();
+ inspt = this.resBuf.length;
+ if (cc !== 0) {
+ for (inspt; inspt > 0; --inspt) {
+ uchar2 = this.resBuf[inspt - 1];
+ cc2 = uchar2.getCanonicalClass();
+ // eslint-disable-next-line max-depth
+ if (cc2 <= cc) break;
+ }
+ }
+ this.resBuf.splice(inspt, 0, uchar);
+ } while (cc !== 0);
+ }
+ return this.resBuf.shift();
+};
+
+CompIterator = function (it) {
+ this.it = it;
+ this.procBuf = [];
+ this.resBuf = [];
+ this.lastClass = null;
+};
+
+CompIterator.prototype.next = function () {
+ var uchar, starter, composite, cc;
+ while (this.resBuf.length === 0) {
+ uchar = this.it.next();
+ if (!uchar) {
+ this.resBuf = this.procBuf;
+ this.procBuf = [];
+ break;
+ }
+ if (this.procBuf.length === 0) {
+ this.lastClass = uchar.getCanonicalClass();
+ this.procBuf.push(uchar);
+ } else {
+ starter = this.procBuf[0];
+ composite = starter.getComposite(uchar);
+ cc = uchar.getCanonicalClass();
+ if (Boolean(composite) && (this.lastClass < cc || this.lastClass === 0)) {
+ this.procBuf[0] = composite;
+ } else {
+ if (cc === 0) {
+ this.resBuf = this.procBuf;
+ this.procBuf = [];
+ }
+ this.lastClass = cc;
+ this.procBuf.push(uchar);
+ }
+ }
+ }
+ return this.resBuf.shift();
+};
+
+createIterator = function (mode, str) {
+ switch (mode) {
+ case "NFD":
+ return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true));
+ case "NFKD":
+ return new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false));
+ case "NFC":
+ return new CompIterator(
+ new DecompIterator(new RecursDecompIterator(new UCharIterator(str), true))
+ );
+ case "NFKC":
+ return new CompIterator(
+ new DecompIterator(new RecursDecompIterator(new UCharIterator(str), false))
+ );
+ default:
+ throw new Error(mode + " is invalid");
+ }
+};
+normalize = function (mode, str) {
+ var it = createIterator(mode, str), ret = "", uchar;
+ while ((uchar = it.next())) ret += uchar.toString();
+ return ret;
+};
+
+/* Unicode data */
+UChar.udata = data;
+
+module.exports = function (/* Form*/) {
+ var str = String(validValue(this)), form = arguments[0];
+ if (form === undefined) form = "NFC";
+ else form = String(form);
+ if (!forms[form]) throw new RangeError("Invalid normalization form: " + form);
+ return normalize(form, str);
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/pad.js b/Nodejs/node_modules/es5-ext/string/#/pad.js
new file mode 100644
index 0000000..113a873
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/pad.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var toInteger = require("../../number/to-integer")
+ , value = require("../../object/valid-value")
+ , repeat = require("./repeat")
+ , abs = Math.abs
+ , max = Math.max;
+
+module.exports = function (fill/*, length*/) {
+ var self = String(value(this)), sLength = self.length, length = arguments[1];
+
+ length = isNaN(length) ? 1 : toInteger(length);
+ fill = repeat.call(String(fill), abs(length));
+ if (length >= 0) return fill.slice(0, max(0, length - sLength)) + self;
+ return self + (sLength + length >= 0 ? "" : fill.slice(length + sLength));
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/plain-replace-all.js b/Nodejs/node_modules/es5-ext/string/#/plain-replace-all.js
new file mode 100644
index 0000000..9334fe0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/plain-replace-all.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var value = require("../../object/valid-value");
+
+module.exports = function (search, replace) {
+ var index, pos = 0, str = String(value(this)), sl, rl;
+ search = String(search);
+ replace = String(replace);
+ sl = search.length;
+ rl = replace.length;
+ while ((index = str.indexOf(search, pos)) !== -1) {
+ str = str.slice(0, index) + replace + str.slice(index + sl);
+ pos = index + rl;
+ }
+ return str;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/plain-replace.js b/Nodejs/node_modules/es5-ext/string/#/plain-replace.js
new file mode 100644
index 0000000..b8bfe3d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/plain-replace.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var indexOf = String.prototype.indexOf, slice = String.prototype.slice;
+
+module.exports = function (search, replace) {
+ var index = indexOf.call(this, search);
+ if (index === -1) return String(this);
+ return slice.call(this, 0, index) + replace + slice.call(this, index + String(search).length);
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/repeat/implement.js b/Nodejs/node_modules/es5-ext/string/#/repeat/implement.js
new file mode 100644
index 0000000..f237dcd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/repeat/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String.prototype, "repeat", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/#/repeat/index.js b/Nodejs/node_modules/es5-ext/string/#/repeat/index.js
new file mode 100644
index 0000000..abcb601
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/repeat/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.prototype.repeat : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/#/repeat/is-implemented.js b/Nodejs/node_modules/es5-ext/string/#/repeat/is-implemented.js
new file mode 100644
index 0000000..e8e0240
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/repeat/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var str = "foo";
+
+module.exports = function () {
+ if (typeof str.repeat !== "function") return false;
+ return str.repeat(2) === "foofoo";
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/repeat/shim.js b/Nodejs/node_modules/es5-ext/string/#/repeat/shim.js
new file mode 100644
index 0000000..ac259a8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/repeat/shim.js
@@ -0,0 +1,24 @@
+// Thanks
+// @rauchma http://www.2ality.com/2014/01/efficient-string-repeat.html
+// @mathiasbynens https://github.com/mathiasbynens/String.prototype.repeat/blob/4a4b567def/repeat.js
+
+"use strict";
+
+var value = require("../../../object/valid-value")
+ , toInteger = require("../../../number/to-integer");
+
+module.exports = function (count) {
+ var str = String(value(this)), result;
+ count = toInteger(count);
+ if (count < 0) throw new RangeError("Count must be >= 0");
+ if (!isFinite(count)) throw new RangeError("Count must be < ∞");
+
+ result = "";
+ while (count) {
+ if (count % 2) result += str;
+ if (count > 1) str += str;
+ // eslint-disable-next-line no-bitwise
+ count >>= 1;
+ }
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/starts-with/implement.js b/Nodejs/node_modules/es5-ext/string/#/starts-with/implement.js
new file mode 100644
index 0000000..62abadb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/starts-with/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String.prototype, "startsWith", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/#/starts-with/index.js b/Nodejs/node_modules/es5-ext/string/#/starts-with/index.js
new file mode 100644
index 0000000..a0a368f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/starts-with/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.prototype.startsWith : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/#/starts-with/is-implemented.js b/Nodejs/node_modules/es5-ext/string/#/starts-with/is-implemented.js
new file mode 100644
index 0000000..d1241bc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/starts-with/is-implemented.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var str = "razdwatrzy";
+
+module.exports = function () {
+ if (typeof str.startsWith !== "function") return false;
+ return str.startsWith("trzy") === false && str.startsWith("raz") === true;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/starts-with/shim.js b/Nodejs/node_modules/es5-ext/string/#/starts-with/shim.js
new file mode 100644
index 0000000..053c885
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/starts-with/shim.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var value = require("../../../object/valid-value")
+ , toInteger = require("../../../number/to-integer")
+ , max = Math.max
+ , min = Math.min;
+
+module.exports = function (searchString/*, position*/) {
+ var start, self = String(value(this));
+ start = min(max(toInteger(arguments[1]), 0), self.length);
+ return self.indexOf(searchString, start) === start;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/#/uncapitalize.js b/Nodejs/node_modules/es5-ext/string/#/uncapitalize.js
new file mode 100644
index 0000000..202dbb7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/#/uncapitalize.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var ensureStringifiable = require("../../object/validate-stringifiable-value");
+
+module.exports = function () {
+ var str = ensureStringifiable(this);
+ return str.charAt(0).toLowerCase() + str.slice(1);
+};
diff --git a/Nodejs/node_modules/es5-ext/string/format-method.js b/Nodejs/node_modules/es5-ext/string/format-method.js
new file mode 100644
index 0000000..28956fe
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/format-method.js
@@ -0,0 +1,27 @@
+"use strict";
+
+var isCallable = require("../object/is-callable")
+ , value = require("../object/valid-value")
+ , call = Function.prototype.call;
+
+module.exports = function (fmap) {
+ fmap = Object(value(fmap));
+ return function (pattern) {
+ var context = this;
+ value(context);
+ pattern = String(pattern);
+ return pattern.replace(/%([a-zA-Z]+)|\\([\u0000-\uffff])/g, function (
+ match,
+ token,
+ escapeChar
+ ) {
+ var t, result;
+ if (escapeChar) return escapeChar;
+ t = token;
+ while (t && !(result = fmap[t])) t = t.slice(0, -1);
+ if (!result) return match;
+ if (isCallable(result)) result = call.call(result, context);
+ return result + token.slice(t.length);
+ });
+ };
+};
diff --git a/Nodejs/node_modules/es5-ext/string/from-code-point/implement.js b/Nodejs/node_modules/es5-ext/string/from-code-point/implement.js
new file mode 100644
index 0000000..71728bf
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/from-code-point/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String, "fromCodePoint", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/from-code-point/index.js b/Nodejs/node_modules/es5-ext/string/from-code-point/index.js
new file mode 100644
index 0000000..5a5fc5b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/from-code-point/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.fromCodePoint : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/from-code-point/is-implemented.js b/Nodejs/node_modules/es5-ext/string/from-code-point/is-implemented.js
new file mode 100644
index 0000000..ae4b818
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/from-code-point/is-implemented.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function () {
+ var fromCodePoint = String.fromCodePoint;
+ if (typeof fromCodePoint !== "function") return false;
+ return fromCodePoint(0x1d306, 0x61, 0x1d307) === "\ud834\udf06a\ud834\udf07";
+};
diff --git a/Nodejs/node_modules/es5-ext/string/from-code-point/shim.js b/Nodejs/node_modules/es5-ext/string/from-code-point/shim.js
new file mode 100644
index 0000000..c2f1c3a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/from-code-point/shim.js
@@ -0,0 +1,37 @@
+// Based on:
+// http://norbertlindenberg.com/2012/05/ecmascript-supplementary-characters/
+// and:
+// https://github.com/mathiasbynens/String.fromCodePoint/blob/master
+// /fromcodepoint.js
+
+"use strict";
+
+var floor = Math.floor, fromCharCode = String.fromCharCode;
+
+// eslint-disable-next-line no-unused-vars
+module.exports = function (codePoint1/*, …codePoints*/) {
+ var chars = [], length = arguments.length, i, codePoint, result = "";
+ for (i = 0; i < length; ++i) {
+ codePoint = Number(arguments[i]);
+ if (
+ !isFinite(codePoint) ||
+ codePoint < 0 ||
+ codePoint > 0x10ffff ||
+ floor(codePoint) !== codePoint
+ ) {
+ throw new RangeError("Invalid code point " + codePoint);
+ }
+
+ if (codePoint < 0x10000) {
+ chars.push(codePoint);
+ } else {
+ codePoint -= 0x10000;
+ // eslint-disable-next-line no-bitwise
+ chars.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);
+ }
+ if (i + 1 !== length && chars.length <= 0x4000) continue;
+ result += fromCharCode.apply(null, chars);
+ chars.length = 0;
+ }
+ return result;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/index.js b/Nodejs/node_modules/es5-ext/string/index.js
new file mode 100644
index 0000000..4393588
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/index.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = {
+ "#": require("./#"),
+ "formatMethod": require("./format-method"),
+ "fromCodePoint": require("./from-code-point"),
+ "isString": require("./is-string"),
+ "random": require("./random"),
+ "randomUniq": require("./random-uniq"),
+ "raw": require("./raw")
+};
diff --git a/Nodejs/node_modules/es5-ext/string/is-string.js b/Nodejs/node_modules/es5-ext/string/is-string.js
new file mode 100644
index 0000000..1b1e863
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/is-string.js
@@ -0,0 +1,13 @@
+"use strict";
+
+var objToString = Object.prototype.toString, id = objToString.call("");
+
+module.exports = function (value) {
+ return (
+ typeof value === "string" ||
+ (value &&
+ typeof value === "object" &&
+ (value instanceof String || objToString.call(value) === id)) ||
+ false
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/string/random-uniq.js b/Nodejs/node_modules/es5-ext/string/random-uniq.js
new file mode 100644
index 0000000..ae57b29
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/random-uniq.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var generated = Object.create(null), random = Math.random;
+
+module.exports = function () {
+ var str;
+ do {
+ str = random().toString(36).slice(2);
+ } while (generated[str]);
+ return str;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/random.js b/Nodejs/node_modules/es5-ext/string/random.js
new file mode 100644
index 0000000..8fda5de
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/random.js
@@ -0,0 +1,38 @@
+"use strict";
+
+var isValue = require("../object/is-value")
+ , toNaturalNumber = require("../number/to-pos-integer");
+
+var generated = Object.create(null), random = Math.random, uniqTryLimit = 100;
+
+var getChunk = function () { return random().toString(36).slice(2); };
+
+var getString = function (/* length */) {
+ var str = getChunk(), length = arguments[0];
+ if (!isValue(length)) return str;
+ while (str.length < length) str += getChunk();
+ return str.slice(0, length);
+};
+
+module.exports = function (/* options */) {
+ var options = Object(arguments[0]), length = options.length, isUnique = options.isUnique;
+
+ if (isValue(length)) length = toNaturalNumber(length);
+
+ var str = getString(length);
+ if (isUnique) {
+ var count = 0;
+ while (generated[str]) {
+ if (++count === uniqTryLimit) {
+ throw new Error(
+ "Cannot generate random string.\n" +
+ "String.random is not designed to effectively generate many short and " +
+ "unique random strings"
+ );
+ }
+ str = getString(length);
+ }
+ generated[str] = true;
+ }
+ return str;
+};
diff --git a/Nodejs/node_modules/es5-ext/string/raw/implement.js b/Nodejs/node_modules/es5-ext/string/raw/implement.js
new file mode 100644
index 0000000..24f17c2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/raw/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(String, "raw", {
+ value: require("./shim"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es5-ext/string/raw/index.js b/Nodejs/node_modules/es5-ext/string/raw/index.js
new file mode 100644
index 0000000..39889e9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/raw/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./is-implemented")() ? String.raw : require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/string/raw/is-implemented.js b/Nodejs/node_modules/es5-ext/string/raw/is-implemented.js
new file mode 100644
index 0000000..8758108
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/raw/is-implemented.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function () {
+ var raw = String.raw, test;
+ if (typeof raw !== "function") return false;
+ test = ["foo\nbar", "marko\n"];
+ test.raw = ["foo\\nbar", "marko\\n"];
+ return raw(test, "INSE\nRT") === "foo\\nbarINSE\nRTmarko\\n";
+};
diff --git a/Nodejs/node_modules/es5-ext/string/raw/shim.js b/Nodejs/node_modules/es5-ext/string/raw/shim.js
new file mode 100644
index 0000000..5d17e5f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/string/raw/shim.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var toPosInt = require("../../number/to-pos-integer")
+ , validValue = require("../../object/valid-value")
+ , reduce = Array.prototype.reduce;
+
+module.exports = function (callSite/*, …substitutions*/) {
+ var args, rawValue = Object(validValue(Object(validValue(callSite)).raw));
+ if (!toPosInt(rawValue.length)) return "";
+ args = arguments;
+ return reduce.call(rawValue, function (str1, str2, i) {
+ return str1 + String(args[i]) + str2;
+ });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/.eslintrc.json b/Nodejs/node_modules/es5-ext/test/.eslintrc.json
new file mode 100644
index 0000000..7d69172
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/.eslintrc.json
@@ -0,0 +1,12 @@
+{
+ "globals": { "Symbol": true },
+ "rules": {
+ "consistent-this": "off",
+ "id-length": "off",
+ "no-empty-function": "off",
+ "no-eval": "off",
+ "no-new-wrappers": "off",
+ "no-prototype-builtins": "off",
+ "no-shadow": "off"
+ }
+}
diff --git a/Nodejs/node_modules/es5-ext/test/__tad.js b/Nodejs/node_modules/es5-ext/test/__tad.js
new file mode 100644
index 0000000..883c379
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/__tad.js
@@ -0,0 +1,3 @@
+"use strict";
+
+exports.context = null;
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/implement.js
new file mode 100644
index 0000000..aac624f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/@@iterator/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/index.js b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/shim.js
new file mode 100644
index 0000000..71b71d5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/@@iterator/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+exports.__generic = function (t, a) {
+ var iterator = t.call(this);
+ a.deep(iterator.next(), { value: "1", done: false });
+ a.deep(iterator.next(), { value: "2", done: false });
+ a.deep(iterator.next(), { value: "3", done: false });
+ a.deep(iterator.next(), { value: undefined, done: true });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/_compare-by-length.js b/Nodejs/node_modules/es5-ext/test/array/#/_compare-by-length.js
new file mode 100644
index 0000000..a53d847
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/_compare-by-length.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var arr = [4, 5, 6], obj1 = { length: 8 }, obj2 = {}, obj3 = { length: 1 };
+
+ a.deep([arr, obj1, obj2, obj3].sort(t), [obj2, obj3, arr, obj1]);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/binary-search.js b/Nodejs/node_modules/es5-ext/test/array/#/binary-search.js
new file mode 100644
index 0000000..7c1d2f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/binary-search.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var compare = function (value) { return this - value; };
+
+module.exports = function (t, a) {
+ var arr;
+ arr = [2, 5, 5, 8, 34, 67, 98, 345, 678];
+
+ // Highest, equal match
+ a(t.call(arr, compare.bind(1)), 0, "All higher");
+ a(t.call(arr, compare.bind(679)), arr.length - 1, "All lower");
+ a(t.call(arr, compare.bind(4)), 0, "Mid");
+ a(t.call(arr, compare.bind(5)), 2, "Match");
+ a(t.call(arr, compare.bind(6)), 2, "Above");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/clear.js b/Nodejs/node_modules/es5-ext/test/array/#/clear.js
new file mode 100644
index 0000000..640cc19
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/clear.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var arr = [1, 2, {}, 4];
+ a(t.call(arr), arr, "Returns same array");
+ a.deep(arr, [], "Empties array");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/compact.js b/Nodejs/node_modules/es5-ext/test/array/#/compact.js
new file mode 100644
index 0000000..a7702a1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/compact.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) { a(t.call(this).length, 3); },
+ "": function (t, a) {
+ var o, x, y, z;
+ o = {};
+ x = [0, 1, "", null, o, false, undefined, true];
+ y = x.slice(0);
+
+ a.not((z = t.call(x)), x, "Returns different object");
+ a.deep(x, y, "Origin not changed");
+ a.deep(z, [0, 1, "", o, false, true], "Result");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/concat/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/concat/implement.js
new file mode 100644
index 0000000..83a397e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/concat/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/concat/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/concat/index.js b/Nodejs/node_modules/es5-ext/test/array/#/concat/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/concat/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/concat/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/concat/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/concat/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/concat/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/concat/shim.js
new file mode 100644
index 0000000..a9e6273
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/concat/shim.js
@@ -0,0 +1,29 @@
+"use strict";
+
+var isConcatSpreadable = require("es6-symbol").isConcatSpreadable
+ , SubArray = require("../../../../array/_sub-array-dummy-safe");
+
+module.exports = function (t, a) {
+ var arr = [1, 3, 45], x = {}, subArr, subArr2, result;
+
+ a.deep(
+ t.call(arr, "2d", x, ["ere", "fe", x], false, null),
+ [1, 3, 45, "2d", x, "ere", "fe", x, false, null], "Plain array"
+ );
+
+ subArr = new SubArray("lol", "miszko");
+ subArr2 = new SubArray("elo", "fol");
+
+ result = t.call(subArr, "df", arr, "fef", subArr2, null);
+ a(result instanceof SubArray, true, "Instance of subclass");
+ a.deep(
+ result, ["lol", "miszko", "df", 1, 3, 45, "fef", "elo", "fol", null], "Spreable by default"
+ );
+
+ SubArray.prototype[isConcatSpreadable] = false;
+
+ result = t.call(subArr, "df", arr, "fef", subArr2, null);
+ a.deep(result, [subArr, "df", 1, 3, 45, "fef", subArr2, null], "Non spreadable");
+
+ delete SubArray.prototype[isConcatSpreadable];
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/contains.js b/Nodejs/node_modules/es5-ext/test/array/#/contains.js
new file mode 100644
index 0000000..fb0f96c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/contains.js
@@ -0,0 +1,21 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) {
+ a(t.call(this, this[1]), true, "Contains");
+ a(t.call(this, {}), false, "Does Not contain");
+ },
+ "": function (t, a) {
+ var o, x = {}, y = {};
+
+ o = [1, "raz", x];
+
+ a(t.call(o, 1), true, "First");
+ a(t.call(o, "1"), false, "Type coercion");
+ a(t.call(o, "raz"), true, "Primitive");
+ a(t.call(o, "foo"), false, "Primitive not found");
+ a(t.call(o, x), true, "Object found");
+ a(t.call(o, y), false, "Object not found");
+ a(t.call(o, 1, 1), false, "Position");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/copy-within/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/implement.js
new file mode 100644
index 0000000..6d5a305
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/copy-within/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/copy-within/index.js b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/copy-within/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/shim.js
new file mode 100644
index 0000000..03a631f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/copy-within/shim.js
@@ -0,0 +1,29 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var args, x;
+
+ a.h1("2 args");
+ x = [1, 2, 3, 4, 5];
+ t.call(x, 0, 3);
+ a.deep(x, [4, 5, 3, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], 1, 3), [1, 4, 5, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], 1, 2), [1, 3, 4, 5, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], 2, 2), [1, 2, 3, 4, 5]);
+
+ a.h1("3 args");
+ a.deep(t.call([1, 2, 3, 4, 5], 0, 3, 4), [4, 2, 3, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], 1, 3, 4), [1, 4, 3, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], 1, 2, 4), [1, 3, 4, 4, 5]);
+
+ a.h1("Negative args");
+ a.deep(t.call([1, 2, 3, 4, 5], 0, -2), [4, 5, 3, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], 0, -2, -1), [4, 2, 3, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -2), [1, 3, 3, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], -4, -3, -1), [1, 3, 4, 4, 5]);
+ a.deep(t.call([1, 2, 3, 4, 5], -4, -3), [1, 3, 4, 5, 5]);
+
+ a.h1("Array-likes");
+ args = { 0: 1, 1: 2, 2: 3, length: 3 };
+ a.deep(t.call(args, -2, 0), { 0: 1, 1: 1, 2: 2, length: 3 });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/diff.js b/Nodejs/node_modules/es5-ext/test/array/#/diff.js
new file mode 100644
index 0000000..b088d83
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/diff.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) { a.deep(t.call(this, this), []); },
+ "": function (t, a) {
+ var x = {}, y = {};
+
+ a.deep(t.call([1, "raz", x, 2, "trzy", y], [x, 2, "trzy"]), [1, "raz", y], "Scope longer");
+ a.deep(t.call([1, "raz", x], [x, 2, "trzy", 1, y]), ["raz"], "Arg longer");
+ a.deep(t.call([1, "raz", x], []), [1, "raz", x], "Empty arg");
+ a.deep(t.call([], [1, y, "sdfs"]), [], "Empty scope");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/e-index-of.js b/Nodejs/node_modules/es5-ext/test/array/#/e-index-of.js
new file mode 100644
index 0000000..1e42cbd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/e-index-of.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {};
+ a(t.call([3, "raz", {}, x, {}], x), 3, "Regular");
+ a(t.call([3, "raz", NaN, {}, NaN], NaN), 2, "NaN");
+ a(t.call([3, "raz", 0, {}, -0], -0), 2, "-0");
+ a(t.call([3, "raz", -0, {}, 0], +0), 2, "+0");
+ a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 4, "fromIndex");
+ a(t.call([3, "raz", NaN, {}, NaN], NaN, -1), 4, "fromIndex negative #1");
+ a(t.call([3, "raz", NaN, {}, NaN], NaN, -2), 4, "fromIndex negative #2");
+ a(t.call([3, "raz", NaN, {}, NaN], NaN, -3), 2, "fromIndex negative #3");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/e-last-index-of.js b/Nodejs/node_modules/es5-ext/test/array/#/e-last-index-of.js
new file mode 100644
index 0000000..2c7fff9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/e-last-index-of.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {};
+ a(t.call([3, "raz", {}, x, {}, x], x), 5, "Regular");
+ a(t.call([3, "raz", NaN, {}, x], NaN), 2, "NaN");
+ a(t.call([3, "raz", 0, {}, -0], -0), 4, "-0");
+ a(t.call([3, "raz", -0, {}, 0], +0), 4, "+0");
+ a(t.call([3, "raz", NaN, {}, NaN], NaN, 3), 2, "fromIndex");
+ a(t.call([3, "raz", NaN, 2, NaN], NaN, -1), 4, "Negative fromIndex #1");
+ a(t.call([3, "raz", NaN, 2, NaN], NaN, -2), 2, "Negative fromIndex #2");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/entries/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/entries/implement.js
new file mode 100644
index 0000000..00dbf0e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/entries/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/entries/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/entries/index.js b/Nodejs/node_modules/es5-ext/test/array/#/entries/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/entries/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/entries/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/entries/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/entries/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/entries/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/entries/shim.js
new file mode 100644
index 0000000..87ac25a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/entries/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+exports.__generic = function (t, a) {
+ var iterator = t.call(this);
+ a.deep(iterator.next(), { value: [0, "1"], done: false });
+ a.deep(iterator.next(), { value: [1, "2"], done: false });
+ a.deep(iterator.next(), { value: [2, "3"], done: false });
+ a.deep(iterator.next(), { value: undefined, done: true });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/exclusion.js b/Nodejs/node_modules/es5-ext/test/array/#/exclusion.js
new file mode 100644
index 0000000..827c037
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/exclusion.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) {
+ var x = {};
+ a.deep(t.call(this, this, [this[0], this[2], x]), [x]);
+ },
+ "": function (t, a) {
+ var x = {}, y = {};
+
+ a.deep(t.call([x, y]), [x, y], "No arguments");
+ a.deep(t.call([x, 1], [], []), [x, 1], "Empty arguments");
+ a.deep(t.call([1, "raz", x], [2, "raz", y], [2, "raz", x]), [1, y]);
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/fill/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/fill/implement.js
new file mode 100644
index 0000000..41f2a5b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/fill/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/fill/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/fill/index.js b/Nodejs/node_modules/es5-ext/test/array/#/fill/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/fill/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/fill/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/fill/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/fill/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/fill/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/fill/shim.js
new file mode 100644
index 0000000..75906e9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/fill/shim.js
@@ -0,0 +1,15 @@
+// Taken from https://github.com/paulmillr/es6-shim/blob/master/test/array.js
+
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+
+ x = [1, 2, 3, 4, 5, 6];
+ a(t.call(x, -1), x, "Returns self object");
+ a.deep(x, [-1, -1, -1, -1, -1, -1], "Value");
+
+ a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 3), [1, 2, 3, -1, -1, -1], "Positive start");
+ a.deep(t.call([1, 2, 3, 4, 5, 6], -1, -3), [1, 2, 3, -1, -1, -1], "Negative start");
+ a.deep(t.call([1, 2, 3, 4, 5, 6], -1, 9), [1, 2, 3, 4, 5, 6], "Large start");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/filter/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/filter/implement.js
new file mode 100644
index 0000000..9a6ad04
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/filter/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/filter/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/filter/index.js b/Nodejs/node_modules/es5-ext/test/array/#/filter/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/filter/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/filter/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/filter/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/filter/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/filter/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/filter/shim.js
new file mode 100644
index 0000000..e20a651
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/filter/shim.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var SubArray = require("../../../../array/_sub-array-dummy-safe");
+
+module.exports = function (t, a) {
+ var arr, x = {}, subArr, result;
+
+ arr = ["foo", undefined, 0, "2d", false, x, null];
+
+ a.deep(t.call(arr, Boolean), ["foo", "2d", x], "Plain array");
+
+ subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
+
+ result = t.call(subArr, Boolean);
+ a(result instanceof SubArray, true, "Instance of subclass");
+ a.deep(result, ["foo", "2d", x], "Result of subclass");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find-index/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/find-index/implement.js
new file mode 100644
index 0000000..2291982
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find-index/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/find-index/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find-index/index.js b/Nodejs/node_modules/es5-ext/test/array/#/find-index/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find-index/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find-index/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/find-index/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find-index/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find-index/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/find-index/shim.js
new file mode 100644
index 0000000..665c562
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find-index/shim.js
@@ -0,0 +1,23 @@
+"use strict";
+
+exports.__generic = function (t, a) {
+ var count = 0, o = {}, self = Object(this);
+ a(
+ t.call(
+ self,
+ function (value, i, scope) {
+ a(value, this[i], "Value");
+ a(i, count++, "Index");
+ a(scope, this, "Scope");
+ },
+ self
+ ),
+ -1,
+ "Falsy result"
+ );
+ a(count, 3);
+
+ count = -1;
+ a(t.call(this, function () { return ++count ? o : null; }, this), 1, "Truthy result");
+ a(count, 1);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/find/implement.js
new file mode 100644
index 0000000..463198b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/find/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find/index.js b/Nodejs/node_modules/es5-ext/test/array/#/find/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/find/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/find/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/find/shim.js
new file mode 100644
index 0000000..fdda122
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/find/shim.js
@@ -0,0 +1,23 @@
+"use strict";
+
+exports.__generic = function (t, a) {
+ var count = 0, o = {}, self = Object(this);
+ a(
+ t.call(
+ self,
+ function (value, i, scope) {
+ a(value, this[i], "Value");
+ a(i, count++, "Index");
+ a(scope, this, "Scope");
+ },
+ self
+ ),
+ undefined,
+ "Falsy result"
+ );
+ a(count, 3);
+
+ count = -1;
+ a(t.call(this, function () { return ++count ? o : null; }, this), this[1], "Truthy result");
+ a(count, 1);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/first-index.js b/Nodejs/node_modules/es5-ext/test/array/#/first-index.js
new file mode 100644
index 0000000..af3388b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/first-index.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a(t.call([]), null, "Empty");
+ a(t.call([null]), 0, "One value");
+ a(t.call([1, 2, 3]), 0, "Many values");
+ a(t.call(new Array(1000)), null, "Sparse empty");
+ x = [];
+ x[883] = undefined;
+ x[890] = null;
+ a(t.call(x), 883, "Manual sparse, distant value");
+ x = new Array(1000);
+ x[657] = undefined;
+ x[700] = null;
+ a(t.call(x), 657, "Sparse, distant value");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/first.js b/Nodejs/node_modules/es5-ext/test/array/#/first.js
new file mode 100644
index 0000000..4e72c02
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/first.js
@@ -0,0 +1,11 @@
+"use strict";
+
+exports.__generic = function (t, a) { a(t.call(this), this[0]); };
+exports[""] = function (t, a) {
+ var x;
+ a(t.call([]), undefined, "Empty");
+ a(t.call(new Array(234), undefined, "Sparse empty"));
+ x = new Array(2342);
+ x[434] = {};
+ a(t.call(x), x[434], "Sparse");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/flatten.js b/Nodejs/node_modules/es5-ext/test/array/#/flatten.js
new file mode 100644
index 0000000..aa749a5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/flatten.js
@@ -0,0 +1,12 @@
+"use strict";
+
+var o = [1, 2, [3, 4, [5, 6], 7, 8], 9, 10, [11, 12, [13, 14]], 15];
+
+module.exports = {
+ "__generic": function (t, a) { a(t.call(this).length, 3); },
+ "Nested Arrays": function (t, a) {
+ var result = t.call(o);
+ a.not(o, result);
+ a.deep(result, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/for-each-right.js b/Nodejs/node_modules/es5-ext/test/array/#/for-each-right.js
new file mode 100644
index 0000000..b5eb984
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/for-each-right.js
@@ -0,0 +1,39 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) {
+ var count = 0, first, last, x, icount = this.length;
+ t.call(this, function (item, index, col) {
+ ++count;
+ if (!first) {
+ first = item;
+ }
+ last = item;
+ x = col;
+ a(index, --icount, "Index");
+ });
+ a(count, this.length, "Iterated");
+ a(first, this[this.length - 1], "First is last");
+ a(last, this[0], "Last is first");
+ a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip
+ },
+ "": function (t, a) {
+ var x = {}, y, count;
+ t.call([1], function () { y = this; }, x);
+ a(y, x, "Scope");
+ y = 0;
+ t.call([3, 4, 4], function (a, i) { y += i; });
+ a(y, 3, "Indexes");
+
+ x = [1, 3];
+ x[5] = "x";
+ y = 0;
+ count = 0;
+ t.call(x, function (a, i) {
+ ++count;
+ y += i;
+ });
+ a(y, 6, "Misssing Indexes");
+ a(count, 3, "Misssing Indexes, count");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/group.js b/Nodejs/node_modules/es5-ext/test/array/#/group.js
new file mode 100644
index 0000000..114fffd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/group.js
@@ -0,0 +1,30 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) {
+ var count = 0, self;
+
+ self = Object(this);
+ a.deep(
+ t.call(
+ self,
+ function (v, i, scope) {
+ a(v, this[i], "Value");
+ a(i, count++, "Index");
+ a(scope, this, "Scope");
+ return i;
+ },
+ self
+ ),
+ { 0: [this[0]], 1: [this[1]], 2: [this[2]] }
+ );
+ },
+ "": function (t, a) {
+ var r;
+ r = t.call([2, 3, 3, 4, 5, 6, 7, 7, 23, 45, 34, 56], function (v) {
+ return v % 2 ? "odd" : "even";
+ });
+ a.deep(r.odd, [3, 3, 5, 7, 7, 23, 45]);
+ a.deep(r.even, [2, 4, 6, 34, 56]);
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/indexes-of.js b/Nodejs/node_modules/es5-ext/test/array/#/indexes-of.js
new file mode 100644
index 0000000..aa50d5e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/indexes-of.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) { a.deep(t.call(this, this[1]), [1]); },
+ "": function (t, a) {
+ var x = {};
+ a.deep(t.call([1, 3, 5, 3, 5], 6), [], "No result");
+ a.deep(t.call([1, 3, 5, 1, 3, 5, 1], 1), [0, 3, 6], "Some results");
+ a.deep(t.call([], x), [], "Empty array");
+ a.deep(t.call([x, 3, {}, x, 3, 5, x], x), [0, 3, 6], "Search for object");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/intersection.js b/Nodejs/node_modules/es5-ext/test/array/#/intersection.js
new file mode 100644
index 0000000..81088d2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/intersection.js
@@ -0,0 +1,25 @@
+"use strict";
+
+var toArray = require("../../../array/to-array");
+
+module.exports = {
+ "__generic": function (t, a) { a.deep(t.call(this, this, this), toArray(this)); },
+ "": function (t, a) {
+ var x = {}, y = {}, p, r;
+ a.deep(t.call([], [2, 3, 4]), [], "Empty #1");
+ a.deep(t.call([2, 3, 4], []), [], "Empty #2");
+ a.deep(t.call([2, 3, x], [y, 5, 7]), [], "Different");
+ p = t.call(
+ [3, 5, "raz", {}, "dwa", x], [1, 3, "raz", "dwa", "trzy", x, {}], [3, "raz", x, 65]
+ );
+ r = [3, "raz", x];
+ p.sort();
+ r.sort();
+ a.deep(p, r, "Same parts");
+ a.deep(t.call(r, r), r, "Same");
+ a.deep(
+ t.call([1, 2, x, 4, 5, y, 7], [7, y, 5, 4, x, 2, 1]), [1, 2, x, 4, 5, y, 7],
+ "Long reverse same"
+ );
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/is-copy.js b/Nodejs/node_modules/es5-ext/test/array/#/is-copy.js
new file mode 100644
index 0000000..b362485
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/is-copy.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {};
+ a(t.call([], []), true, "Empty");
+ a(t.call([], {}), true, "Empty lists");
+ a(t.call([1, x, "raz"], [1, x, "raz"]), true, "Same");
+ a(t.call([1, x, "raz"], { 0: 1, 1: x, 2: "raz", length: 3 }), true, "Same lists");
+ a(t.call([1, x, "raz"], [x, 1, "raz"]), false, "Diff order");
+ a(t.call([1, x], [1, x, "raz"]), false, "Diff length #1");
+ a(t.call([1, x, "raz"], [1, x]), false, "Diff length #2");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/is-empty.js b/Nodejs/node_modules/es5-ext/test/array/#/is-empty.js
new file mode 100644
index 0000000..1e1c097
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/is-empty.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {};
+ a(t.call([]), true, "Empty");
+ a(t.call({ length: 0 }), true, "Empty lists");
+ a(t.call([1, x, "raz"]), false, "Non empty");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/is-uniq.js b/Nodejs/node_modules/es5-ext/test/array/#/is-uniq.js
new file mode 100644
index 0000000..ab531ac
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/is-uniq.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {};
+ a(t.call([]), true, "Empty");
+ a(t.call({}), true, "Empty lists");
+ a(t.call([1, x, "raz"]), true, "Uniq");
+ a(t.call([1, x, 1, "raz"]), false, "Not Uniq: primitive");
+ a(t.call([1, x, "1", "raz"]), true, "Uniq: primitive");
+ a(t.call([1, x, 1, {}, "raz"]), false, "Not Uniq: Obj");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/keys/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/keys/implement.js
new file mode 100644
index 0000000..5afe847
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/keys/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/keys/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/keys/index.js b/Nodejs/node_modules/es5-ext/test/array/#/keys/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/keys/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/keys/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/keys/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/keys/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/keys/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/keys/shim.js
new file mode 100644
index 0000000..9be9a8f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/keys/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+exports.__generic = function (t, a) {
+ var iterator = t.call(this);
+ a.deep(iterator.next(), { value: 0, done: false });
+ a.deep(iterator.next(), { value: 1, done: false });
+ a.deep(iterator.next(), { value: 2, done: false });
+ a.deep(iterator.next(), { value: undefined, done: true });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/last-index.js b/Nodejs/node_modules/es5-ext/test/array/#/last-index.js
new file mode 100644
index 0000000..e66d16f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/last-index.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a(t.call([]), null, "Empty");
+ a(t.call([null]), 0, "One value");
+ a(t.call([1, 2, 3]), 2, "Many values");
+ a(t.call(new Array(1000)), null, "Sparse empty");
+ x = [];
+ x[883] = null;
+ x[890] = undefined;
+ a(t.call(x), 890, "Manual sparse, distant value");
+ x = new Array(1000);
+ x[657] = null;
+ x[700] = undefined;
+ a(t.call(x), 700, "Sparse, distant value");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/last.js b/Nodejs/node_modules/es5-ext/test/array/#/last.js
new file mode 100644
index 0000000..16bca6d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/last.js
@@ -0,0 +1,13 @@
+"use strict";
+
+exports.__generic = function (t, a) { a(t.call(this), this[this.length - 1]); };
+
+exports[""] = function (t, a) {
+ var x;
+ a(t.call([]), undefined, "Empty");
+ a(t.call(new Array(234), undefined, "Sparse empty"));
+ x = new Array(2342);
+ x[434] = {};
+ x[450] = {};
+ a(t.call(x), x[450], "Sparse");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/map/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/map/implement.js
new file mode 100644
index 0000000..1e33581
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/map/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/map/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/map/index.js b/Nodejs/node_modules/es5-ext/test/array/#/map/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/map/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/map/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/map/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/map/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/map/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/map/shim.js
new file mode 100644
index 0000000..cb178a2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/map/shim.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var SubArray = require("../../../../array/_sub-array-dummy-safe");
+
+module.exports = function (t, a) {
+ var arr, x = {}, subArr, result;
+
+ arr = ["foo", undefined, 0, "2d", false, x, null];
+
+ a.deep(t.call(arr, Boolean), [true, false, false, true, false, true, false], "Plain array");
+
+ subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
+
+ result = t.call(subArr, Boolean);
+ a(result instanceof SubArray, true, "Instance of subclass");
+ a.deep(result, [true, false, false, true, false, true, false], "Result of subclass");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/remove.js b/Nodejs/node_modules/es5-ext/test/array/#/remove.js
new file mode 100644
index 0000000..d67457e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/remove.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var y = {}, z = {}, x = [9, z, 5, y, "foo"];
+ t.call(x, y);
+ a.deep(x, [9, z, 5, "foo"]);
+ t.call(x, {});
+ a.deep(x, [9, z, 5, "foo"], "Not existing");
+ t.call(x, 5);
+ a.deep(x, [9, z, "foo"], "Primitive");
+ x = [9, z, 5, y, "foo"];
+ t.call(x, z, 5, "foo");
+ a.deep(x, [9, y], "More than one argument");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/separate.js b/Nodejs/node_modules/es5-ext/test/array/#/separate.js
new file mode 100644
index 0000000..9792637
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/separate.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = [], y = {}, z = {};
+ a.deep(t.call(x, y), [], "Empty");
+ a.not(t.call(x), x, "Returns copy");
+ a.deep(t.call([1], y), [1], "One");
+ a.deep(t.call([1, "raz"], y), [1, y, "raz"], "One");
+ a.deep(t.call([1, "raz", x], y), [1, y, "raz", y, x], "More");
+ x = new Array(1000);
+ x[23] = 2;
+ x[3453] = "raz";
+ x[500] = z;
+ a.deep(t.call(x, y), [2, y, z, y, "raz"], "Sparse");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/slice/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/slice/implement.js
new file mode 100644
index 0000000..5a56791
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/slice/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/slice/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/slice/index.js b/Nodejs/node_modules/es5-ext/test/array/#/slice/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/slice/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/slice/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/slice/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/slice/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/slice/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/slice/shim.js
new file mode 100644
index 0000000..f09ad13
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/slice/shim.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var SubArray = require("../../../../array/_sub-array-dummy-safe");
+
+module.exports = function (t, a) {
+ var arr, x = {}, subArr, result;
+
+ arr = ["foo", undefined, 0, "2d", false, x, null];
+
+ a.deep(t.call(arr, 2, 4), [0, "2d"], "Plain array: result");
+
+ subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
+
+ result = t.call(subArr, 2, 4);
+ a(result instanceof SubArray, true, "Instance of subclass");
+ a.deep(result, [0, "2d"], "Subclass: result");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/some-right.js b/Nodejs/node_modules/es5-ext/test/array/#/some-right.js
new file mode 100644
index 0000000..ead78cc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/some-right.js
@@ -0,0 +1,54 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) {
+ var count = 0, first, last, x, icount = this.length;
+ t.call(this, function (item, index, col) {
+ ++count;
+ if (!first) {
+ first = item;
+ }
+ last = item;
+ x = col;
+ a(index, --icount, "Index");
+ });
+ a(count, this.length, "Iterated");
+ a(first, this[this.length - 1], "First is last");
+ a(last, this[0], "Last is first");
+ a.deep(x, Object(this), "Collection as third argument"); // Jslint: skip
+ },
+ "": function (t, a) {
+ var x = {}, y, count;
+ t.call([1], function () { y = this; }, x);
+ a(y, x, "Scope");
+ y = 0;
+ t.call([3, 4, 4], function (a, i) { y += i; });
+ a(y, 3, "Indexes");
+
+ x = [1, 3];
+ x[5] = "x";
+ y = 0;
+ count = 0;
+ a(
+ t.call(x, function (a, i) {
+ ++count;
+ y += i;
+ }),
+ false,
+ "Return"
+ );
+ a(y, 6, "Misssing Indexes");
+ a(count, 3, "Misssing Indexes, count");
+
+ count = 0;
+ a(
+ t.call([-2, -3, -4, 2, -5], function (item) {
+ ++count;
+ return item > 0;
+ }),
+ true,
+ "Return"
+ );
+ a(count, 2, "Break after true is returned");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/splice/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/splice/implement.js
new file mode 100644
index 0000000..2035022
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/splice/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/splice/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/splice/index.js b/Nodejs/node_modules/es5-ext/test/array/#/splice/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/splice/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/splice/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/splice/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/splice/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/splice/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/splice/shim.js
new file mode 100644
index 0000000..4802007
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/splice/shim.js
@@ -0,0 +1,19 @@
+"use strict";
+
+var SubArray = require("../../../../array/_sub-array-dummy-safe");
+
+module.exports = function (t, a) {
+ var arr, x = {}, subArr, result;
+
+ arr = ["foo", undefined, 0, "2d", false, x, null];
+
+ a.deep(t.call(arr, 2, 2, "bar"), [0, "2d"], "Plain array: result");
+ a.deep(arr, ["foo", undefined, "bar", false, x, null], "Plain array: change");
+
+ subArr = new SubArray("foo", undefined, 0, "2d", false, x, null);
+
+ result = t.call(subArr, 2, 2, "bar");
+ a(result instanceof SubArray, true, "Instance of subclass");
+ a.deep(result, [0, "2d"], "Subclass: result");
+ a.deep(subArr, ["foo", undefined, "bar", false, x, null], "Subclass: change");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/uniq.js b/Nodejs/node_modules/es5-ext/test/array/#/uniq.js
new file mode 100644
index 0000000..77b398b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/uniq.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = {
+ "__generic": function (t, a) { a(t.call(this).length, 3); },
+ "": function (t, a) {
+ var o, x = {}, y = {}, z = {}, w;
+ o = [1, 2, x, 3, 1, "raz", "1", y, x, "trzy", z, "raz"];
+
+ a.not((w = t.call(o)), o, "Returns different object");
+ a.deep(w, [1, 2, x, 3, "raz", "1", y, "trzy", z], "Result");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/values/implement.js b/Nodejs/node_modules/es5-ext/test/array/#/values/implement.js
new file mode 100644
index 0000000..60fb8dc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/values/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../array/#/values/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/values/index.js b/Nodejs/node_modules/es5-ext/test/array/#/values/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/values/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/values/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/#/values/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/values/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/#/values/shim.js b/Nodejs/node_modules/es5-ext/test/array/#/values/shim.js
new file mode 100644
index 0000000..71b71d5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/#/values/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+exports.__generic = function (t, a) {
+ var iterator = t.call(this);
+ a.deep(iterator.next(), { value: "1", done: false });
+ a.deep(iterator.next(), { value: "2", done: false });
+ a.deep(iterator.next(), { value: "3", done: false });
+ a.deep(iterator.next(), { value: undefined, done: true });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/__scopes.js b/Nodejs/node_modules/es5-ext/test/array/__scopes.js
new file mode 100644
index 0000000..f1c4090
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/__scopes.js
@@ -0,0 +1,9 @@
+"use strict";
+
+exports.Array = ["1", "2", "3"];
+
+exports.Arguments = (function () { return arguments; })("1", "2", "3");
+
+exports.String = "123";
+
+exports.Object = { 0: "1", 1: "2", 2: "3", 3: "4", length: 3 };
diff --git a/Nodejs/node_modules/es5-ext/test/array/_is-extensible.js b/Nodejs/node_modules/es5-ext/test/array/_is-extensible.js
new file mode 100644
index 0000000..124e59d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/_is-extensible.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t, "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js b/Nodejs/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js
new file mode 100644
index 0000000..4fab50d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isArray = Array.isArray;
+
+module.exports = function (t) { t(t === null || isArray(t.prototype), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/_sub-array-dummy.js b/Nodejs/node_modules/es5-ext/test/array/_sub-array-dummy.js
new file mode 100644
index 0000000..4fab50d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/_sub-array-dummy.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isArray = Array.isArray;
+
+module.exports = function (t) { t(t === null || isArray(t.prototype), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/from/implement.js b/Nodejs/node_modules/es5-ext/test/array/from/implement.js
new file mode 100644
index 0000000..48cd7b6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/from/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../array/from/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/from/index.js b/Nodejs/node_modules/es5-ext/test/array/from/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/from/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/from/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/from/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/from/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/from/shim.js b/Nodejs/node_modules/es5-ext/test/array/from/shim.js
new file mode 100644
index 0000000..997f832
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/from/shim.js
@@ -0,0 +1,64 @@
+// Some tests taken from: https://github.com/mathiasbynens/Array.from/blob/master/tests/tests.js
+
+"use strict";
+
+module.exports = function (t, a) {
+ var o = [1, 2, 3], MyType;
+ a.not(t(o), o, "Array");
+ a.deep(t(o), o, "Array: same content");
+ a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String");
+ a.deep(t((function () { return arguments; })(3, o, "raz")), [3, o, "raz"], "Arguments");
+ a.deep(t((function () { return arguments; })(3)), [3], "Arguments with one numeric value");
+
+ a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other");
+
+ a.deep(t(o, function (val) { return (val + 2) * 10; }, 10), [30, 40, 50], "Mapping");
+
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.deep(t(3), [], "Primitive");
+
+ a(t.length, 1, "Length");
+ a.deep(t({ length: 0 }), [], "No values Array-like");
+ a.deep(t({ length: -1 }), [], "Invalid length Array-like");
+ a.deep(t({ length: -Infinity }), [], "Invalid length Array-like #2");
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a.deep(t(false), [], "Boolean");
+ a.deep(t(-Infinity), [], "Inifity");
+ a.deep(t(-0), [], "-0");
+ a.deep(t(+0), [], "+0");
+ a.deep(t(1), [], "1");
+ a.deep(t(Number(Infinity)), [], "+Infinity");
+ a.deep(t({}), [], "Plain object");
+ a.deep(t({ length: 1 }), [undefined], "Sparse array-like");
+ a.deep(t({ 0: "a", 1: "b", length: 2 }, function (x) { return x + x; }), ["aa", "bb"], "Map");
+ a.deep(
+ t({ 0: "a", 1: "b", length: 2 }, function () { return String(this); }, undefined),
+ ["undefined", "undefined"], "Map context"
+ );
+ a.deep(
+ t({ 0: "a", 1: "b", length: 2 }, function () { return String(this); }, "x"), ["x", "x"],
+ "Map primitive context"
+ );
+ a.throws(function () { t({}, "foo", "x"); }, TypeError, "Non callable for map");
+
+ a.deep(t({ length: 1, 0: "a" }), ["a"], "Null context");
+
+ a(t({ __proto__: { 0: "abc", length: 1 } })[0], "abc", "Values on prototype");
+
+ a.throws(
+ function () {
+ t.call(function () { return Object.freeze({}); }, {});
+ },
+ TypeError,
+ "Contructor producing freezed objects"
+ );
+
+ // Ensure no setters are called for the indexes
+ // Ensure no setters are called for the indexes
+ MyType = function () {};
+ Object.defineProperty(MyType.prototype, "0", {
+ set: function (x) { throw new Error("Setter called: " + x); }
+ });
+ a.deep(t.call(MyType, { 0: "abc", length: 1 }), { 0: "abc", length: 1 }, "Defined not set");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/generate.js b/Nodejs/node_modules/es5-ext/test/array/generate.js
new file mode 100644
index 0000000..efd5f7c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/generate.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {}, y = {};
+ a.deep(t(3), [undefined, undefined, undefined], "Just length");
+ a.deep(t(0, "x"), [], "No repeat");
+ a.deep(t(1, x, y), [x], "Arguments length larger than repeat number");
+ a.deep(t(3, x), [x, x, x], "Single argument");
+ a.deep(t(5, x, y), [x, y, x, y, x], "Many arguments");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/is-plain-array.js b/Nodejs/node_modules/es5-ext/test/array/is-plain-array.js
new file mode 100644
index 0000000..2cfd50d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/is-plain-array.js
@@ -0,0 +1,18 @@
+"use strict";
+
+var SubArray = require("../../array/_sub-array-dummy-safe");
+
+module.exports = function (t, a) {
+ var arr = [1, 2, 3];
+ a(t(arr), true, "Array");
+ a(t(null), false, "Null");
+ a(t(), false, "Undefined");
+ a(t("234"), false, "String");
+ a(t(23), false, "Number");
+ a(t({}), false, "Plain object");
+ a(t({ length: 1, 0: "raz" }), false, "Array-like");
+ a(t(Object.create(arr)), false, "Array extension");
+ if (!SubArray) return;
+ a(t(new SubArray(23)), false, "Subclass instance");
+ a(t(Array.prototype), false, "Array.prototype");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/of/implement.js b/Nodejs/node_modules/es5-ext/test/array/of/implement.js
new file mode 100644
index 0000000..2a4c58b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/of/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../array/of/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/of/index.js b/Nodejs/node_modules/es5-ext/test/array/of/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/of/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/array/of/is-implemented.js b/Nodejs/node_modules/es5-ext/test/array/of/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/of/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/array/of/shim.js b/Nodejs/node_modules/es5-ext/test/array/of/shim.js
new file mode 100644
index 0000000..86eb574
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/of/shim.js
@@ -0,0 +1,81 @@
+/* eslint no-useless-call: "off" */
+// Most tests taken from https://github.com/mathiasbynens/Array.of/blob/master/tests/tests.js
+// Thanks @mathiasbynens
+
+"use strict";
+
+var defineProperty = Object.defineProperty;
+
+module.exports = function (t, a) {
+ var x = {}, testObject, MyType;
+
+ a.deep(t(), [], "No arguments");
+ a.deep(t(3), [3], "One numeric argument");
+ a.deep(t(3, "raz", null, x, undefined), [3, "raz", null, x, undefined], "Many arguments");
+
+ a(t.length, 0, "Length");
+
+ a.deep(t("abc"), ["abc"], "String");
+ a.deep(t(undefined), [undefined], "Undefined");
+ a.deep(t(null), [null], "Null");
+ a.deep(t(false), [false], "Boolean");
+ a.deep(t(-Infinity), [-Infinity], "Infinity");
+ a.deep(t(-0), [-0], "-0");
+ a.deep(t(+0), [+0], "+0");
+ a.deep(t(1), [1], "1");
+ a.deep(t(1, 2, 3), [1, 2, 3], "Numeric args");
+ a.deep(t(Number(Infinity)), [Number(Infinity)], "+Infinity");
+ a.deep(
+ t({ 0: "a", 1: "b", 2: "c", length: 3 }), [{ 0: "a", 1: "b", 2: "c", length: 3 }],
+ "Array like"
+ );
+ a.deep(
+ t(undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)),
+ [undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], "Falsy arguments"
+ );
+
+ a.h1("Null context");
+ a.deep(t.call(null, "abc"), ["abc"], "String");
+ a.deep(t.call(null, undefined), [undefined], "Undefined");
+ a.deep(t.call(null, null), [null], "Null");
+ a.deep(t.call(null, false), [false], "Boolean");
+ a.deep(t.call(null, -Infinity), [-Infinity], "-Infinity");
+ a.deep(t.call(null, -0), [-0], "-0");
+ a.deep(t.call(null, +0), [+0], "+0");
+ a.deep(t.call(null, 1), [1], "1");
+ a.deep(t.call(null, 1, 2, 3), [1, 2, 3], "Numeric");
+ a.deep(t.call(null, Number(Infinity)), [Number(Infinity)], "+Infinity");
+ a.deep(
+ t.call(null, { 0: "a", 1: "b", 2: "c", length: 3 }),
+ [{ 0: "a", 1: "b", 2: "c", length: 3 }], "Array-like"
+ );
+ a.deep(
+ t.call(null, undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)),
+ [undefined, null, false, -Infinity, -0, +0, 1, 2, Number(Infinity)], "Falsy"
+ );
+
+ a.h1("Other constructor context");
+ a.deep(t.call(Object, 1, 2, 3), { 0: 1, 1: 2, 2: 3, length: 3 }, "Many arguments");
+
+ testObject = Object(3);
+ testObject[0] = 1;
+ testObject[1] = 2;
+ testObject[2] = 3;
+ testObject.length = 3;
+ a.deep(t.call(Object, 1, 2, 3), testObject, "Test object");
+ a(t.call(Object).length, 0, "No arguments");
+ a.throws(
+ function () {
+ t.call(function () { return Object.freeze({}); });
+ },
+ TypeError,
+ "Frozen instance"
+ );
+
+ // Ensure no setters are called for the indexes
+ MyType = function () {};
+ defineProperty(MyType.prototype, "0", {
+ set: function (x) { throw new Error("Setter called: " + x); }
+ });
+ a.deep(t.call(MyType, "abc"), { 0: "abc", length: 1 }, "Define, not set");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/to-array.js b/Nodejs/node_modules/es5-ext/test/array/to-array.js
new file mode 100644
index 0000000..68c5102
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/to-array.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = [1, 2, 3];
+ a(t(o), o, "Array");
+ a.deep(t("12r3v"), ["1", "2", "r", "3", "v"], "String");
+ a.deep(t((function () { return arguments; })(3, o, "raz")), [3, o, "raz"], "Arguments");
+ a.deep(t((function () { return arguments; })(3)), [3], "Arguments with one numeric value");
+
+ a.deep(t({ 0: "raz", 1: "dwa", length: 2 }), ["raz", "dwa"], "Other");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/array/valid-array.js b/Nodejs/node_modules/es5-ext/test/array/valid-array.js
new file mode 100644
index 0000000..62ea503
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/array/valid-array.js
@@ -0,0 +1,20 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a.throws(function () { t(0); }, TypeError, "Number");
+ a.throws(function () { t(true); }, TypeError, "Boolean");
+ a.throws(function () { t("raz"); }, TypeError, "String");
+ a.throws(
+ function () {
+ t(function () {});
+ },
+ TypeError,
+ "Function"
+ );
+ a.throws(function () { t({}); }, TypeError, "Object");
+ a.throws(function () { t({ length: 0 }); }, TypeError, "Array-like");
+ a(t((x = [])), x, "Array");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/boolean/is-boolean.js b/Nodejs/node_modules/es5-ext/test/boolean/is-boolean.js
new file mode 100644
index 0000000..e36b3f3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/boolean/is-boolean.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t("arar"), false, "String");
+ a(t(12), false, "Number");
+ a(t(false), true, "Boolean");
+ a(t(new Boolean(false)), true, "Boolean object");
+ a(t(new Date()), false, "Date");
+ a(t(new String("raz")), false, "String object");
+ a(t({}), false, "Plain object");
+ a(t(/a/), false, "Regular expression");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/#/copy.js b/Nodejs/node_modules/es5-ext/test/date/#/copy.js
new file mode 100644
index 0000000..27c996b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/#/copy.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = new Date(), o2;
+
+ o2 = t.call(o);
+ a.not(o, o2, "Different objects");
+ a.ok(o2 instanceof Date, "Instance of Date");
+ a(o.getTime(), o2.getTime(), "Same time");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/#/days-in-month.js b/Nodejs/node_modules/es5-ext/test/date/#/days-in-month.js
new file mode 100644
index 0000000..ce2dd77
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/#/days-in-month.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2001, 0, 1)), 31, "January");
+ a(t.call(new Date(2001, 1, 1)), 28, "February");
+ a(t.call(new Date(2000, 1, 1)), 29, "February (leap)");
+ a(t.call(new Date(2001, 2, 1)), 31, "March");
+ a(t.call(new Date(2001, 3, 1)), 30, "April");
+ a(t.call(new Date(2001, 4, 1)), 31, "May");
+ a(t.call(new Date(2001, 5, 1)), 30, "June");
+ a(t.call(new Date(2001, 6, 1)), 31, "July");
+ a(t.call(new Date(2001, 7, 1)), 31, "August");
+ a(t.call(new Date(2001, 8, 1)), 30, "September");
+ a(t.call(new Date(2001, 9, 1)), 31, "October");
+ a(t.call(new Date(2001, 10, 1)), 30, "November");
+ a(t.call(new Date(2001, 11, 1)), 31, "December");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/#/floor-day.js b/Nodejs/node_modules/es5-ext/test/date/#/floor-day.js
new file mode 100644
index 0000000..e880838
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/#/floor-day.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2000, 0, 1, 13, 32, 34, 234)).valueOf(), new Date(2000, 0, 1).valueOf());
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/#/floor-month.js b/Nodejs/node_modules/es5-ext/test/date/#/floor-month.js
new file mode 100644
index 0000000..ccead84
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/#/floor-month.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2000, 0, 15, 13, 32, 34, 234)).valueOf(), new Date(2000, 0, 1).valueOf());
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/#/floor-year.js b/Nodejs/node_modules/es5-ext/test/date/#/floor-year.js
new file mode 100644
index 0000000..75267fc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/#/floor-year.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(new Date(2000, 5, 13, 13, 32, 34, 234)).valueOf(), new Date(2000, 0, 1).valueOf());
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/#/format.js b/Nodejs/node_modules/es5-ext/test/date/#/format.js
new file mode 100644
index 0000000..510b26b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/#/format.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var dt = new Date(2011, 2, 3, 3, 5, 5, 32);
+ a(t.call(dt, " %Y.%y.%m.%d.%H.%M.%S.%L "), " 2011.11.03.03.03.05.05.032 ");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/ensure-time-value.js b/Nodejs/node_modules/es5-ext/test/date/ensure-time-value.js
new file mode 100644
index 0000000..7f8f4e9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/ensure-time-value.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(12), 12, "Number in range");
+ a(t(12.23), 12, "Rounds number in range");
+ a(t(-12.63), -12, "Rounds negative number in range");
+ a.throws(function () { t(NaN); }, TypeError, "Throws on invalid");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/is-date.js b/Nodejs/node_modules/es5-ext/test/date/is-date.js
new file mode 100644
index 0000000..90ae8ad
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/is-date.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t("arar"), false, "String");
+ a(t(12), false, "Number");
+ a(t(true), false, "Boolean");
+ a(t(new Date()), true, "Date");
+ a(t(new String("raz")), false, "String object");
+ a(t({}), false, "Plain object");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/is-time-value.js b/Nodejs/node_modules/es5-ext/test/date/is-time-value.js
new file mode 100644
index 0000000..a21677c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/is-time-value.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t("arar"), false, "String");
+ a(t(12), true, "Number in range");
+ a(t(true), true, "Boolean");
+ a(t(new Date()), true, "Date");
+ a(t({}), false, "Plain object");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+ a(t(8.64e17), false, "Beyond range");
+ a(t(8.64e15), true, "Below range");
+ a(t(-8.64e17), false, "Negative beyond range");
+ a(t(-8.64e15), true, "Negative below range");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/date/valid-date.js b/Nodejs/node_modules/es5-ext/test/date/valid-date.js
new file mode 100644
index 0000000..6c8db2d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/date/valid-date.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var d = new Date();
+ a(t(d), d, "Date");
+ a.throws(function () { t({}); }, "Object");
+ a.throws(function () {
+ t({ valueOf: function () { return 20; } });
+ }, "Number object");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/error/#/throw.js b/Nodejs/node_modules/es5-ext/test/error/#/throw.js
new file mode 100644
index 0000000..c0af73c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/error/#/throw.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var e = new Error();
+ try { t.call(e); }
+ catch (e2) { a(e2, e); }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/error/custom.js b/Nodejs/node_modules/es5-ext/test/error/custom.js
new file mode 100644
index 0000000..ca35c76
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/error/custom.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var T = t, err = new T("My Error", "MY_ERROR", { errno: 123 });
+ a(err instanceof Error, true, "Instance of error");
+ a(err.constructor, Error, "Constructor");
+ a(err.name, "Error", "Name");
+ a(String(err), "Error: My Error", "String representation");
+ a(err.code, "MY_ERROR", "Code");
+ a(err.errno, 123, "Errno");
+ a(typeof err.stack, "string", "Stack trace");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/error/is-error.js b/Nodejs/node_modules/es5-ext/test/error/is-error.js
new file mode 100644
index 0000000..421f1a0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/error/is-error.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(), false, "Undefined");
+ a(t(1), false, "Primitive");
+ a(t({}), false, "Objectt");
+ a(t({ toString: function () { return "[object Error]"; } }), false, "Fake error");
+ a(t(new Error()), true, "Error");
+ a(t(new EvalError()), true, "EvalError");
+ a(t(new RangeError()), true, "RangeError");
+ a(t(new ReferenceError()), true, "ReferenceError");
+ a(t(new SyntaxError()), true, "SyntaxError");
+ a(t(new TypeError()), true, "TypeError");
+ a(t(new URIError()), true, "URIError");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/error/valid-error.js b/Nodejs/node_modules/es5-ext/test/error/valid-error.js
new file mode 100644
index 0000000..194f37d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/error/valid-error.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var e = new Error();
+ a(t(e), e, "Error");
+ a.throws(function () { t({}); }, "Other");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/compose.js b/Nodejs/node_modules/es5-ext/test/function/#/compose.js
new file mode 100644
index 0000000..b90a216
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/compose.js
@@ -0,0 +1,10 @@
+"use strict";
+
+var f = function (a, b) { return ["a", arguments.length, a, b]; }
+ , g = function (a) { return ["b", arguments.length].concat(a); }
+ , h = function (a) { return ["c", arguments.length].concat(a); };
+
+module.exports = function (t, a) {
+ a.deep(t.call(h, g, f)(1, 2), ["c", 1, "b", 1, "a", 2, 1, 2]);
+ a.deep(t(h, g, f)(1, 2), ["c", 1, "b", 1, "a", 2, 1, 2]);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/copy.js b/Nodejs/node_modules/es5-ext/test/function/#/copy.js
new file mode 100644
index 0000000..b458447
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/copy.js
@@ -0,0 +1,20 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var foo = "raz", bar = "dwa";
+ // eslint-disable-next-line func-names
+ var fn = function marko(a, b) { return this + a + b + foo + bar; };
+ var result, o = {};
+
+ fn.prototype = o;
+
+ fn.foo = "raz";
+
+ result = t.call(fn);
+
+ a(result.length, fn.length, "Length");
+ a(result.name, fn.name, "Length");
+ a(result.call("marko", "el", "fe"), "markoelferazdwa", "Body");
+ a(result.prototype, fn.prototype, "Prototype");
+ a(result.foo, fn.foo, "Custom property");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/curry.js b/Nodejs/node_modules/es5-ext/test/function/#/curry.js
new file mode 100644
index 0000000..fcae286
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/curry.js
@@ -0,0 +1,17 @@
+"use strict";
+
+var toArray = require("../../../array/to-array")
+ , f = function () { return toArray(arguments); };
+
+module.exports = function (t, a) {
+ var x, y = {}, z;
+ a.deep(t.call(f, 0, 1, 2)(3), [], "0 arguments");
+ x = t.call(f, 5, {});
+ a(x.length, 5, "Length #1");
+ z = x(1, 2);
+ a(z.length, 3, "Length #2");
+ z = z(3, 4);
+ a(z.length, 1, "Length #1");
+ a.deep(z(5, 6), [1, 2, 3, 4, 5], "Many arguments");
+ a.deep(x(8, 3)(y, 45)("raz", 6), [8, 3, y, 45, "raz"], "Many arguments #2");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/lock.js b/Nodejs/node_modules/es5-ext/test/function/#/lock.js
new file mode 100644
index 0000000..dd807a1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/lock.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(function () { return arguments.length; })(1, 2, 3), 0);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/microtask-delay.js b/Nodejs/node_modules/es5-ext/test/function/#/microtask-delay.js
new file mode 100644
index 0000000..8bd0dc1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/microtask-delay.js
@@ -0,0 +1,22 @@
+"use strict";
+
+var nextTick = require("next-tick");
+
+module.exports = function (t, a, d) {
+ var wasInvoked = false, args = [{}, {}], context = {};
+ var target = t.call(function () {
+ a(this, context);
+ a.deep(arguments, args);
+ wasInvoked = true;
+ });
+
+ nextTick(function () {
+ a(wasInvoked, false);
+ target.apply(context, args);
+ a(wasInvoked, false);
+ nextTick(function () {
+ a(wasInvoked, true);
+ d();
+ });
+ });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/not.js b/Nodejs/node_modules/es5-ext/test/function/#/not.js
new file mode 100644
index 0000000..64fff71
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/not.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var identity = require("../../../function/identity")
+ , noop = require("../../../function/noop");
+
+module.exports = function (t, a) {
+ a(t.call(identity)(""), true, "Falsy");
+ a(t.call(noop)(), true, "Undefined");
+ a(t.call(identity)({}), false, "Any object");
+ a(t.call(identity)(true), false, "True");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/partial.js b/Nodejs/node_modules/es5-ext/test/function/#/partial.js
new file mode 100644
index 0000000..8954948
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/partial.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var toArray = require("../../../array/to-array")
+ , f = function () { return toArray(arguments); };
+
+module.exports = function (t, a) { a.deep(t.call(f, 1)(2, 3), [1, 2, 3]); };
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/spread.js b/Nodejs/node_modules/es5-ext/test/function/#/spread.js
new file mode 100644
index 0000000..64e7b57
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/spread.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var f = function (a, b) { return this[a] + this[b]; }, o = { a: 3, b: 4 };
+
+module.exports = function (t, a) { a(t.call(f).call(o, ["a", "b"]), 7); };
diff --git a/Nodejs/node_modules/es5-ext/test/function/#/to-string-tokens.js b/Nodejs/node_modules/es5-ext/test/function/#/to-string-tokens.js
new file mode 100644
index 0000000..79bb83b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/#/to-string-tokens.js
@@ -0,0 +1,26 @@
+/* eslint no-eval: "off" */
+
+"use strict";
+
+module.exports = function (t, a) {
+ a.deep(t.call(function (a, b) { return this[a] + this[b]; }), {
+ args: "a, b",
+ body: " return this[a] + this[b]; "
+ });
+ a.deep(t.call(function () {}), { args: "", body: "" });
+ // eslint-disable-next-line no-unused-vars
+ a.deep(t.call(function (raz) {}), { args: "raz", body: "" });
+ a.deep(t.call(function () { Object(); }), { args: "", body: " Object(); " });
+
+ try {
+ eval("(() => {})");
+ } catch (e) {
+ // Non ES2015 env
+ return;
+ }
+
+ a.deep(t.call(eval("(() => {})")), { args: "", body: "" });
+ a.deep(t.call(eval("((elo) => foo)")), { args: "elo", body: "foo" });
+ a.deep(t.call(eval("(elo => foo)")), { args: "elo", body: "foo" });
+ a.deep(t.call(eval("((elo, bar) => foo())")), { args: "elo, bar", body: "foo()" });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/_define-length.js b/Nodejs/node_modules/es5-ext/test/function/_define-length.js
new file mode 100644
index 0000000..844ee3e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/_define-length.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var foo = "raz", bar = "dwa", fn = function (a, b) { return this + a + b + foo + bar; }, result;
+
+ result = t(fn, 3);
+ a(result.call("marko", "el", "fe"), "markoelferazdwa", "Content");
+ a(result.length, 3, "Length");
+ a(result.prototype, fn.prototype, "Prototype");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/constant.js b/Nodejs/node_modules/es5-ext/test/function/constant.js
new file mode 100644
index 0000000..8286d7a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/constant.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var o = {};
+
+module.exports = function (t, a) { a(t(o)(), o); };
diff --git a/Nodejs/node_modules/es5-ext/test/function/identity.js b/Nodejs/node_modules/es5-ext/test/function/identity.js
new file mode 100644
index 0000000..5bf4786
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/identity.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var o = {};
+
+module.exports = function (t, a) { a(t(o), o); };
diff --git a/Nodejs/node_modules/es5-ext/test/function/invoke.js b/Nodejs/node_modules/es5-ext/test/function/invoke.js
new file mode 100644
index 0000000..fb65627
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/invoke.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var constant = require("../../function/constant")
+ , o = { b: constant("c") };
+
+module.exports = function (t, a) { a(t("b")(o), "c"); };
diff --git a/Nodejs/node_modules/es5-ext/test/function/is-arguments.js b/Nodejs/node_modules/es5-ext/test/function/is-arguments.js
new file mode 100644
index 0000000..1836af8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/is-arguments.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var args, dummy;
+ args = (function () { return arguments; })();
+ dummy = { 0: 1, 1: 2 };
+ Object.defineProperty(dummy, "length", { value: 2 });
+ a(t(args), true, "Arguments");
+ a(t(dummy), false, "Dummy");
+ a(t([]), false, "Array");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/is-function.js b/Nodejs/node_modules/es5-ext/test/function/is-function.js
new file mode 100644
index 0000000..3652ba7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/is-function.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var o = { call: Function.prototype.call, apply: Function.prototype.apply };
+
+module.exports = function (t, a) {
+ a(t(function () {}), true, "Function is function");
+ a(t(o), false, "Plain object is not function");
+ var asyncFunction;
+ try { asyncFunction = eval("async () => {}"); }
+ catch (error) {}
+ if (asyncFunction) {
+ a(t(asyncFunction), true, "Async function is function");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/function/noop.js b/Nodejs/node_modules/es5-ext/test/function/noop.js
new file mode 100644
index 0000000..f264da3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/noop.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(1, 2, 3), "undefined"); };
diff --git a/Nodejs/node_modules/es5-ext/test/function/pluck.js b/Nodejs/node_modules/es5-ext/test/function/pluck.js
new file mode 100644
index 0000000..26adb21
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/pluck.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var o = { foo: "bar" };
+
+module.exports = function (t, a) { a(t("foo")(o), o.foo); };
diff --git a/Nodejs/node_modules/es5-ext/test/function/valid-function.js b/Nodejs/node_modules/es5-ext/test/function/valid-function.js
new file mode 100644
index 0000000..b5e0a57
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/function/valid-function.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var f = function () {};
+ a(t(f), f, "Function");
+ // eslint-disable-next-line no-new-func
+ f = new Function();
+ a(t(f), f, "Function");
+ a.throws(function () { t({}); }, "Object");
+ a.throws(function () { t(/re/); }, "RegExp");
+ a.throws(function () {
+ t({ call: function () { return 20; } });
+ }, "Plain object");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/global.js b/Nodejs/node_modules/es5-ext/test/global.js
new file mode 100644
index 0000000..b29fbbb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/global.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.ok(t && typeof t === "object");
+ a(typeof t.Array, "function");
+ a("__global__" in Object.prototype, false);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/iterable/for-each.js b/Nodejs/node_modules/es5-ext/test/iterable/for-each.js
new file mode 100644
index 0000000..aa167dc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/iterable/for-each.js
@@ -0,0 +1,62 @@
+"use strict";
+
+var ArrayIterator = require("es6-iterator/array")
+ , slice = Array.prototype.slice;
+
+module.exports = function (t, a) {
+ var i = 0, x = ["raz", "dwa", "trzy"], y = {};
+ t(
+ x,
+ function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#");
+ a(this, y, "Array: context: " + i++ + "#");
+ },
+ y
+ );
+ i = 0;
+ t(
+ (function () { return arguments; })("raz", "dwa", "trzy"),
+ function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#");
+ a(this, y, "Arguments: context: " + i++ + "#");
+ },
+ y
+ );
+ i = 0;
+ t(
+ { 0: "raz", 1: "dwa", 2: "trzy", length: 3 },
+ function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "Array-like" + i + "#");
+ a(this, y, "Array-like: context: " + i++ + "#");
+ },
+ y
+ );
+ i = 0;
+ t(
+ (x = "foo"),
+ function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
+ a(this, y, "Regular String: context: " + i++ + "#");
+ },
+ y
+ );
+ i = 0;
+ x = ["r", "💩", "z"];
+ t(
+ "r💩z",
+ function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
+ a(this, y, "Unicode String: context: " + i++ + "#");
+ },
+ y
+ );
+ i = 0;
+ t(
+ new ArrayIterator(x),
+ function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#");
+ a(this, y, "Iterator: context: " + i++ + "#");
+ },
+ y
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/iterable/is.js b/Nodejs/node_modules/es5-ext/test/iterable/is.js
new file mode 100644
index 0000000..f03c3f1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/iterable/is.js
@@ -0,0 +1,20 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function (t, a) {
+ var x;
+ a(t([]), true, "Array");
+ a(t(""), true, "String");
+ a(t((function () { return arguments; })()), true, "Arguments");
+ a(t({ length: 0 }), true, "List object");
+ a(t(function () {}), false, "Function");
+ a(t({}), false, "Plain object");
+ a(t(/raz/), false, "Regexp");
+ a(t(), false, "No argument");
+ a(t(null), false, "Null");
+ a(t(undefined), false, "Undefined");
+ x = {};
+ x[iteratorSymbol] = function () {};
+ a(t(x), true, "Iterable");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/iterable/validate-object.js b/Nodejs/node_modules/es5-ext/test/iterable/validate-object.js
new file mode 100644
index 0000000..486c132
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/iterable/validate-object.js
@@ -0,0 +1,26 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function (t, a) {
+ var x;
+ a.throws(function () { t(0); }, TypeError, "0");
+ a.throws(function () { t(false); }, TypeError, "false");
+ a.throws(function () { t(""); }, TypeError, "String");
+ a.throws(function () { t({}); }, TypeError, "Plain Object");
+ a.throws(
+ function () {
+ t(function () {});
+ },
+ TypeError,
+ "Function"
+ );
+ a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore
+
+ a(t((x = { length: 1 })), x, "Array like");
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "null");
+ x = {};
+ x[iteratorSymbol] = function () {};
+ a(t(x), x, "Iterable");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/iterable/validate.js b/Nodejs/node_modules/es5-ext/test/iterable/validate.js
new file mode 100644
index 0000000..49996a9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/iterable/validate.js
@@ -0,0 +1,26 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function (t, a) {
+ var x;
+ a.throws(function () { t(0); }, TypeError, "0");
+ a.throws(function () { t(false); }, TypeError, "false");
+ a(t(""), "", "''");
+ a.throws(function () { t({}); }, TypeError, "Plain Object");
+ a.throws(
+ function () {
+ t(function () {});
+ },
+ TypeError,
+ "Function"
+ );
+ a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore
+
+ a(t((x = { length: 1 })), x, "Array like");
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "null");
+ x = {};
+ x[iteratorSymbol] = function () {};
+ a(t(x), x, "Iterable");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/json/safe-stringify.js b/Nodejs/node_modules/es5-ext/test/json/safe-stringify.js
new file mode 100644
index 0000000..59ce8ad
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/json/safe-stringify.js
@@ -0,0 +1,21 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({ foo: "bar" }), JSON.stringify({ foo: "bar" }));
+ a(t({ foo: { elo: 12 } }), "{\"foo\":{\"elo\":12}}");
+ a(
+ t({ foo: { elo: 12, mel: { toJSON: function () { throw new Error("Nu nu!"); } } } }),
+ "{\"foo\":{\"elo\":12}}"
+ );
+ a(
+ t({ foo: { elo: 12 }, mel: { toJSON: function () { throw new Error("Nu nu!"); } } }),
+ "{\"foo\":{\"elo\":12}}"
+ );
+ a(
+ t({
+ foo: { elo: 12 },
+ mel: ["raz", { toJSON: function () { throw new Error("Nu nu!"); } }, 0, 2]
+ }),
+ "{\"foo\":{\"elo\":12},\"mel\":[\"raz\",0,2]}"
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/_decimal-adjust.js b/Nodejs/node_modules/es5-ext/test/math/_decimal-adjust.js
new file mode 100644
index 0000000..6da15ec
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/_decimal-adjust.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ // Just sanity check, as real tests are in 'round', 'ceil' and 'floor' variants
+ a(t("round")(55.55, -1), 55.6);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/_pack-ieee754.js b/Nodejs/node_modules/es5-ext/test/math/_pack-ieee754.js
new file mode 100644
index 0000000..6542873
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/_pack-ieee754.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a.deep(t(1.337, 8, 23), [63, 171, 34, 209]); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/_unpack-ieee754.js b/Nodejs/node_modules/es5-ext/test/math/_unpack-ieee754.js
new file mode 100644
index 0000000..d384160
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/_unpack-ieee754.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a.deep(t([63, 171, 34, 209], 8, 23), 1.3370000123977661); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/acosh/implement.js b/Nodejs/node_modules/es5-ext/test/math/acosh/implement.js
new file mode 100644
index 0000000..7ef68ea
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/acosh/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/acosh/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/acosh/index.js b/Nodejs/node_modules/es5-ext/test/math/acosh/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/acosh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/acosh/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/acosh/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/acosh/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/acosh/shim.js b/Nodejs/node_modules/es5-ext/test/math/acosh/shim.js
new file mode 100644
index 0000000..17ac181
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/acosh/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(-1), NaN, "Negative");
+ a(t(0), NaN, "Zero");
+ a(t(0.5), NaN, "Below 1");
+ a(t(1), 0, "1");
+ a(t(2), 1.3169578969248166, "Other");
+ a(t(Infinity), Infinity, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/asinh/implement.js b/Nodejs/node_modules/es5-ext/test/math/asinh/implement.js
new file mode 100644
index 0000000..cf98eb2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/asinh/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/asinh/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/asinh/index.js b/Nodejs/node_modules/es5-ext/test/math/asinh/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/asinh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/asinh/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/asinh/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/asinh/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/asinh/shim.js b/Nodejs/node_modules/es5-ext/test/math/asinh/shim.js
new file mode 100644
index 0000000..a4328d2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/asinh/shim.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 0, "Zero");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(-Infinity), -Infinity, "-Infinity");
+ a(t(-2), -1.4436354751788103, "Negative");
+ a(t(2), 1.4436354751788103, "Positive");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/atanh/implement.js b/Nodejs/node_modules/es5-ext/test/math/atanh/implement.js
new file mode 100644
index 0000000..b101bed
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/atanh/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/atanh/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/atanh/index.js b/Nodejs/node_modules/es5-ext/test/math/atanh/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/atanh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/atanh/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/atanh/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/atanh/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/atanh/shim.js b/Nodejs/node_modules/es5-ext/test/math/atanh/shim.js
new file mode 100644
index 0000000..f58709c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/atanh/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(-2), NaN, "Less than -1");
+ a(t(2), NaN, "Greater than 1");
+ a(t(-1), -Infinity, "-1");
+ a(t(1), Infinity, "1");
+ a(t(0), 0, "Zero");
+ a(Math.round(t(0.5) * 1e15), 549306144334055, "Other");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/cbrt/implement.js b/Nodejs/node_modules/es5-ext/test/math/cbrt/implement.js
new file mode 100644
index 0000000..c94e12b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cbrt/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/cbrt/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/cbrt/index.js b/Nodejs/node_modules/es5-ext/test/math/cbrt/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cbrt/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/cbrt/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/cbrt/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cbrt/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/cbrt/shim.js b/Nodejs/node_modules/es5-ext/test/math/cbrt/shim.js
new file mode 100644
index 0000000..fc1beee
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cbrt/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 0, "Zero");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(-Infinity), -Infinity, "-Infinity");
+ a(t(-1), -1, "-1");
+ a(t(1), 1, "1");
+ a(t(2), 1.2599210498948732, "Ohter");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/ceil-10.js b/Nodejs/node_modules/es5-ext/test/math/ceil-10.js
new file mode 100644
index 0000000..1c4a386
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/ceil-10.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(55.51, -1), 55.6);
+ a(t(51, 1), 60);
+ a(t(-55.59, -1), -55.5);
+ a(t(-59, 1), -50);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/clz32/implement.js b/Nodejs/node_modules/es5-ext/test/math/clz32/implement.js
new file mode 100644
index 0000000..c9a6677
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/clz32/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/clz32/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/clz32/index.js b/Nodejs/node_modules/es5-ext/test/math/clz32/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/clz32/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/clz32/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/clz32/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/clz32/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/clz32/shim.js b/Nodejs/node_modules/es5-ext/test/math/clz32/shim.js
new file mode 100644
index 0000000..4d8dd2f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/clz32/shim.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(1), 31, "1");
+ a(t(1000), 22, "1000");
+ a(t(), 32, "No arguments");
+ a(t(Infinity), 32, "Infinity");
+ a(t(-Infinity), 32, "-Infinity");
+ a(t("foo"), 32, "String");
+ a(t(true), 31, "Boolean");
+ a(t(3.5), 30, "Float");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/cosh/implement.js b/Nodejs/node_modules/es5-ext/test/math/cosh/implement.js
new file mode 100644
index 0000000..90e3dab
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cosh/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/cosh/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/cosh/index.js b/Nodejs/node_modules/es5-ext/test/math/cosh/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cosh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/cosh/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/cosh/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cosh/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/cosh/shim.js b/Nodejs/node_modules/es5-ext/test/math/cosh/shim.js
new file mode 100644
index 0000000..0b917c7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/cosh/shim.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 1, "Zero");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(-Infinity), Infinity, "-Infinity");
+ a(t(1), 1.5430806348152437, "1");
+ a(t(Number.MAX_VALUE), Infinity);
+ a(t(-Number.MAX_VALUE), Infinity);
+ a(t(Number.MIN_VALUE), 1);
+ a(t(-Number.MIN_VALUE), 1);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/expm1/implement.js b/Nodejs/node_modules/es5-ext/test/math/expm1/implement.js
new file mode 100644
index 0000000..41463c6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/expm1/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/expm1/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/expm1/index.js b/Nodejs/node_modules/es5-ext/test/math/expm1/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/expm1/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/expm1/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/expm1/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/expm1/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/expm1/shim.js b/Nodejs/node_modules/es5-ext/test/math/expm1/shim.js
new file mode 100644
index 0000000..cebb063
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/expm1/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 0, "Zero");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(-Infinity), -1, "-Infinity");
+ a(t(1).toFixed(15), "1.718281828459045", "1");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/floor-10.js b/Nodejs/node_modules/es5-ext/test/math/floor-10.js
new file mode 100644
index 0000000..a086d80
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/floor-10.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(55.59, -1), 55.5);
+ a(t(59, 1), 50);
+ a(t(-55.51, -1), -55.6);
+ a(t(-51, 1), -60);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/fround/implement.js b/Nodejs/node_modules/es5-ext/test/math/fround/implement.js
new file mode 100644
index 0000000..6c2bab3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/fround/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/fround/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/fround/index.js b/Nodejs/node_modules/es5-ext/test/math/fround/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/fround/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/fround/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/fround/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/fround/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/fround/shim.js b/Nodejs/node_modules/es5-ext/test/math/fround/shim.js
new file mode 100644
index 0000000..0525bfa
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/fround/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 0, "Zero");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(-Infinity), -Infinity, "-Infinity");
+ a(t(1.337), 1.3370000123977661, "1");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/hypot/implement.js b/Nodejs/node_modules/es5-ext/test/math/hypot/implement.js
new file mode 100644
index 0000000..e4b0052
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/hypot/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/hypot/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/hypot/index.js b/Nodejs/node_modules/es5-ext/test/math/hypot/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/hypot/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/hypot/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/hypot/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/hypot/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/hypot/shim.js b/Nodejs/node_modules/es5-ext/test/math/hypot/shim.js
new file mode 100644
index 0000000..89e4657
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/hypot/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(), 0, "No arguments");
+ a(t(0, -0, 0), 0, "Zeros");
+ a(t(4, NaN, Infinity), Infinity, "Infinity");
+ a(t(4, NaN, -Infinity), Infinity, "Infinity");
+ a(t(4, NaN, 34), NaN, "NaN");
+ a(t(3, 4), 5, "#1");
+ a(t(3, 4, 5), 7.0710678118654755, "#2");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/imul/implement.js b/Nodejs/node_modules/es5-ext/test/math/imul/implement.js
new file mode 100644
index 0000000..4c97d2b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/imul/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/imul/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/imul/index.js b/Nodejs/node_modules/es5-ext/test/math/imul/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/imul/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/imul/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/imul/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/imul/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/imul/shim.js b/Nodejs/node_modules/es5-ext/test/math/imul/shim.js
new file mode 100644
index 0000000..a8d4e90
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/imul/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(), 0, "No arguments");
+ a(t(0, 0), 0, "Zeros");
+ a(t(2, 4), 8, "#1");
+ a(t(-1, 8), -8, "#2");
+ a(t(0xfffffffe, 5), -10, "#3");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/log10/implement.js b/Nodejs/node_modules/es5-ext/test/math/log10/implement.js
new file mode 100644
index 0000000..70124b4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log10/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/log10/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/log10/index.js b/Nodejs/node_modules/es5-ext/test/math/log10/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log10/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/log10/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/log10/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log10/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/log10/shim.js b/Nodejs/node_modules/es5-ext/test/math/log10/shim.js
new file mode 100644
index 0000000..d069628
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log10/shim.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(-0.5), NaN, "Less than 0");
+ a(t(0), -Infinity, "0");
+ a(t(1), 0, "1");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(2), 0.3010299956639812, "Other");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/log1p/implement.js b/Nodejs/node_modules/es5-ext/test/math/log1p/implement.js
new file mode 100644
index 0000000..766ecdb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log1p/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/log1p/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/log1p/index.js b/Nodejs/node_modules/es5-ext/test/math/log1p/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log1p/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/log1p/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/log1p/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log1p/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/log1p/shim.js b/Nodejs/node_modules/es5-ext/test/math/log1p/shim.js
new file mode 100644
index 0000000..66b400c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log1p/shim.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(-1.5), NaN, "Less than -1");
+ a(t(-1), -Infinity, "-1");
+ a(t(0), 0, "0");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(1), 0.6931471805599453, "Other");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/log2/implement.js b/Nodejs/node_modules/es5-ext/test/math/log2/implement.js
new file mode 100644
index 0000000..a5360b7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log2/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/log2/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/log2/index.js b/Nodejs/node_modules/es5-ext/test/math/log2/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log2/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/log2/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/log2/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log2/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/log2/shim.js b/Nodejs/node_modules/es5-ext/test/math/log2/shim.js
new file mode 100644
index 0000000..f587e33
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/log2/shim.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(-0.5), NaN, "Less than 0");
+ a(t(0), -Infinity, "0");
+ a(t(1), 0, "1");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(3).toFixed(15), "1.584962500721156", "Other");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/round-10.js b/Nodejs/node_modules/es5-ext/test/math/round-10.js
new file mode 100644
index 0000000..c7ae38c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/round-10.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(55.55, -1), 55.6);
+ a(t(55.549, -1), 55.5);
+ a(t(55, 1), 60);
+ a(t(54.9, 1), 50);
+ a(t(-55.55, -1), -55.5);
+ a(t(-55.551, -1), -55.6);
+ a(t(-55, 1), -50);
+ a(t(-55.1, 1), -60);
+ a(t(1.005, -2), 1.01);
+ a(t(-1.005, -2), -1.0);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/sign/implement.js b/Nodejs/node_modules/es5-ext/test/math/sign/implement.js
new file mode 100644
index 0000000..cda8d61
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sign/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/sign/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/sign/index.js b/Nodejs/node_modules/es5-ext/test/math/sign/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sign/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/sign/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/sign/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sign/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/sign/shim.js b/Nodejs/node_modules/es5-ext/test/math/sign/shim.js
new file mode 100644
index 0000000..071ea07
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sign/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var is = require("../../../object/is");
+
+module.exports = function (t, a) {
+ a(is(t(0), +0), true, "+0");
+ a(is(t(-0), -0), true, "-0");
+ a(t({}), NaN, true, "NaN");
+ a(t(-234234234), -1, "Negative");
+ a(t(234234234), 1, "Positive");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/sinh/implement.js b/Nodejs/node_modules/es5-ext/test/math/sinh/implement.js
new file mode 100644
index 0000000..3d33338
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sinh/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/sinh/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/sinh/index.js b/Nodejs/node_modules/es5-ext/test/math/sinh/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sinh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/sinh/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/sinh/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sinh/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/sinh/shim.js b/Nodejs/node_modules/es5-ext/test/math/sinh/shim.js
new file mode 100644
index 0000000..f168a7f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/sinh/shim.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 0, "Zero");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(-Infinity), -Infinity, "-Infinity");
+ a(t(1), 1.1752011936438014, "1");
+ a(t(Number.MAX_VALUE), Infinity);
+ a(t(-Number.MAX_VALUE), -Infinity);
+ a(t(Number.MIN_VALUE), 5e-324);
+ a(t(-Number.MIN_VALUE), -5e-324);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/tanh/implement.js b/Nodejs/node_modules/es5-ext/test/math/tanh/implement.js
new file mode 100644
index 0000000..e3d9c55
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/tanh/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/tanh/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/tanh/index.js b/Nodejs/node_modules/es5-ext/test/math/tanh/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/tanh/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/tanh/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/tanh/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/tanh/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/tanh/shim.js b/Nodejs/node_modules/es5-ext/test/math/tanh/shim.js
new file mode 100644
index 0000000..5da3c08
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/tanh/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 0, "Zero");
+ a(t(Infinity), 1, "Infinity");
+ a(t(-Infinity), -1, "-Infinity");
+ a(t(1), 0.7615941559557649, "1");
+ a(t(Number.MAX_VALUE), 1);
+ a(t(-Number.MAX_VALUE), -1);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/math/trunc/implement.js b/Nodejs/node_modules/es5-ext/test/math/trunc/implement.js
new file mode 100644
index 0000000..fea8211
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/trunc/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../math/trunc/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/trunc/index.js b/Nodejs/node_modules/es5-ext/test/math/trunc/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/trunc/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/math/trunc/is-implemented.js b/Nodejs/node_modules/es5-ext/test/math/trunc/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/trunc/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/math/trunc/shim.js b/Nodejs/node_modules/es5-ext/test/math/trunc/shim.js
new file mode 100644
index 0000000..b80e868
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/math/trunc/shim.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var is = require("../../../object/is");
+
+module.exports = function (t, a) {
+ a(t({}), NaN, "NaN");
+ a(t(0), 0, "Zero");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(-Infinity), -Infinity, "-Infinity");
+ a(is(t(0.234), 0), true, "0");
+ a(is(t(-0.234), -0), true, "-0");
+ a(t(13.7), 13, "Positive #1");
+ a(t(12.3), 12, "Positive #2");
+ a(t(-12.3), -12, "Negative #1");
+ a(t(-14.7), -14, "Negative #2");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/#/pad.js b/Nodejs/node_modules/es5-ext/test/number/#/pad.js
new file mode 100644
index 0000000..cc8aa5e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/#/pad.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(78, 4), "0078");
+ a(t.call(65.12323, 4, 3), "0065.123", "Precision");
+ a(t.call(65, 4, 3), "0065.000", "Precision integer");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/epsilon/implement.js b/Nodejs/node_modules/es5-ext/test/number/epsilon/implement.js
new file mode 100644
index 0000000..1366058
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/epsilon/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../number/epsilon/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/epsilon/index.js b/Nodejs/node_modules/es5-ext/test/number/epsilon/index.js
new file mode 100644
index 0000000..1be9162
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/epsilon/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t, "number"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/epsilon/is-implemented.js b/Nodejs/node_modules/es5-ext/test/number/epsilon/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/epsilon/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-finite/implement.js b/Nodejs/node_modules/es5-ext/test/number/is-finite/implement.js
new file mode 100644
index 0000000..da4ee64
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-finite/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../number/is-finite/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-finite/index.js b/Nodejs/node_modules/es5-ext/test/number/is-finite/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-finite/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-finite/is-implemented.js b/Nodejs/node_modules/es5-ext/test/number/is-finite/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-finite/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-finite/shim.js b/Nodejs/node_modules/es5-ext/test/number/is-finite/shim.js
new file mode 100644
index 0000000..8fa004f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-finite/shim.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(2), true, "Number");
+ a(t("23"), false, "Not numeric");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-integer/implement.js b/Nodejs/node_modules/es5-ext/test/number/is-integer/implement.js
new file mode 100644
index 0000000..b1a8e9c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-integer/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../number/is-integer/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-integer/index.js b/Nodejs/node_modules/es5-ext/test/number/is-integer/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/test/number/is-integer/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-integer/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-integer/shim.js b/Nodejs/node_modules/es5-ext/test/number/is-integer/shim.js
new file mode 100644
index 0000000..e367990
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-integer/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(2), true, "Number");
+ a(t(2.34), false, "Float");
+ a(t("23"), false, "Not numeric");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-nan/implement.js b/Nodejs/node_modules/es5-ext/test/number/is-nan/implement.js
new file mode 100644
index 0000000..b8d9ab7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-nan/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../number/is-nan/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-nan/index.js b/Nodejs/node_modules/es5-ext/test/number/is-nan/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-nan/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-nan/is-implemented.js b/Nodejs/node_modules/es5-ext/test/number/is-nan/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-nan/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-nan/shim.js b/Nodejs/node_modules/es5-ext/test/number/is-nan/shim.js
new file mode 100644
index 0000000..3181047
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-nan/shim.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(2), false, "Number");
+ a(t({}), false, "Not numeric");
+ a(t(NaN), true, "NaN");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-natural.js b/Nodejs/node_modules/es5-ext/test/number/is-natural.js
new file mode 100644
index 0000000..8fe4dcc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-natural.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(2), true, "Number");
+ a(t(-2), false, "Negative");
+ a(t(2.34), false, "Float");
+ a(t("23"), false, "Not numeric");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-number.js b/Nodejs/node_modules/es5-ext/test/number/is-number.js
new file mode 100644
index 0000000..9cd670c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-number.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(0), true, "Zero");
+ a(t(NaN), true, "NaN");
+ a(t(Infinity), true, "Infinity");
+ a(t(12), true, "Number");
+ a(t(false), false, "Boolean");
+ a(t(new Date()), false, "Date");
+ a(t(new Number(2)), true, "Number object");
+ a(t("asdfaf"), false, "String");
+ a(t(""), false, "Empty String");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/implement.js b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/implement.js
new file mode 100644
index 0000000..aaab29c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../number/is-safe-integer/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/index.js b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/shim.js b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/shim.js
new file mode 100644
index 0000000..a4ea691
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/is-safe-integer/shim.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(2), true, "Number");
+ a(t(2.34), false, "Float");
+ a(t(Math.pow(2, 53)), false, "Too large");
+ a(t(Math.pow(2, 53) - 1), true, "Maximum");
+ a(t("23"), false, "Not numeric");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/implement.js b/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/implement.js
new file mode 100644
index 0000000..c3d4156
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../number/max-safe-integer/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/index.js b/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/index.js
new file mode 100644
index 0000000..1be9162
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t, "number"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/implement.js b/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/implement.js
new file mode 100644
index 0000000..3f3533f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../number/min-safe-integer/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/index.js b/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/index.js
new file mode 100644
index 0000000..1be9162
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t, "number"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js b/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/number/to-integer.js b/Nodejs/node_modules/es5-ext/test/number/to-integer.js
new file mode 100644
index 0000000..b7b975f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/to-integer.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), 0, "NaN");
+ a(t(20), 20, "Positive integer");
+ a(t("-20"), -20, "String negative integer");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(15.343), 15, "Float");
+ a(t(-15.343), -15, "Negative float");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/to-pos-integer.js b/Nodejs/node_modules/es5-ext/test/number/to-pos-integer.js
new file mode 100644
index 0000000..27c7cdf
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/to-pos-integer.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), 0, "NaN");
+ a(t(20), 20, "Positive integer");
+ a(t(-20), 0, "Negative integer");
+ a(t(Infinity), Infinity, "Infinity");
+ a(t(15.343), 15, "Float");
+ a(t(-15.343), 0, "Negative float");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/number/to-uint32.js b/Nodejs/node_modules/es5-ext/test/number/to-uint32.js
new file mode 100644
index 0000000..7eea42f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/number/to-uint32.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), 0, "Not numeric");
+ a(t(-4), 4294967292, "Negative");
+ a(t(133432), 133432, "Positive");
+ a(t(8589934592), 0, "Greater than maximum");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/_iterate.js b/Nodejs/node_modules/es5-ext/test/object/_iterate.js
new file mode 100644
index 0000000..98f8f1e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/_iterate.js
@@ -0,0 +1,36 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = { raz: 1, dwa: 2, trzy: 3 }, o2 = {}, o3 = {}, arr, i = -1;
+
+ t = t("forEach");
+ t(
+ o,
+ function (value, name, self, index) {
+ o2[name] = value;
+ a(index, ++i, "Index");
+ a(self, o, "Self");
+ a(this, o3, "Scope");
+ },
+ o3
+ );
+ a.deep(o2, o);
+
+ arr = [];
+ o2 = {};
+ i = -1;
+ t(
+ o,
+ function (value, name, self, index) {
+ arr.push(value);
+ o2[name] = value;
+ a(index, ++i, "Index");
+ a(self, o, "Self");
+ a(this, o3, "Scope");
+ },
+ o3,
+ function (a, b) { return o[b] - o[a]; }
+ );
+ a.deep(o2, o, "Sort by Values: Content");
+ a.deep(arr, [3, 2, 1], "Sort by Values: Order");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/assign-deep.js b/Nodejs/node_modules/es5-ext/test/object/assign-deep.js
new file mode 100644
index 0000000..962ac40
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/assign-deep.js
@@ -0,0 +1,27 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o1 = { a: 1, b: 2 }, o2 = { b: 3, c: 4 };
+
+ a(t(o1, o2), o1, "Returns self");
+ a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content");
+
+ a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument");
+
+ var obj1 = { foo: { bar: 3, marko: true } }
+ , obj2 = { foo: { elo: 12, marko: false }, miszka: [23] };
+
+ var copyObj1 = JSON.parse(JSON.stringify(obj1)), copyObj2 = JSON.parse(JSON.stringify(obj2));
+ a.deep(t({}, obj1, obj2), { foo: { bar: 3, marko: false, elo: 12 }, miszka: [23] });
+ // Ensure it's side effects free
+ a.deep(obj1, copyObj1);
+ a.deep(obj2, copyObj2);
+
+ obj1 = [{ foo: "bar" }];
+ var assignedObj = [];
+ t(assignedObj, obj1);
+ a.deep(assignedObj, [{ foo: "bar" }]);
+ // Ensure array items are copied and not passed
+ a.not(assignedObj[0], obj1[0]);
+ a(t(true), true);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/assign/implement.js b/Nodejs/node_modules/es5-ext/test/object/assign/implement.js
new file mode 100644
index 0000000..f5cd3a6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/assign/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../object/assign/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/assign/index.js b/Nodejs/node_modules/es5-ext/test/object/assign/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/assign/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/object/assign/is-implemented.js b/Nodejs/node_modules/es5-ext/test/object/assign/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/assign/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/assign/shim.js b/Nodejs/node_modules/es5-ext/test/object/assign/shim.js
new file mode 100644
index 0000000..e86c1e7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/assign/shim.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o1 = { a: 1, b: 2 }, o2 = { b: 3, c: 4 };
+
+ a(t(o1, o2), o1, "Returns self");
+ a.deep(o1, { a: 1, b: 3, c: 4 }, "Single: content");
+
+ a.deep(t({}, o1, o2), { a: 1, b: 3, c: 4 }, "Multi argument");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/clear.js b/Nodejs/node_modules/es5-ext/test/object/clear.js
new file mode 100644
index 0000000..5735e79
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/clear.js
@@ -0,0 +1,13 @@
+"use strict";
+
+var isEmpty = require("../../object/is-empty");
+
+module.exports = function (t, a) {
+ var x = {};
+ a(t(x), x, "Empty: Returns same object");
+ a(isEmpty(x), true, "Empty: Not changed");
+ x.foo = "raz";
+ x.bar = "dwa";
+ a(t(x), x, "Same object");
+ a(isEmpty(x), true, "Emptied");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/compact.js b/Nodejs/node_modules/es5-ext/test/object/compact.js
new file mode 100644
index 0000000..bc3e6dc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/compact.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {}, y = {}, z;
+ z = t(x);
+ a.not(z, x, "Returns different object");
+ a.deep(z, {}, "Empty on empty");
+
+ x = { foo: "bar", a: 0, b: false, c: "", d: "0", e: null, bar: y, elo: undefined };
+ z = t(x);
+ a.deep(z, { foo: "bar", a: 0, b: false, c: "", d: "0", bar: y }, "Cleared null values");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/compare.js b/Nodejs/node_modules/es5-ext/test/object/compare.js
new file mode 100644
index 0000000..23cc511
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/compare.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var d = new Date();
+
+ a.ok(t(12, 3) > 0, "Numbers");
+ a.ok(t(2, 13) < 0, "Numbers #2");
+ a.ok(t("aaa", "aa") > 0, "Strings");
+ a.ok(t("aa", "ab") < 0, "Strings #2");
+ a(t("aa", "aa"), 0, "Strings same");
+ a(t(d, new Date(d.getTime())), 0, "Same date");
+ a.ok(t(d, new Date(d.getTime() + 1)) < 0, "Different date");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/copy-deep.js b/Nodejs/node_modules/es5-ext/test/object/copy-deep.js
new file mode 100644
index 0000000..9381383
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/copy-deep.js
@@ -0,0 +1,35 @@
+"use strict";
+
+var stringify = JSON.stringify;
+
+module.exports = function (t, a) {
+ var o = { 1: "raz", 2: "dwa", 3: "trzy" }, no = t(o);
+
+ a.not(no, o, "Return different object");
+ a(stringify(no), stringify(o), "Match properties and values");
+
+ o = {
+ foo: "bar",
+ raz: {
+ dwa: "dwa",
+ trzy: { cztery: "pięć", sześć: "siedem" },
+ osiem: {},
+ dziewięć: function () {}
+ },
+ dziesięć: 10,
+ jedenaście: ["raz", ["dwa", "trzy", { elo: "true" }]]
+ };
+ o.raz.rec = o;
+
+ no = t(o);
+ a.not(o.raz, no.raz, "Deep");
+ a.not(o.raz.trzy, no.raz.trzy, "Deep #2");
+ a(stringify(o.raz.trzy), stringify(no.raz.trzy), "Deep content");
+ a(no.raz.rec, no, "Recursive");
+ a.not(o.raz.osiem, no.raz.osiem, "Empty object");
+ a(o.raz["dziewięć"], no.raz["dziewięć"], "Function");
+ a.not(o["jedenaście"], no["jedenaście"]);
+ a.not(o["jedenaście"][1], no["jedenaście"][1]);
+ a.not(o["jedenaście"][1][2], no["jedenaście"][1][2]);
+ a(t(true), true);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/copy.js b/Nodejs/node_modules/es5-ext/test/object/copy.js
new file mode 100644
index 0000000..a5e2c34
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/copy.js
@@ -0,0 +1,30 @@
+"use strict";
+
+var stringify = JSON.stringify;
+
+module.exports = function (t, a) {
+ var o = { 1: "raz", 2: "dwa", 3: "trzy" }, no = t(o);
+
+ a.not(no, o, "Return different object");
+ a(stringify(no), stringify(o), "Match properties and values");
+
+ o = {
+ foo: "bar",
+ raz: {
+ dwa: "dwa",
+ trzy: { cztery: "pięć", sześć: "siedem" },
+ osiem: {},
+ dziewięć: function () {}
+ },
+ dziesięć: 10
+ };
+ o.raz.rec = o;
+
+ no = t(o);
+ a(o.raz, no.raz, "Shallow");
+
+ a.deep(t(o, ["foo"]), { foo: "bar" });
+ a.deep(t(Object.create(o), ["foo"]), { foo: "bar" });
+ a.deep(t(o, ["foo", "habla"]), { foo: "bar" });
+ a.deep(t(o, ["foo", "habla"], { ensure: true }), { foo: "bar", habla: undefined });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/count.js b/Nodejs/node_modules/es5-ext/test/object/count.js
new file mode 100644
index 0000000..041f91a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/count.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), 0, "Empty");
+ a(t({ raz: 1, dwa: null, trzy: undefined, cztery: 0 }), 4, "Some properties");
+ a(
+ t(
+ Object.defineProperties(
+ {}, { raz: { value: "raz" }, dwa: { value: "dwa", enumerable: true } }
+ )
+ ),
+ 1, "Some properties hidden"
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/create.js b/Nodejs/node_modules/es5-ext/test/object/create.js
new file mode 100644
index 0000000..220f417
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/create.js
@@ -0,0 +1,22 @@
+"use strict";
+
+var setPrototypeOf = require("../../object/set-prototype-of")
+ , getPrototypeOf = Object.getPrototypeOf;
+
+module.exports = function (t, a) {
+ var x = {}, obj;
+
+ a(getPrototypeOf(t(x)), x, "Normal object");
+ a(getPrototypeOf(t(null)), (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Null");
+
+ a.h1("Properties");
+ a.h2("Normal object");
+ a(getPrototypeOf((obj = t(x, { foo: { value: "bar" } }))), x, "Prototype");
+ a(obj.foo, "bar", "Property");
+ a.h2("Null");
+ a(
+ getPrototypeOf((obj = t(null, { foo: { value: "bar2" } }))),
+ (setPrototypeOf && setPrototypeOf.nullPolyfill) || null, "Prototype"
+ );
+ a(obj.foo, "bar2", "Property");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-array.js b/Nodejs/node_modules/es5-ext/test/object/ensure-array.js
new file mode 100644
index 0000000..6189d07
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-array.js
@@ -0,0 +1,23 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var arr = [];
+ a(t(arr), arr, "Array");
+ a(t(""), "", "String");
+ var args = (function () { return arguments; })();
+ a(t(args), args, "Arguments");
+ var arrayLike = { length: 0 };
+ a(t(arrayLike), arrayLike, "Array like");
+ a.throws(
+ function () {
+ t(function () {});
+ },
+ TypeError,
+ "Function"
+ );
+ a.throws(function () { t({}); }, TypeError, "Plain object");
+ a.throws(function () { t(/raz/); }, TypeError, "Regexp");
+ a.throws(function () { t(); }, TypeError, "No argument");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-finite-number.js b/Nodejs/node_modules/es5-ext/test/object/ensure-finite-number.js
new file mode 100644
index 0000000..77ac269
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-finite-number.js
@@ -0,0 +1,18 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a(t(0), 0, "Zero");
+ a.throws(function () { t(NaN); }, TypeError, "NaN");
+ a.throws(function () { t(Infinity); }, TypeError, "Infinity");
+ a(t(12), 12, "Number");
+ a(t(false), 0, "Boolean");
+ a(t(new Date(1000000)), 1000000, "Date");
+ a(t(new Number(2)), 2, "Number object");
+ a.throws(function () { t("asdfaf"); }, TypeError, "String");
+ a(t(""), 0, "Empty String");
+ if (typeof Symbol === "function") {
+ a.throws(function () { t(Symbol("test")); }, TypeError, "Symbol");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-integer.js b/Nodejs/node_modules/es5-ext/test/object/ensure-integer.js
new file mode 100644
index 0000000..c97d81a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-integer.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a(t(2), 2, "Number");
+ a(t(-2), -2, "Negative");
+ a.throws(function () { t(2.34); }, TypeError, "Float");
+ a(t("23"), 23, "Numeric string");
+ a.throws(function () { t(NaN); }, TypeError, "NaN");
+ a.throws(function () { t(Infinity); }, TypeError, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-natural-number-value.js b/Nodejs/node_modules/es5-ext/test/object/ensure-natural-number-value.js
new file mode 100644
index 0000000..16b0cdf
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-natural-number-value.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a(t(2), 2, "Number");
+ a.throws(function () { t(-2); }, TypeError, "Negative");
+ a.throws(function () { t(2.34); }, TypeError, "Float");
+ a(t("23"), 23, "Numeric string");
+ a.throws(function () { t(NaN); }, TypeError, "NaN");
+ a.throws(function () { t(Infinity); }, TypeError, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-natural-number.js b/Nodejs/node_modules/es5-ext/test/object/ensure-natural-number.js
new file mode 100644
index 0000000..861c595
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-natural-number.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a(t(null), 0, "Null");
+ a(t(2), 2, "Number");
+ a.throws(function () { t(-2); }, TypeError, "Negative");
+ a.throws(function () { t(2.34); }, TypeError, "Float");
+ a(t("23"), 23, "Numeric string");
+ a.throws(function () { t(NaN); }, TypeError, "NaN");
+ a.throws(function () { t(Infinity); }, TypeError, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-plain-function.js b/Nodejs/node_modules/es5-ext/test/object/ensure-plain-function.js
new file mode 100644
index 0000000..eeeae0f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-plain-function.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ // Just sanity checks, as logic is tested at isPlainFunction
+ var fn = function () {};
+ a(t(fn), fn, "Function");
+ a.throws(function () { t({}); }, TypeError, "Error");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-plain-object.js b/Nodejs/node_modules/es5-ext/test/object/ensure-plain-object.js
new file mode 100644
index 0000000..cc1d1fa
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-plain-object.js
@@ -0,0 +1,16 @@
+"use strict";
+
+module.exports = function (t, a) {
+ // Just sanity checks, as logic is tested at isPlainFunction
+ var obj = {};
+ a(t(obj), obj, "Reguar object instance");
+ obj = Object.create(null);
+ a(t(obj), obj, "Null prototype");
+ a.throws(
+ function () {
+ t(function () {});
+ },
+ TypeError,
+ "Error"
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-promise.js b/Nodejs/node_modules/es5-ext/test/object/ensure-promise.js
new file mode 100644
index 0000000..07f058e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-promise.js
@@ -0,0 +1,20 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var promise;
+ a.throws(function () { t(); }, TypeError);
+ a.throws(function () { t(null); }, TypeError);
+ a.throws(function () { t("promise"); }, TypeError);
+ a.throws(function () { t({}); }, TypeError);
+ a.throws(function () {
+ t(function () {});
+ }, TypeError);
+ a.throws(function () { t({ then: {} }); }, TypeError);
+ promise = { then: function () {} };
+ a(t(promise), promise);
+ promise = function () {};
+ promise.then = {};
+ a.throws(function () { t(promise); }, TypeError);
+ promise.then = function () {};
+ a(t(promise), promise);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/ensure-thenable.js b/Nodejs/node_modules/es5-ext/test/object/ensure-thenable.js
new file mode 100644
index 0000000..02be1ef
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/ensure-thenable.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ // Just sanity checks as proper tests are at isThenable
+ var thenable = { then: function () {} };
+
+ a.throws(function () { t({}); }, TypeError);
+ a(t(thenable), thenable);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/entries/implement.js b/Nodejs/node_modules/es5-ext/test/object/entries/implement.js
new file mode 100644
index 0000000..c367ee4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/entries/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../object/entries/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/entries/index.js b/Nodejs/node_modules/es5-ext/test/object/entries/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/entries/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/object/entries/is-implemented.js b/Nodejs/node_modules/es5-ext/test/object/entries/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/entries/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/entries/shim.js b/Nodejs/node_modules/es5-ext/test/object/entries/shim.js
new file mode 100644
index 0000000..eb7285a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/entries/shim.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.deep(t({ foo: "bar" }), [["foo", "bar"]], "Object");
+ a.deep(t("raz"), [["0", "r"], ["1", "a"], ["2", "z"]], "Primitive");
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Undefined");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/eq.js b/Nodejs/node_modules/es5-ext/test/object/eq.js
new file mode 100644
index 0000000..8cad90a
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/eq.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = {};
+ a(t(o, {}), false, "Different objects");
+ a(t(o, o), true, "Same objects");
+ a(t("1", "1"), true, "Same primitive");
+ a(t("1", 1), false, "Different primitive types");
+ a(t(NaN, NaN), true, "NaN");
+ a(t(0, 0), true, "0,0");
+ a(t(0, -0), true, "0,-0");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/every.js b/Nodejs/node_modules/es5-ext/test/object/every.js
new file mode 100644
index 0000000..81f4662
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/every.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var o = { 1: 1, 2: 2, 3: 3 };
+
+module.exports = function (t, a) {
+ var o2 = {};
+ t(o, function (value, name) {
+ o2[name] = value;
+ return true;
+ });
+ a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
+
+ a(t(o, function () { return true; }), true, "Succeeds");
+
+ a(t(o, function () { return false; }), false, "Fails");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/filter.js b/Nodejs/node_modules/es5-ext/test/object/filter.js
new file mode 100644
index 0000000..b9ff5e7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/filter.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.deep(t({ 1: 1, 2: 2, 3: 3, 4: 4 }, function (value) { return Boolean(value % 2); }), {
+ 1: 1,
+ 3: 3
+ });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/find-key.js b/Nodejs/node_modules/es5-ext/test/object/find-key.js
new file mode 100644
index 0000000..f580e1e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/find-key.js
@@ -0,0 +1,24 @@
+"use strict";
+
+var o = { 1: 1, 2: 2, 3: 3 };
+
+module.exports = function (t, a) {
+ var o2 = {}, i = 0;
+ t(o, function (value, name) {
+ o2[name] = value;
+ return false;
+ });
+ a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
+
+ a(
+ t(o, function () {
+ ++i;
+ return true;
+ }),
+ "1",
+ "Finds"
+ );
+ a(i, 1, "Stops iteration after condition is met");
+
+ a(t(o, function () { return false; }), undefined, "Fails");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/find.js b/Nodejs/node_modules/es5-ext/test/object/find.js
new file mode 100644
index 0000000..b0c6b81
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/find.js
@@ -0,0 +1,24 @@
+"use strict";
+
+var o = { 1: 1, 2: 2, 3: 3 };
+
+module.exports = function (t, a) {
+ var o2 = {}, i = 0;
+ t(o, function (value, name) {
+ o2[name] = value;
+ return false;
+ });
+ a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
+
+ a(
+ t(o, function () {
+ ++i;
+ return true;
+ }),
+ 1,
+ "Finds"
+ );
+ a(i, 1, "Stops iteration after condition is met");
+
+ a(t(o, function () { return false; }), undefined, "Fails");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/first-key.js b/Nodejs/node_modules/es5-ext/test/object/first-key.js
new file mode 100644
index 0000000..6010ba1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/first-key.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {}, y = Object.create(null);
+ a(t(x), null, "Normal: Empty");
+ a(t(y), null, "Null extension: Empty");
+ x.foo = "raz";
+ x.bar = 343;
+ a(["foo", "bar"].indexOf(t(x)) !== -1, true, "Normal");
+ y.elo = "foo";
+ y.mar = "wew";
+ a(["elo", "mar"].indexOf(t(y)) !== -1, true, "Null extension");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/flatten.js b/Nodejs/node_modules/es5-ext/test/object/flatten.js
new file mode 100644
index 0000000..efacd22
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/flatten.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.deep(t({ a: { aa: 1, ab: 2 }, b: { ba: 3, bb: 4 } }), { aa: 1, ab: 2, ba: 3, bb: 4 });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/for-each.js b/Nodejs/node_modules/es5-ext/test/object/for-each.js
new file mode 100644
index 0000000..4ba4887
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/for-each.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = { raz: 1, dwa: 2, trzy: 3 }, o2 = {};
+ a(t(o, function (value, name) { o2[name] = value; }), undefined, "Return");
+ a.deep(o2, o);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/get-property-names.js b/Nodejs/node_modules/es5-ext/test/object/get-property-names.js
new file mode 100644
index 0000000..89cfecc
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/get-property-names.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = { first: 1, second: 4 }, r1, r2;
+ o = Object.create(o, { third: { value: null } });
+ o.first = 2;
+ o = Object.create(o);
+ o.fourth = 3;
+
+ r1 = t(o);
+ r1.sort();
+ r2 = ["first", "second", "third", "fourth"].concat(
+ Object.getOwnPropertyNames(Object.prototype)
+ );
+ r2.sort();
+ a.deep(r1, r2);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-array-like.js b/Nodejs/node_modules/es5-ext/test/object/is-array-like.js
new file mode 100644
index 0000000..fed39b7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-array-like.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t([]), true, "Array");
+ a(t(""), true, "String");
+ a(t((function () { return arguments; })()), true, "Arguments");
+ a(t({ length: 0 }), true, "List object");
+ a(t(function () {}), false, "Function");
+ a(t({}), false, "Plain object");
+ a(t(/raz/), false, "Regexp");
+ a(t(), false, "No argument");
+ a(t(null), false, "Null");
+ a(t(undefined), false, "Undefined");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-callable.js b/Nodejs/node_modules/es5-ext/test/object/is-callable.js
new file mode 100644
index 0000000..415023e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-callable.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(function () {}), true, "Function");
+ a(t({}), false, "Object");
+ a(t(), false, "Undefined");
+ a(t(null), false, "Null");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-copy-deep.js b/Nodejs/node_modules/es5-ext/test/object/is-copy-deep.js
new file mode 100644
index 0000000..476ca74
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-copy-deep.js
@@ -0,0 +1,42 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x, y;
+
+ a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
+ a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, "Different property value");
+ a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, "Property only in source");
+ a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, "Property only in target");
+
+ a(t("raz", "dwa"), false, "String: diff");
+ a(t("raz", "raz"), true, "String: same");
+ a(t("32", 32), false, "String & Number");
+
+ a(t([1, "raz", true], [1, "raz", true]), true, "Array: same");
+ a(t([1, "raz", undefined], [1, "raz"]), false, "Array: diff");
+ a(t(["foo"], ["one"]), false, "Array: One value comparision");
+
+ x = { foo: { bar: { mar: {} } } };
+ y = { foo: { bar: { mar: {} } } };
+ a(t(x, y), true, "Deep");
+
+ a(t({ foo: { bar: { mar: "foo" } } }, { foo: { bar: { mar: {} } } }), false, "Deep: false");
+
+ x = { foo: { bar: { mar: {} } } };
+ x.rec = { foo: x };
+
+ y = { foo: { bar: { mar: {} } } };
+ y.rec = { foo: x };
+
+ a(t(x, y), true, "Object: Infinite Recursion: Same #1");
+
+ x.rec.foo = y;
+ a(t(x, y), true, "Object: Infinite Recursion: Same #2");
+
+ x.rec.foo = x;
+ y.rec.foo = y;
+ a(t(x, y), true, "Object: Infinite Recursion: Same #3");
+
+ y.foo.bar.mar = "raz";
+ a(t(x, y), false, "Object: Infinite Recursion: Diff");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-copy.js b/Nodejs/node_modules/es5-ext/test/object/is-copy.js
new file mode 100644
index 0000000..ffffd28
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-copy.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 3 }), true, "Same");
+ a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2, 3: 4 }), false, "Different property value");
+ a(t({ 1: 1, 2: 2, 3: 3 }, { 1: 1, 2: 2 }), false, "Property only in source");
+ a(t({ 1: 1, 2: 2 }, { 1: 1, 2: 2, 3: 4 }), false, "Property only in target");
+
+ a(t("raz", "dwa"), false, "String: diff");
+ a(t("raz", "raz"), true, "String: same");
+ a(t("32", 32), false, "String & Number");
+
+ a(t([1, "raz", true], [1, "raz", true]), true, "Array: same");
+ a(t([1, "raz", undefined], [1, "raz"]), false, "Array: diff");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-empty.js b/Nodejs/node_modules/es5-ext/test/object/is-empty.js
new file mode 100644
index 0000000..067b162
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-empty.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), true, "Empty");
+ a(t({ 1: 1 }), false, "Not empty");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-finite-number.js b/Nodejs/node_modules/es5-ext/test/object/is-finite-number.js
new file mode 100644
index 0000000..6475fb6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-finite-number.js
@@ -0,0 +1,18 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(0), true, "Zero");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+ a(t(12), true, "Number");
+ a(t(false), true, "Boolean");
+ a(t(new Date()), true, "Date");
+ a(t(new Number(2)), true, "Number object");
+ a(t("asdfaf"), false, "String");
+ a(t(""), true, "Empty String");
+ if (typeof Symbol === "function") {
+ a(t(Symbol("test")), false, "Symbol");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-integer.js b/Nodejs/node_modules/es5-ext/test/object/is-integer.js
new file mode 100644
index 0000000..a0bcd5c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-integer.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(2), true, "Number");
+ a(t(-2), true, "Negative");
+ a(t(2.34), false, "Float");
+ a(t("23"), true, "Numeric string");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-natural-number-value.js b/Nodejs/node_modules/es5-ext/test/object/is-natural-number-value.js
new file mode 100644
index 0000000..2bc2b1c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-natural-number-value.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(2), true, "Number");
+ a(t(-2), false, "Negative");
+ a(t(2.34), false, "Float");
+ a(t("23"), true, "Numeric string");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-natural-number.js b/Nodejs/node_modules/es5-ext/test/object/is-natural-number.js
new file mode 100644
index 0000000..bb110e6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-natural-number.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), true, "Null");
+ a(t(2), true, "Number");
+ a(t(-2), false, "Negative");
+ a(t(2.34), false, "Float");
+ a(t("23"), true, "Numeric string");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), false, "Infinity");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-number-value.js b/Nodejs/node_modules/es5-ext/test/object/is-number-value.js
new file mode 100644
index 0000000..2c09d25
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-number-value.js
@@ -0,0 +1,18 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(0), true, "Zero");
+ a(t(NaN), false, "NaN");
+ a(t(Infinity), true, "Infinity");
+ a(t(12), true, "Number");
+ a(t(false), true, "Boolean");
+ a(t(new Date()), true, "Date");
+ a(t(new Number(2)), true, "Number object");
+ a(t("asdfaf"), false, "String");
+ a(t(""), true, "Empty String");
+ if (typeof Symbol === "function") {
+ a(t(Symbol("test")), false, "Symbol");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-object.js b/Nodejs/node_modules/es5-ext/test/object/is-object.js
new file mode 100644
index 0000000..0b83599
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-object.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t("arar"), false, "String");
+ a(t(12), false, "Number");
+ a(t(true), false, "Boolean");
+ a(t(null), false, "Null");
+ a(t(new Date()), true, "Date");
+ a(t(new String("raz")), true, "String object");
+ a(t({}), true, "Plain object");
+ a(t(/a/), true, "Regular expression");
+ a(t(function () {}), true, "Function");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-plain-function.js b/Nodejs/node_modules/es5-ext/test/object/is-plain-function.js
new file mode 100644
index 0000000..ded7fa0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-plain-function.js
@@ -0,0 +1,39 @@
+"use strict";
+
+var setPrototypeOf = require("../../object/set-prototype-of");
+
+module.exports = function (t, a) {
+ a(t(function () {}), true, "Function");
+ a(t({}), false, "Object");
+ a(t(), false, "Undefined");
+ a(t(null), false, "Null");
+ if (setPrototypeOf) {
+ a(
+ t(Object.setPrototypeOf(function () {}, Object.prototype)), false,
+ "Function with non-function prototype"
+ );
+ }
+ var arrowfn;
+ try { arrowfn = eval("(() => {})"); }
+ catch (e) {}
+ if (arrowfn) {
+ a(t(arrowfn), true, "Arrow function");
+ }
+
+ var classFn;
+ try { classFn = eval("(class {})"); }
+ catch (e) {}
+ if (classFn) {
+ a(t(classFn), false, "Class");
+ }
+
+ var commentedClassFn;
+ try {
+ // Follows issue reported to ljhard/is-callable project:
+ // https://github.com/ljharb/is-callable/issues/4
+ commentedClassFn = eval("(class/*kkk*/\n//blah\n Bar\n//blah\n {})");
+ } catch (e) {}
+ if (commentedClassFn) {
+ a(t(commentedClassFn, false, "Class"), false, "Class with comments");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-plain-object.js b/Nodejs/node_modules/es5-ext/test/object/is-plain-object.js
new file mode 100644
index 0000000..60ac132
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-plain-object.js
@@ -0,0 +1,23 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t({}), true, "Empty {} is plain object");
+ a(t({ a: true }), true, "{} with property is plain object");
+ a(
+ t({ prototype: 1, constructor: 2, __proto__: 3 }), true,
+ "{} with any property keys is plain object"
+ );
+ a(t(null), false, "Null is not plain object");
+ a(t("string"), false, "Primitive is not plain object");
+ a(t(function () {}), false, "Function is not plain object");
+ a(
+ t(Object.create({})), false,
+ "Object whose prototype is not Object.prototype is not plain object"
+ );
+ a(
+ t(Object.create(Object.prototype)), true,
+ "Object whose prototype is Object.prototype is plain object"
+ );
+ a(t(Object.create(null)), true, "Object whose prototype is null is plain object");
+ a(t(Object.prototype), false, "Object.prototype");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-promise.js b/Nodejs/node_modules/es5-ext/test/object/is-promise.js
new file mode 100644
index 0000000..18bf934
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-promise.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var promise;
+ a(t(), false);
+ a(t(null), false);
+ a(t("promise"), false);
+ a(t({}), false);
+ a(t(function () {}), false);
+ a(t({ then: {} }), false);
+ a(t({ then: function () {} }), true);
+ promise = function () {};
+ promise.then = {};
+ a(t(promise), false);
+ promise.then = function () {};
+ a(t(promise), true);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-thenable.js b/Nodejs/node_modules/es5-ext/test/object/is-thenable.js
new file mode 100644
index 0000000..18bf934
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-thenable.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var promise;
+ a(t(), false);
+ a(t(null), false);
+ a(t("promise"), false);
+ a(t({}), false);
+ a(t(function () {}), false);
+ a(t({ then: {} }), false);
+ a(t({ then: function () {} }), true);
+ promise = function () {};
+ promise.then = {};
+ a(t(promise), false);
+ promise.then = function () {};
+ a(t(promise), true);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is-value.js b/Nodejs/node_modules/es5-ext/test/object/is-value.js
new file mode 100644
index 0000000..c97722d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is-value.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(), false);
+ a(t(undefined), false);
+ a(t(null), false);
+ a(t(NaN), true);
+ a(t(0), true);
+ a(t(false), true);
+ a(t("null"), true);
+ a(t(""), true);
+ a(t({}), true);
+ a(t(Object.prototype), true);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/is.js b/Nodejs/node_modules/es5-ext/test/object/is.js
new file mode 100644
index 0000000..c94ed41
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/is.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = {};
+ a(t(o, {}), false, "Different objects");
+ a(t(o, o), true, "Same objects");
+ a(t("1", "1"), true, "Same primitive");
+ a(t("1", 1), false, "Different primitive types");
+ a(t(NaN, NaN), true, "NaN");
+ a(t(0, 0), true, "0,0");
+ a(t(0, -0), false, "0,-0");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/key-of.js b/Nodejs/node_modules/es5-ext/test/object/key-of.js
new file mode 100644
index 0000000..cd75ae5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/key-of.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x = {}, y = {}, o = { foo: "bar", raz: x, trzy: "cztery", five: "6" };
+
+ a(t(o, "bar"), "foo", "First property");
+ a(t(o, 6), null, "Primitive that's not there");
+ a(t(o, x), "raz", "Object");
+ a(t(o, y), null, "Object that's not there");
+ a(t(o, "6"), "five", "Last property");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/keys/implement.js b/Nodejs/node_modules/es5-ext/test/object/keys/implement.js
new file mode 100644
index 0000000..3134886
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/keys/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../object/keys/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/keys/index.js b/Nodejs/node_modules/es5-ext/test/object/keys/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/keys/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/object/keys/is-implemented.js b/Nodejs/node_modules/es5-ext/test/object/keys/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/keys/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/keys/shim.js b/Nodejs/node_modules/es5-ext/test/object/keys/shim.js
new file mode 100644
index 0000000..dc09f46
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/keys/shim.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.deep(t({ foo: "bar" }), ["foo"], "Object");
+ a.deep(t("raz"), ["0", "1", "2"], "Primitive");
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Undefined");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/map-keys.js b/Nodejs/node_modules/es5-ext/test/object/map-keys.js
new file mode 100644
index 0000000..3dc9298
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/map-keys.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.deep(t({ 1: 1, 2: 2, 3: 3 }, function (key, value) { return "x" + (key + value); }), {
+ x11: 1,
+ x22: 2,
+ x33: 3
+ });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/map.js b/Nodejs/node_modules/es5-ext/test/object/map.js
new file mode 100644
index 0000000..c472575
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/map.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var obj = { 1: 1, 2: 2, 3: 3 };
+ a.deep(
+ t(obj, function (value, key, context) {
+ a(context, obj, "Context argument");
+ return value + 1 + key;
+ }),
+ { 1: "21", 2: "32", 3: "43" }
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/mixin-prototypes.js b/Nodejs/node_modules/es5-ext/test/object/mixin-prototypes.js
new file mode 100644
index 0000000..f510afb
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/mixin-prototypes.js
@@ -0,0 +1,68 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o, o1, o2, x, y = {}, z = {};
+ o = { inherited: true, visible: 23 };
+ o1 = Object.create(o);
+ o1.visible = z;
+ o1.nonremovable = "raz";
+ Object.defineProperty(o1, "hidden", { value: "hidden" });
+
+ o2 = Object.defineProperties({}, { nonremovable: { value: y } });
+ o2.other = "other";
+
+ try { t(o2, o1); }
+ catch (ignore) {}
+
+ a(o2.visible, z, "Enumerable");
+ a(o1.hidden, "hidden", "Not Enumerable");
+ a(o2.propertyIsEnumerable("visible"), true, "Enumerable is enumerable");
+ a(o2.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable");
+
+ a(o2.inherited, true, "Extend deep");
+
+ a(o2.nonremovable, y, "Do not overwrite non configurable");
+ a(o2.other, "other", "Own kept");
+
+ x = {};
+ t(x, o2);
+ try { t(x, o1); }
+ catch (ignore) {}
+
+ a(x.visible, z, "Enumerable");
+ a(x.hidden, "hidden", "Not Enumerable");
+ a(x.propertyIsEnumerable("visible"), true, "Enumerable is enumerable");
+ a(x.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable");
+
+ a(x.inherited, true, "Extend deep");
+
+ a(x.nonremovable, y, "Ignored non configurable");
+ a(x.other, "other", "Other");
+
+ x.visible = 3;
+ a(x.visible, 3, "Writable is writable");
+
+ x = {};
+ t(x, o1);
+ a.throws(function () { x.hidden = 3; }, "Not writable is not writable");
+
+ x = {};
+ t(x, o1);
+ delete x.visible;
+ a.ok(!x.hasOwnProperty("visible"), "Configurable is configurable");
+
+ x = {};
+ t(x, o1);
+ a.throws(function () { delete x.hidden; }, "Not configurable is not configurable");
+
+ x = Object.defineProperty({}, "foo", {
+ configurable: false,
+ writable: true,
+ enumerable: false,
+ value: "bar"
+ });
+
+ try { t(x, { foo: "lorem" }); }
+ catch (ignore) {}
+ a(x.foo, "bar", "Writable, not enumerable");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/mixin.js b/Nodejs/node_modules/es5-ext/test/object/mixin.js
new file mode 100644
index 0000000..4195d03
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/mixin.js
@@ -0,0 +1,70 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o, o1, o2, x, y = {}, z = {};
+ o = { inherited: true };
+ o1 = Object.create(o);
+ o1.visible = z;
+ o1.nonremovable = "raz";
+ Object.defineProperty(o1, "hidden", { value: "hidden" });
+
+ o2 = Object.defineProperties({}, { nonremovable: { value: y } });
+ o2.other = "other";
+
+ try { t(o2, o1); }
+ catch (ignore) {}
+
+ a(o2.visible, z, "Enumerable");
+ a(o1.hidden, "hidden", "Not Enumerable");
+ a(o2.propertyIsEnumerable("visible"), true, "Enumerable is enumerable");
+ a(o2.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable");
+
+ a(o2.hasOwnProperty("inherited"), false, "Extend only own");
+ a(o2.inherited, undefined, "Extend ony own: value");
+
+ a(o2.nonremovable, y, "Do not overwrite non configurable");
+ a(o2.other, "other", "Own kept");
+
+ x = {};
+ t(x, o2);
+ try { t(x, o1); }
+ catch (ignore) {}
+
+ a(x.visible, z, "Enumerable");
+ a(x.hidden, "hidden", "Not Enumerable");
+ a(x.propertyIsEnumerable("visible"), true, "Enumerable is enumerable");
+ a(x.propertyIsEnumerable("hidden"), false, "Not enumerable is not enumerable");
+
+ a(x.hasOwnProperty("inherited"), false, "Extend only own");
+ a(x.inherited, undefined, "Extend ony own: value");
+
+ a(x.nonremovable, y, "Ignored non configurable");
+ a(x.other, "other", "Other");
+
+ x.visible = 3;
+ a(x.visible, 3, "Writable is writable");
+
+ x = {};
+ t(x, o1);
+ a.throws(function () { x.hidden = 3; }, "Not writable is not writable");
+
+ x = {};
+ t(x, o1);
+ delete x.visible;
+ a.ok(!x.hasOwnProperty("visible"), "Configurable is configurable");
+
+ x = {};
+ t(x, o1);
+ a.throws(function () { delete x.hidden; }, "Not configurable is not configurable");
+
+ x = Object.defineProperty({}, "foo", {
+ configurable: false,
+ writable: true,
+ enumerable: false,
+ value: "bar"
+ });
+
+ try { t(x, { foo: "lorem" }); }
+ catch (ignore) {}
+ a(x.foo, "bar", "Writable, not enumerable");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/normalize-options.js b/Nodejs/node_modules/es5-ext/test/object/normalize-options.js
new file mode 100644
index 0000000..74d3208
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/normalize-options.js
@@ -0,0 +1,55 @@
+"use strict";
+
+var create = Object.create, defineProperty = Object.defineProperty;
+
+module.exports = function (t, a) {
+ var x = { foo: "raz", bar: "dwa" }, y;
+ y = t(x);
+ a.not(y, x, "Returns copy");
+ a.deep(y, x, "Plain");
+
+ x = { raz: "one", dwa: "two" };
+ defineProperty(x, "get", {
+ configurable: true,
+ enumerable: true,
+ get: function () { return this.dwa; }
+ });
+ x = create(x);
+ x.trzy = "three";
+ x.cztery = "four";
+ x = create(x);
+ x.dwa = "two!";
+ x.trzy = "three!";
+ x.piec = "five";
+ x.szesc = "six";
+
+ a.deep(
+ t(x),
+ {
+ raz: "one",
+ dwa: "two!",
+ trzy: "three!",
+ cztery: "four",
+ piec: "five",
+ szesc: "six",
+ get: "two!"
+ },
+ "Deep object"
+ );
+
+ a.deep(
+ t({ marko: "raz", raz: "foo" }, x, { szesc: "elo", siedem: "bibg" }),
+ {
+ marko: "raz",
+ raz: "one",
+ dwa: "two!",
+ trzy: "three!",
+ cztery: "four",
+ piec: "five",
+ szesc: "elo",
+ siedem: "bibg",
+ get: "two!"
+ },
+ "Multiple options"
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/primitive-set.js b/Nodejs/node_modules/es5-ext/test/object/primitive-set.js
new file mode 100644
index 0000000..a0500ff
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/primitive-set.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var getPropertyNames = require("../../object/get-property-names")
+ , isPlainObject = require("../../object/is-plain-object");
+
+module.exports = function (t, a) {
+ var x = t();
+ a(isPlainObject(x), true, "Plain object");
+ a.deep(getPropertyNames(x), [], "No properties");
+ x.foo = "bar";
+ a.deep(getPropertyNames(x), ["foo"], "Extensible");
+
+ a.deep(t("raz", "dwa", 3), { raz: true, dwa: true, 3: true }, "Arguments handling");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/safe-traverse.js b/Nodejs/node_modules/es5-ext/test/object/safe-traverse.js
new file mode 100644
index 0000000..acf49c0
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/safe-traverse.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var obj = { foo: { bar: { lorem: 12 } } };
+ a(t(obj), obj, "No props");
+ a(t(obj, "foo"), obj.foo, "One");
+ a(t(obj, "raz"), undefined, "One: Fail");
+ a(t(obj, "foo", "bar"), obj.foo.bar, "Two");
+ a(t(obj, "dsd", "raz"), undefined, "Two: Fail #1");
+ a(t(obj, "foo", "raz"), undefined, "Two: Fail #2");
+ a(t(obj, "foo", "bar", "lorem"), obj.foo.bar.lorem, "Three");
+ a(t(obj, "dsd", "raz", "fef"), undefined, "Three: Fail #1");
+ a(t(obj, "foo", "raz", "asdf"), undefined, "Three: Fail #2");
+ a(t(obj, "foo", "bar", "asd"), undefined, "Three: Fail #3");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/serialize.js b/Nodejs/node_modules/es5-ext/test/object/serialize.js
new file mode 100644
index 0000000..513cd61
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/serialize.js
@@ -0,0 +1,43 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var fn = function (raz, dwa) { return raz + dwa; };
+ a(t(), "undefined", "Undefined");
+ a(t(null), "null", "Null");
+ a(t(null), "null", "Null");
+ a(t("raz"), "\"raz\"", "String");
+ a(t("raz\"ddwa\ntrzy"), "\"raz\\\"ddwa\\ntrzy\"", "String with escape");
+ a(t(false), "false", "Booelean");
+ a(t(fn), String(fn), "Function");
+
+ a(t(/raz-dwa/g), "/raz-dwa/g", "RegExp");
+ a(t(new Date(1234567)), "new Date(1234567)", "Date");
+ a(t([]), "[]", "Empty array");
+ a(
+ t([undefined, false, null, "raz\"ddwa\ntrzy", fn, /raz/g, new Date(1234567), ["foo"]]),
+ "[undefined,false,null,\"raz\\\"ddwa\\ntrzy\"," +
+ String(fn) +
+ ",/raz/g,new Date(1234567),[\"foo\"]]",
+ "Rich Array"
+ );
+ a(t({}), "{}", "Empty object");
+ a(
+ t({
+ raz: undefined,
+ dwa: false,
+ trzy: null,
+ cztery: "raz\"ddwa\ntrzy",
+ piec: fn,
+ szesc: /raz/g,
+ siedem: new Date(1234567),
+ osiem: ["foo", 32],
+ dziewiec: { foo: "bar", dwa: 343 }
+ }),
+ "{\"raz\":undefined,\"dwa\":false,\"trzy\":null,\"cztery\":\"raz\\\"ddwa\\ntrzy\"," +
+ "\"piec\":" +
+ String(fn) +
+ ",\"szesc\":/raz/g,\"siedem\":new Date(1234567),\"osiem\":[\"foo\",32]," +
+ "\"dziewiec\":{\"foo\":\"bar\",\"dwa\":343}}",
+ "Rich object"
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/implement.js b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/implement.js
new file mode 100644
index 0000000..3dde326
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/implement.js
@@ -0,0 +1,6 @@
+"use strict";
+
+var create = require("../../../object/create")
+ , isImplemented = require("../../../object/set-prototype-of/is-implemented");
+
+module.exports = function (a) { a(isImplemented(create), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/index.js b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/index.js
new file mode 100644
index 0000000..1abc7f9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/index.js
@@ -0,0 +1,22 @@
+"use strict";
+
+var create = require("../../../object/create")
+ , getPrototypeOf = Object.getPrototypeOf;
+
+module.exports = function (t, a) {
+ var x = {}, y = {};
+
+ if (t === null) return;
+ a(t(x, y), x, "Return self object");
+ a(getPrototypeOf(x), y, "Object");
+ a.throws(function () { t(x); }, TypeError, "Undefined");
+ a.throws(function () { t("foo"); }, TypeError, "Primitive");
+ a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null");
+ x = create(null);
+ a.h1("Change null prototype");
+ a(t(x, y), x, "Result");
+ a(getPrototypeOf(x), y, "Prototype");
+ a.h1("Set null prototype");
+ a(t(y, null), y, "Result");
+ a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/shim.js b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/shim.js
new file mode 100644
index 0000000..1abc7f9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/set-prototype-of/shim.js
@@ -0,0 +1,22 @@
+"use strict";
+
+var create = require("../../../object/create")
+ , getPrototypeOf = Object.getPrototypeOf;
+
+module.exports = function (t, a) {
+ var x = {}, y = {};
+
+ if (t === null) return;
+ a(t(x, y), x, "Return self object");
+ a(getPrototypeOf(x), y, "Object");
+ a.throws(function () { t(x); }, TypeError, "Undefined");
+ a.throws(function () { t("foo"); }, TypeError, "Primitive");
+ a(getPrototypeOf(t(x, null)), t.nullPolyfill || null, "Null");
+ x = create(null);
+ a.h1("Change null prototype");
+ a(t(x, y), x, "Result");
+ a(getPrototypeOf(x), y, "Prototype");
+ a.h1("Set null prototype");
+ a(t(y, null), y, "Result");
+ a(getPrototypeOf(y), t.nullPolyfill || null, "Prototype");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/some.js b/Nodejs/node_modules/es5-ext/test/object/some.js
new file mode 100644
index 0000000..4c6569f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/some.js
@@ -0,0 +1,24 @@
+"use strict";
+
+var o = { 1: 1, 2: 2, 3: 3 };
+
+module.exports = function (t, a) {
+ var o2 = {}, i = 0;
+ t(o, function (value, name) {
+ o2[name] = value;
+ return false;
+ });
+ a(JSON.stringify(o2), JSON.stringify(o), "Iterates");
+
+ a(
+ t(o, function () {
+ ++i;
+ return true;
+ }),
+ true,
+ "Succeeds"
+ );
+ a(i, 1, "Stops iteration after condition is met");
+
+ a(t(o, function () { return false; }), false, "Fails");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/to-array.js b/Nodejs/node_modules/es5-ext/test/object/to-array.js
new file mode 100644
index 0000000..478e0d8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/to-array.js
@@ -0,0 +1,18 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var o = { 1: 1, 2: 2, 3: 3 }
+ , o1 = {}
+ , o2 = t(
+ o,
+ function (value, name, self) {
+ a(self, o, "Self");
+ a(this, o1, "Scope");
+ return value + Number(name);
+ },
+ o1
+ );
+ a.deep(o2, [2, 4, 6]);
+
+ t(o).sort().forEach(function (item) { a.deep(item, [item[0], o[item[0]]], "Default"); });
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/unserialize.js b/Nodejs/node_modules/es5-ext/test/object/unserialize.js
new file mode 100644
index 0000000..b25fe2e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/unserialize.js
@@ -0,0 +1,39 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var fn = function (raz, dwa) { return raz + dwa; };
+ a(t("undefined"), undefined, "Undefined");
+ a(t("null"), null, "Null");
+ a(t("\"raz\""), "raz", "String");
+ a(t("\"raz\\\"ddwa\\ntrzy\""), "raz\"ddwa\ntrzy", "String with escape");
+ a(t("false"), false, "Booelean");
+ a(String(t(String(fn))), String(fn), "Function");
+
+ a.deep(t("/raz-dwa/g"), /raz-dwa/g, "RegExp");
+ a.deep(t("new Date(1234567)"), new Date(1234567), "Date");
+ a.deep(t("[]"), [], "Empty array");
+ a.deep(
+ t("[undefined,false,null,\"raz\\\"ddwa\\ntrzy\",/raz/g,new Date(1234567),[\"foo\"]]"),
+ [undefined, false, null, "raz\"ddwa\ntrzy", /raz/g, new Date(1234567), ["foo"]],
+ "Rich Array"
+ );
+ a.deep(t("{}"), {}, "Empty object");
+ a.deep(
+ t(
+ "{\"raz\":undefined,\"dwa\":false,\"trzy\":null,\"cztery\":\"raz\\\"ddwa\\ntrzy\"," +
+ "\"szesc\":/raz/g,\"siedem\":new Date(1234567),\"osiem\":[\"foo\",32]," +
+ "\"dziewiec\":{\"foo\":\"bar\",\"dwa\":343}}"
+ ),
+ {
+ raz: undefined,
+ dwa: false,
+ trzy: null,
+ cztery: "raz\"ddwa\ntrzy",
+ szesc: /raz/g,
+ siedem: new Date(1234567),
+ osiem: ["foo", 32],
+ dziewiec: { foo: "bar", dwa: 343 }
+ },
+ "Rich object"
+ );
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/valid-callable.js b/Nodejs/node_modules/es5-ext/test/object/valid-callable.js
new file mode 100644
index 0000000..699e9f3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/valid-callable.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var f = function () {};
+ a(t(f), f, "Function");
+ a.throws(function () { t({}); }, "Not Function");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/valid-object.js b/Nodejs/node_modules/es5-ext/test/object/valid-object.js
new file mode 100644
index 0000000..2fc2a3d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/valid-object.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a.throws(function () { t(0); }, TypeError, "0");
+ a.throws(function () { t(false); }, TypeError, "false");
+ a.throws(function () { t(""); }, TypeError, "''");
+ a(t((x = {})), x, "Object");
+ a(t((x = function () {})), x, "Function");
+ a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore
+ a(t((x = new Date())), x, "Date");
+
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "null");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/valid-value.js b/Nodejs/node_modules/es5-ext/test/object/valid-value.js
new file mode 100644
index 0000000..ef11c20
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/valid-value.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var numIsNaN = require("../../number/is-nan");
+
+module.exports = function (t, a) {
+ var x;
+ a(t(0), 0, "0");
+ a(t(false), false, "false");
+ a(t(""), "", "''");
+ a(numIsNaN(t(NaN)), true, "NaN");
+ a(t((x = {})), x, "{}");
+
+ a.throws(function () { t(); }, "Undefined");
+ a.throws(function () { t(null); }, "null");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/validate-array-like-object.js b/Nodejs/node_modules/es5-ext/test/object/validate-array-like-object.js
new file mode 100644
index 0000000..375483d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/validate-array-like-object.js
@@ -0,0 +1,21 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a.throws(function () { t(0); }, TypeError, "0");
+ a.throws(function () { t(false); }, TypeError, "false");
+ a.throws(function () { t(""); }, TypeError, "String");
+ a.throws(function () { t({}); }, TypeError, "Plain Object");
+ a.throws(
+ function () {
+ t(function () {});
+ },
+ TypeError,
+ "Function"
+ );
+ a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore
+
+ a(t((x = { length: 1 })), x, "Array like");
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "null");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/validate-array-like.js b/Nodejs/node_modules/es5-ext/test/object/validate-array-like.js
new file mode 100644
index 0000000..6592615
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/validate-array-like.js
@@ -0,0 +1,21 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a.throws(function () { t(0); }, TypeError, "0");
+ a.throws(function () { t(false); }, TypeError, "false");
+ a(t(""), "", "''");
+ a.throws(function () { t({}); }, TypeError, "Plain Object");
+ a.throws(
+ function () {
+ t(function () {});
+ },
+ TypeError,
+ "Function"
+ );
+ a(t((x = new String("raz"))), x, "String object"); // Jslint: ignore
+
+ a(t((x = { length: 1 })), x, "Array like");
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "null");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/validate-stringifiable-value.js b/Nodejs/node_modules/es5-ext/test/object/validate-stringifiable-value.js
new file mode 100644
index 0000000..5e09bcd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/validate-stringifiable-value.js
@@ -0,0 +1,16 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a.throws(function () { t(); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a(t(0), "0");
+ a(t(false), "false");
+ a(t(""), "");
+ a(t({}), String({}), "Object");
+ a(t((x = function () {})), String(x), "Function");
+ a(t((x = new String("raz"))), String(x), "String object"); // Jslint: ignore
+ a(t((x = new Date())), String(x), "Date");
+
+ a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/object/validate-stringifiable.js b/Nodejs/node_modules/es5-ext/test/object/validate-stringifiable.js
new file mode 100644
index 0000000..80bb60e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/object/validate-stringifiable.js
@@ -0,0 +1,16 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var x;
+ a(t(), "undefined", "Undefined");
+ a(t(null), "null", "Null");
+ a(t(0), "0");
+ a(t(false), "false");
+ a(t(""), "");
+ a(t({}), String({}), "Object");
+ a(t((x = function () {})), String(x), "Function");
+ a(t((x = new String("raz"))), String(x), "String object"); // Jslint: ignore
+ a(t((x = new Date())), String(x), "Date");
+
+ a.throws(function () { t(Object.create(null)); }, TypeError, "Null prototype object");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/optional-chaining.js b/Nodejs/node_modules/es5-ext/test/optional-chaining.js
new file mode 100644
index 0000000..1f7d405
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/optional-chaining.js
@@ -0,0 +1,17 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var obj = { foo: { bar: "elo", par: null } };
+ a(t(), undefined);
+ a(t(null), null);
+ a(t(obj), obj);
+ a(t(obj, "foo"), obj.foo);
+ a(t(obj, "foo", "bar"), "elo");
+ a(t(obj, "foo", "bar", "slice"), String.prototype.slice);
+ a(t(obj, "foo", "par"), null);
+ a(t(obj, "foo", "par", "marko"), undefined);
+ a(t(obj, "marko"), undefined);
+ a(t(""), "");
+ a(t("", "foo"), undefined);
+ a(t("", "slice"), String.prototype.slice);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/promise/#/as-callback.js b/Nodejs/node_modules/es5-ext/test/promise/#/as-callback.js
new file mode 100644
index 0000000..3d9cc0b
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/promise/#/as-callback.js
@@ -0,0 +1,25 @@
+"use strict";
+
+module.exports = function (t, a) {
+ if (typeof Promise !== "function") return null;
+ return {
+ Success: function (d) {
+ t.call(new Promise(function (resolve) { resolve("foo"); }), function (error, value) {
+ a(error, null);
+ a(value, "foo");
+ d();
+ });
+ },
+ Failure: function (d) {
+ var error = new Error("Rejection");
+ t.call(new Promise(function (resolve, reject) { reject(error); }), function (
+ passedError,
+ value
+ ) {
+ a(passedError, error);
+ a(value, undefined);
+ d();
+ });
+ }
+ };
+};
diff --git a/Nodejs/node_modules/es5-ext/test/promise/#/finally/implement.js b/Nodejs/node_modules/es5-ext/test/promise/#/finally/implement.js
new file mode 100644
index 0000000..9440186
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/promise/#/finally/implement.js
@@ -0,0 +1,7 @@
+"use strict";
+
+var isImplemented = require("../../../../promise/#/finally/is-implemented");
+
+if (typeof Promise !== "function") global.Promise = require("plain-promise");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/promise/#/finally/index.js b/Nodejs/node_modules/es5-ext/test/promise/#/finally/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/promise/#/finally/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/promise/#/finally/is-implemented.js b/Nodejs/node_modules/es5-ext/test/promise/#/finally/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/promise/#/finally/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/promise/#/finally/shim.js b/Nodejs/node_modules/es5-ext/test/promise/#/finally/shim.js
new file mode 100644
index 0000000..a92fab8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/promise/#/finally/shim.js
@@ -0,0 +1,75 @@
+"use strict";
+
+var microtaskDelay = require("../../../../function/#/microtask-delay");
+
+if (typeof Promise !== "function") global.Promise = require("plain-promise");
+
+module.exports = function (t, a) {
+ return {
+ Success: function (d) {
+ var invoked;
+ t.call(Promise.resolve("foo"), function () {
+ invoked = true;
+ return "bar";
+ }).then(
+ microtaskDelay.call(function (result) {
+ a(result, "foo");
+ a(invoked, true);
+ d();
+ }, microtaskDelay.call(d))
+ );
+ },
+ Failure: function (d) {
+ var invoked;
+ var error = new Error("Some error");
+ t.call(Promise.reject(error), function () {
+ invoked = true;
+ return "bar";
+ }).then(
+ microtaskDelay.call(function () {
+ a.never();
+ d();
+ }),
+ microtaskDelay.call(function (result) {
+ a(result, error);
+ a(invoked, true);
+ d();
+ })
+ );
+ },
+ SuccessFinallyError: function (d) {
+ var invoked, finallyError = new Error("Finally error");
+ t.call(Promise.resolve("foo"), function () {
+ invoked = true;
+ throw finallyError;
+ }).then(
+ microtaskDelay.call(function () {
+ a.never();
+ d();
+ }),
+ microtaskDelay.call(function (result) {
+ a(result, finallyError);
+ a(invoked, true);
+ d();
+ })
+ );
+ },
+ FailureFinallyError: function (d) {
+ var invoked, finallyError = new Error("Finally error");
+ t.call(Promise.reject(new Error("Some error")), function () {
+ invoked = true;
+ throw finallyError;
+ }).then(
+ microtaskDelay.call(function () {
+ a.never();
+ d();
+ }),
+ microtaskDelay.call(function (result) {
+ a(result, finallyError);
+ a(invoked, true);
+ d();
+ })
+ );
+ }
+ };
+};
diff --git a/Nodejs/node_modules/es5-ext/test/promise/.eslintrc.json b/Nodejs/node_modules/es5-ext/test/promise/.eslintrc.json
new file mode 100644
index 0000000..d2383fa
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/promise/.eslintrc.json
@@ -0,0 +1 @@
+{ "globals": { "Promise": true, "setTimeout": true } }
diff --git a/Nodejs/node_modules/es5-ext/test/promise/lazy.js b/Nodejs/node_modules/es5-ext/test/promise/lazy.js
new file mode 100644
index 0000000..f3109e8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/promise/lazy.js
@@ -0,0 +1,46 @@
+"use strict";
+
+module.exports = function (t) {
+ if (typeof Promise !== "function") return null; // Run tests only in ES2015+ env
+
+ return {
+ "Delays execution": function (a, d) {
+ var invoked = false;
+ var promise = t(function (resolve) {
+ invoked = true;
+ setTimeout(function () { resolve(20); }, 10);
+ });
+
+ a(invoked, false);
+
+ setTimeout(function () {
+ a(invoked, false);
+ promise.then(function (value) {
+ a(value, 20);
+ setTimeout(d, 0); // Escape error swallowing
+ });
+ a(invoked, true);
+ }, 15);
+ },
+ "Passes rejection": function (a, d) {
+ var promise = t(function (resolve, reject) {
+ setTimeout(function () { reject(new Error("Stop")); }, 10);
+ });
+
+ promise.catch(function (error) {
+ a(error instanceof Error, true);
+ a(error.message, "Stop");
+ setTimeout(d, 0); // Escape error swallowing
+ });
+ },
+ "Passes sync exception": function (a, d) {
+ var promise = t(function () { throw new Error("Stop"); });
+
+ promise.catch(function (error) {
+ a(error instanceof Error, true);
+ a(error.message, "Stop");
+ setTimeout(d, 0); // Escape error swallowing
+ });
+ }
+ };
+};
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/index.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/index.js
new file mode 100644
index 0000000..7ab9ab8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/index.js
@@ -0,0 +1,15 @@
+/* eslint-env node */
+
+"use strict";
+
+var indexTest = require("tad/lib/utils/index-test")
+ , path = require("path").resolve(__dirname, "../../../reg-exp/#");
+
+module.exports = function (t, a, d) {
+ indexTest(
+ indexTest.readDir(path).aside(function (data) {
+ delete data.sticky;
+ delete data.unicode;
+ })
+ )(t, a, d);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/is-sticky.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/is-sticky.js
new file mode 100644
index 0000000..e65740e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/is-sticky.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var re;
+ a(t.call(/raz/), false, "Normal");
+ a(t.call(/raz/g), false, "Global");
+ try {
+ // eslint-disable-next-line no-invalid-regexp
+ re = new RegExp("raz", "y");
+ } catch (ignore) {}
+ if (!re) return;
+ a(t.call(re), true, "Sticky");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/is-unicode.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/is-unicode.js
new file mode 100644
index 0000000..86217aa
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/is-unicode.js
@@ -0,0 +1,13 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var re;
+ a(t.call(/raz/), false, "Normal");
+ a(t.call(/raz/g), false, "Global");
+ try {
+ // eslint-disable-next-line no-invalid-regexp
+ re = new RegExp("raz", "u");
+ } catch (ignore) {}
+ if (!re) return;
+ a(t.call(re), true, "Unicode");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/implement.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/implement.js
new file mode 100644
index 0000000..e4da478
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../reg-exp/#/match/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/index.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/shim.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/shim.js
new file mode 100644
index 0000000..c6fedb5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/match/shim.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var result = "foobar".match(/foo/);
+ a.deep(t.call(/foo/, "foobar"), result);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/implement.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/implement.js
new file mode 100644
index 0000000..389cec9
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../reg-exp/#/replace/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/index.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/shim.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/shim.js
new file mode 100644
index 0000000..5c37e2e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/replace/shim.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(t.call(/foo/, "foobar", "mar"), "marbar"); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/implement.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/implement.js
new file mode 100644
index 0000000..1e7cb39
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../reg-exp/#/search/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/index.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/shim.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/shim.js
new file mode 100644
index 0000000..02ca0c8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/search/shim.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(t.call(/foo/, "barfoo"), 3); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/implement.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/implement.js
new file mode 100644
index 0000000..ef8ec4e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../reg-exp/#/split/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/index.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/shim.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/shim.js
new file mode 100644
index 0000000..824d48e
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/split/shim.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a.deep(t.call(/\|/, "bar|foo"), ["bar", "foo"]); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js
new file mode 100644
index 0000000..6d3ccb7
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../reg-exp/#/sticky/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js
new file mode 100644
index 0000000..00cf882
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../reg-exp/#/unicode/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js b/Nodejs/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/escape.js b/Nodejs/node_modules/es5-ext/test/reg-exp/escape.js
new file mode 100644
index 0000000..9478f52
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/escape.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var str = "(?:^te|er)s{2}t\\[raz]+$";
+ a(RegExp("^" + t(str) + "$").test(str), true);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/is-reg-exp.js b/Nodejs/node_modules/es5-ext/test/reg-exp/is-reg-exp.js
new file mode 100644
index 0000000..7727eab
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/is-reg-exp.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t("arar"), false, "String");
+ a(t(12), false, "Number");
+ a(t(true), false, "Boolean");
+ a(t(new Date()), false, "Date");
+ a(t(new String("raz")), false, "String object");
+ a(t({}), false, "Plain object");
+ a(t(/a/), true, "Regular expression");
+ a(t(new RegExp("a")), true, "Regular expression via constructor");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js b/Nodejs/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js
new file mode 100644
index 0000000..fea0c94
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js
@@ -0,0 +1,15 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var r = /raz/;
+ a(t(r), r, "Direct");
+ r = new RegExp("foo");
+ a(t(r), r, "Constructor");
+ a.throws(function () { t({}); }, "Object");
+ a.throws(function () {
+ t(function () {});
+ }, "Function");
+ a.throws(function () {
+ t({ exec: function () { return 20; } });
+ }, "Plain object");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/safe-to-string.js b/Nodejs/node_modules/es5-ext/test/safe-to-string.js
new file mode 100644
index 0000000..8f545e5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/safe-to-string.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(), "undefined");
+ a(t(null), "null");
+ a(t(10), "10");
+ a(t("str"), "str");
+ a(t({ toString: function () { return "miszka"; } }), "miszka");
+ // eslint-disable-next-line symbol-description
+ if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
+ a(t(Object.create(null)), "");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/implement.js b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/implement.js
new file mode 100644
index 0000000..8b269b5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../string/#/@@iterator/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/index.js b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/shim.js b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/shim.js
new file mode 100644
index 0000000..467cdc3
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/@@iterator/shim.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ var it = t.call("r💩z");
+ a.deep(it.next(), { done: false, value: "r" }, "#1");
+ a.deep(it.next(), { done: false, value: "💩" }, "#2");
+ a.deep(it.next(), { done: false, value: "z" }, "#3");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/at.js b/Nodejs/node_modules/es5-ext/test/string/#/at.js
new file mode 100644
index 0000000..2fe6e84
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/at.js
@@ -0,0 +1,97 @@
+/* eslint no-useless-call: "off" */
+// See tests at https://github.com/mathiasbynens/String.prototype.at
+
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.length, 1, "Length");
+
+ a.h1("BMP");
+ a(t.call("abc\uD834\uDF06def", -Infinity), "", "-Infinity");
+ a(t.call("abc\uD834\uDF06def", -1), "", "-1");
+ a(t.call("abc\uD834\uDF06def", -0), "a", "-0");
+ a(t.call("abc\uD834\uDF06def", +0), "a", "+0");
+ a(t.call("abc\uD834\uDF06def", 1), "b", "1");
+ a(t.call("abc\uD834\uDF06def", 3), "\uD834\uDF06", "3");
+ a(t.call("abc\uD834\uDF06def", 4), "\uDF06", "4");
+ a(t.call("abc\uD834\uDF06def", 5), "d", "5");
+ a(t.call("abc\uD834\uDF06def", 42), "", "42");
+ a(t.call("abc\uD834\uDF06def", Number(Infinity)), "", "+Infinity");
+ a(t.call("abc\uD834\uDF06def", null), "a", "null");
+ a(t.call("abc\uD834\uDF06def", undefined), "a", "undefined");
+ a(t.call("abc\uD834\uDF06def"), "a", "No argument");
+ a(t.call("abc\uD834\uDF06def", false), "a", "false");
+ a(t.call("abc\uD834\uDF06def", NaN), "a", "NaN");
+ a(t.call("abc\uD834\uDF06def", ""), "a", "Empty string");
+ a(t.call("abc\uD834\uDF06def", "_"), "a", "_");
+ a(t.call("abc\uD834\uDF06def", "1"), "b", "'1'");
+ a(t.call("abc\uD834\uDF06def", []), "a", "[]");
+ a(t.call("abc\uD834\uDF06def", {}), "a", "{}");
+ a(t.call("abc\uD834\uDF06def", -0.9), "a", "-0.9");
+ a(t.call("abc\uD834\uDF06def", 1.9), "b", "1.9");
+ a(t.call("abc\uD834\uDF06def", 7.9), "f", "7.9");
+ a(t.call("abc\uD834\uDF06def", Math.pow(2, 32)), "", "Big number");
+
+ a.h1("Astral symbol");
+ a(t.call("\uD834\uDF06def", -Infinity), "", "-Infinity");
+ a(t.call("\uD834\uDF06def", -1), "", "-1");
+ a(t.call("\uD834\uDF06def", -0), "\uD834\uDF06", "-0");
+ a(t.call("\uD834\uDF06def", +0), "\uD834\uDF06", "+0");
+ a(t.call("\uD834\uDF06def", 1), "\uDF06", "1");
+ a(t.call("\uD834\uDF06def", 2), "d", "2");
+ a(t.call("\uD834\uDF06def", 3), "e", "3");
+ a(t.call("\uD834\uDF06def", 4), "f", "4");
+ a(t.call("\uD834\uDF06def", 42), "", "42");
+ a(t.call("\uD834\uDF06def", Number(Infinity)), "", "+Infinity");
+ a(t.call("\uD834\uDF06def", null), "\uD834\uDF06", "null");
+ a(t.call("\uD834\uDF06def", undefined), "\uD834\uDF06", "undefined");
+ a(t.call("\uD834\uDF06def"), "\uD834\uDF06", "No arguments");
+ a(t.call("\uD834\uDF06def", false), "\uD834\uDF06", "false");
+ a(t.call("\uD834\uDF06def", NaN), "\uD834\uDF06", "NaN");
+ a(t.call("\uD834\uDF06def", ""), "\uD834\uDF06", "Empty string");
+ a(t.call("\uD834\uDF06def", "_"), "\uD834\uDF06", "_");
+ a(t.call("\uD834\uDF06def", "1"), "\uDF06", "'1'");
+
+ a.h1("Lone high surrogates");
+ a(t.call("\uD834abc", -Infinity), "", "-Infinity");
+ a(t.call("\uD834abc", -1), "", "-1");
+ a(t.call("\uD834abc", -0), "\uD834", "-0");
+ a(t.call("\uD834abc", +0), "\uD834", "+0");
+ a(t.call("\uD834abc", 1), "a", "1");
+ a(t.call("\uD834abc", 42), "", "42");
+ a(t.call("\uD834abc", Number(Infinity)), "", "Infinity");
+ a(t.call("\uD834abc", null), "\uD834", "null");
+ a(t.call("\uD834abc", undefined), "\uD834", "undefined");
+ a(t.call("\uD834abc"), "\uD834", "No arguments");
+ a(t.call("\uD834abc", false), "\uD834", "false");
+ a(t.call("\uD834abc", NaN), "\uD834", "NaN");
+ a(t.call("\uD834abc", ""), "\uD834", "Empty string");
+ a(t.call("\uD834abc", "_"), "\uD834", "_");
+ a(t.call("\uD834abc", "1"), "a", "'a'");
+
+ a.h1("Lone low surrogates");
+ a(t.call("\uDF06abc", -Infinity), "", "-Infinity");
+ a(t.call("\uDF06abc", -1), "", "-1");
+ a(t.call("\uDF06abc", -0), "\uDF06", "-0");
+ a(t.call("\uDF06abc", +0), "\uDF06", "+0");
+ a(t.call("\uDF06abc", 1), "a", "1");
+ a(t.call("\uDF06abc", 42), "", "42");
+ a(t.call("\uDF06abc", Number(Infinity)), "", "+Infinity");
+ a(t.call("\uDF06abc", null), "\uDF06", "null");
+ a(t.call("\uDF06abc", undefined), "\uDF06", "undefined");
+ a(t.call("\uDF06abc"), "\uDF06", "No arguments");
+ a(t.call("\uDF06abc", false), "\uDF06", "false");
+ a(t.call("\uDF06abc", NaN), "\uDF06", "NaN");
+ a(t.call("\uDF06abc", ""), "\uDF06", "Empty string");
+ a(t.call("\uDF06abc", "_"), "\uDF06", "_");
+ a(t.call("\uDF06abc", "1"), "a", "'1'");
+
+ a.h1("Context");
+ a.throws(function () { t.call(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t.call(undefined, 4); }, TypeError, "Undefined + argument");
+ a.throws(function () { t.call(null); }, TypeError, "Null");
+ a.throws(function () { t.call(null, 4); }, TypeError, "Null + argument");
+ a(t.call(42, 0), "4", "Number #1");
+ a(t.call(42, 1), "2", "Number #2");
+ a(t.call({ toString: function () { return "abc"; } }, 2), "c", "Object");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/Nodejs/node_modules/es5-ext/test/string/#/camel-to-hyphen.js
new file mode 100644
index 0000000..bbf9ae4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/camel-to-hyphen.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("razDwaTRzy4yFoo45My"), "raz-dwa-t-rzy4y-foo45-my");
+ a(t.call("razDwaTRzy4yFoo45My-"), "raz-dwa-t-rzy4y-foo45-my-");
+ a(t.call("razDwaTRzy4yFoo45My--"), "raz-dwa-t-rzy4y-foo45-my--");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/capitalize.js b/Nodejs/node_modules/es5-ext/test/string/#/capitalize.js
new file mode 100644
index 0000000..884ae9c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/capitalize.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("raz"), "Raz", "Word");
+ a(t.call("BLA"), "BLA", "Uppercase");
+ a(t.call(""), "", "Empty");
+ a(t.call("a"), "A", "One letter");
+ a(t.call("this is a test"), "This is a test", "Sentence");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/case-insensitive-compare.js b/Nodejs/node_modules/es5-ext/test/string/#/case-insensitive-compare.js
new file mode 100644
index 0000000..8117f92
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/case-insensitive-compare.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("AA", "aa"), 0, "Same");
+ a.ok(t.call("Amber", "zebra") < 0, "Less");
+ a.ok(t.call("Zebra", "amber") > 0, "Greater");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/implement.js b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/implement.js
new file mode 100644
index 0000000..9ce21f5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../string/#/code-point-at/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/index.js b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/shim.js b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/shim.js
new file mode 100644
index 0000000..a09e75c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/code-point-at/shim.js
@@ -0,0 +1,83 @@
+/* eslint no-useless-call: "off" */
+
+// Taken from: https://github.com/mathiasbynens/String.prototype.codePointAt
+// /blob/master/tests/tests.js
+
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.length, 1, "Length");
+
+ // String that starts with a BMP symbol
+ a(t.call("abc\uD834\uDF06def", ""), 0x61);
+ a(t.call("abc\uD834\uDF06def", "_"), 0x61);
+ a(t.call("abc\uD834\uDF06def"), 0x61);
+ a(t.call("abc\uD834\uDF06def", -Infinity), undefined);
+ a(t.call("abc\uD834\uDF06def", -1), undefined);
+ a(t.call("abc\uD834\uDF06def", -0), 0x61);
+ a(t.call("abc\uD834\uDF06def", 0), 0x61);
+ a(t.call("abc\uD834\uDF06def", 3), 0x1d306);
+ a(t.call("abc\uD834\uDF06def", 4), 0xdf06);
+ a(t.call("abc\uD834\uDF06def", 5), 0x64);
+ a(t.call("abc\uD834\uDF06def", 42), undefined);
+ a(t.call("abc\uD834\uDF06def", Infinity), undefined);
+ a(t.call("abc\uD834\uDF06def", Infinity), undefined);
+ a(t.call("abc\uD834\uDF06def", NaN), 0x61);
+ a(t.call("abc\uD834\uDF06def", false), 0x61);
+ a(t.call("abc\uD834\uDF06def", null), 0x61);
+ a(t.call("abc\uD834\uDF06def", undefined), 0x61);
+
+ // String that starts with an astral symbol
+ a(t.call("\uD834\uDF06def", ""), 0x1d306);
+ a(t.call("\uD834\uDF06def", "1"), 0xdf06);
+ a(t.call("\uD834\uDF06def", "_"), 0x1d306);
+ a(t.call("\uD834\uDF06def"), 0x1d306);
+ a(t.call("\uD834\uDF06def", -1), undefined);
+ a(t.call("\uD834\uDF06def", -0), 0x1d306);
+ a(t.call("\uD834\uDF06def", 0), 0x1d306);
+ a(t.call("\uD834\uDF06def", 1), 0xdf06);
+ a(t.call("\uD834\uDF06def", 42), undefined);
+ a(t.call("\uD834\uDF06def", false), 0x1d306);
+ a(t.call("\uD834\uDF06def", null), 0x1d306);
+ a(t.call("\uD834\uDF06def", undefined), 0x1d306);
+
+ // Lone high surrogates
+ a(t.call("\uD834abc", ""), 0xd834);
+ a(t.call("\uD834abc", "_"), 0xd834);
+ a(t.call("\uD834abc"), 0xd834);
+ a(t.call("\uD834abc", -1), undefined);
+ a(t.call("\uD834abc", -0), 0xd834);
+ a(t.call("\uD834abc", 0), 0xd834);
+ a(t.call("\uD834abc", false), 0xd834);
+ a(t.call("\uD834abc", NaN), 0xd834);
+ a(t.call("\uD834abc", null), 0xd834);
+ a(t.call("\uD834abc", undefined), 0xd834);
+
+ // Lone low surrogates
+ a(t.call("\uDF06abc", ""), 0xdf06);
+ a(t.call("\uDF06abc", "_"), 0xdf06);
+ a(t.call("\uDF06abc"), 0xdf06);
+ a(t.call("\uDF06abc", -1), undefined);
+ a(t.call("\uDF06abc", -0), 0xdf06);
+ a(t.call("\uDF06abc", 0), 0xdf06);
+ a(t.call("\uDF06abc", false), 0xdf06);
+ a(t.call("\uDF06abc", NaN), 0xdf06);
+ a(t.call("\uDF06abc", null), 0xdf06);
+ a(t.call("\uDF06abc", undefined), 0xdf06);
+
+ a.throws(function () { t.call(undefined); }, TypeError);
+ a.throws(function () { t.call(undefined, 4); }, TypeError);
+ a.throws(function () { t.call(null); }, TypeError);
+ a.throws(function () { t.call(null, 4); }, TypeError);
+ a(t.call(42, 0), 0x34);
+ a(t.call(42, 1), 0x32);
+ a(t.call({ toString: function () { return "abc"; } }, 2), 0x63);
+
+ a.throws(function () { t.apply(undefined); }, TypeError);
+ a.throws(function () { t.apply(undefined, [4]); }, TypeError);
+ a.throws(function () { t.apply(null); }, TypeError);
+ a.throws(function () { t.apply(null, [4]); }, TypeError);
+ a(t.apply(42, [0]), 0x34);
+ a(t.apply(42, [1]), 0x32);
+ a(t.apply({ toString: function () { return "abc"; } }, [2]), 0x63);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/contains/implement.js b/Nodejs/node_modules/es5-ext/test/string/#/contains/implement.js
new file mode 100644
index 0000000..7671495
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/contains/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../string/#/contains/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/contains/index.js b/Nodejs/node_modules/es5-ext/test/string/#/contains/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/contains/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/contains/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/#/contains/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/contains/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/contains/shim.js b/Nodejs/node_modules/es5-ext/test/string/#/contains/shim.js
new file mode 100644
index 0000000..0a73671
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/contains/shim.js
@@ -0,0 +1,14 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("raz", ""), true, "Empty");
+ a(t.call("", ""), true, "Both Empty");
+ a(t.call("raz", "raz"), true, "Same");
+ a(t.call("razdwa", "raz"), true, "Starts with");
+ a(t.call("razdwa", "dwa"), true, "Ends with");
+ a(t.call("razdwa", "zdw"), true, "In middle");
+ a(t.call("", "raz"), false, "Something in empty");
+ a(t.call("az", "raz"), false, "Longer");
+ a(t.call("azasdfasdf", "azff"), false, "Not found");
+ a(t.call("razdwa", "raz", 1), false, "Position");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/count.js b/Nodejs/node_modules/es5-ext/test/string/#/count.js
new file mode 100644
index 0000000..5e871e1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/count.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a.throws(function () { t.call("", ""); });
+ a(t.call("x", "x"), 1);
+ a(t.call("xx", "x"), 2);
+ a(t.call("xxx", "xx"), 1);
+ a(t.call("xxxx", "xx"), 2);
+ a(t.call("xx", "xxx"), 0);
+ a(t.call("", "elo"), 0);
+ a(t.call("fooo", "foofooo"), 0);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/ends-with/implement.js b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/implement.js
new file mode 100644
index 0000000..acca2b2
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../string/#/ends-with/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/ends-with/index.js b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/ends-with/shim.js b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/shim.js
new file mode 100644
index 0000000..7539883
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/ends-with/shim.js
@@ -0,0 +1,16 @@
+// In some parts copied from:
+// http://closure-library.googlecode.com/svn/trunk/closure/goog/
+// string/string_test.html
+
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("abc", ""), true, "Empty needle");
+ a(t.call("abcd", "cd"), true, "Ends with needle");
+ a(t.call("abcd", "abcd"), true, "Needle equals haystack");
+ a(t.call("abcd", "ab"), false, "Doesn't end with needle");
+ a(t.call("abc", "defg"), false, "Length trick");
+ a(t.call("razdwa", "zd", 3), false, "Position: false");
+ a(t.call("razdwa", "zd", 4), true, "Position: true");
+ a(t.call("razdwa", "zd", 5), false, "Position: false #2");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/Nodejs/node_modules/es5-ext/test/string/#/hyphen-to-camel.js
new file mode 100644
index 0000000..89c8161
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/hyphen-to-camel.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa"), "razDwaTRzy4yRtr4Tiu45Pa");
+ a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa-"), "razDwaTRzy4yRtr4Tiu45Pa-");
+ a(t.call("raz-dwa-t-rzy-4y-rtr4-tiu-45-pa--"), "razDwaTRzy4yRtr4Tiu45Pa--");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/indent.js b/Nodejs/node_modules/es5-ext/test/string/#/indent.js
new file mode 100644
index 0000000..bc0e5b5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/indent.js
@@ -0,0 +1,8 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("ra\nzz", ""), "ra\nzz", "Empty");
+ a(t.call("ra\nzz", "\t", 3), "\t\t\tra\n\t\t\tzz", "String repeat");
+ a(t.call("ra\nzz\nsss\nfff\n", "\t"), "\tra\n\tzz\n\tsss\n\tfff\n", "Multi-line");
+ a(t.call("ra\n\nzz\n", "\t"), "\tra\n\n\tzz\n", "Don't touch empty lines");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/last.js b/Nodejs/node_modules/es5-ext/test/string/#/last.js
new file mode 100644
index 0000000..fea798d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/last.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call(""), null, "Null");
+ a(t.call("abcdef"), "f", "String");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/normalize/_data.js b/Nodejs/node_modules/es5-ext/test/string/#/normalize/_data.js
new file mode 100644
index 0000000..43d74de
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/normalize/_data.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t[0], "object"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/normalize/implement.js b/Nodejs/node_modules/es5-ext/test/string/#/normalize/implement.js
new file mode 100644
index 0000000..49eebd1
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/normalize/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../string/#/normalize/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/normalize/index.js b/Nodejs/node_modules/es5-ext/test/string/#/normalize/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/normalize/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/normalize/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/#/normalize/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/normalize/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/normalize/shim.js b/Nodejs/node_modules/es5-ext/test/string/#/normalize/shim.js
new file mode 100644
index 0000000..0c80aa4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/normalize/shim.js
@@ -0,0 +1,13 @@
+// Taken from: https://github.com/walling/unorm/blob/master/test/es6-shim.js
+
+"use strict";
+
+var str = "äiti";
+
+module.exports = function (t, a) {
+ a(t.call(str), "\u00e4iti");
+ a(t.call(str, "NFC"), "\u00e4iti");
+ a(t.call(str, "NFD"), "a\u0308iti");
+ a(t.call(str, "NFKC"), "\u00e4iti");
+ a(t.call(str, "NFKD"), "a\u0308iti");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/pad.js b/Nodejs/node_modules/es5-ext/test/string/#/pad.js
new file mode 100644
index 0000000..e573453
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/pad.js
@@ -0,0 +1,24 @@
+"use strict";
+
+var partial = require("../../../function/#/partial");
+
+module.exports = {
+ Left: function (t, a) {
+ t = partial.call(t, "x", 5);
+
+ a(t.call("yy"), "xxxyy");
+ a(t.call(""), "xxxxx", "Empty string");
+
+ a(t.call("yyyyy"), "yyyyy", "Equal length");
+ a(t.call("yyyyyyy"), "yyyyyyy", "Longer");
+ },
+ Right: function (t, a) {
+ t = partial.call(t, "x", -5);
+
+ a(t.call("yy"), "yyxxx");
+ a(t.call(""), "xxxxx", "Empty string");
+
+ a(t.call("yyyyy"), "yyyyy", "Equal length");
+ a(t.call("yyyyyyy"), "yyyyyyy", "Longer");
+ }
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/plain-replace-all.js b/Nodejs/node_modules/es5-ext/test/string/#/plain-replace-all.js
new file mode 100644
index 0000000..54fdabd
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/plain-replace-all.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic");
+ a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts");
+ a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace");
+
+ a(t.call("$raz$$dwa$trzy$", "$", "&&"), "&&raz&&&&dwa&&trzy&&", "Multi");
+ a(t.call("$raz$$dwa$$$$trzy$", "$$", "&"), "$raz&dwa&&trzy$", "Multi many chars");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/plain-replace.js b/Nodejs/node_modules/es5-ext/test/string/#/plain-replace.js
new file mode 100644
index 0000000..9f6c2be
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/plain-replace.js
@@ -0,0 +1,7 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("razdwatrzy", "dwa", "olera"), "razoleratrzy", "Basic");
+ a(t.call("razdwatrzy", "dwa", "ole$&a"), "razole$&atrzy", "Inserts");
+ a(t.call("razdwa", "ola", "sdfs"), "razdwa", "No replace");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/repeat/implement.js b/Nodejs/node_modules/es5-ext/test/string/#/repeat/implement.js
new file mode 100644
index 0000000..554b975
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/repeat/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../string/#/repeat/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/repeat/index.js b/Nodejs/node_modules/es5-ext/test/string/#/repeat/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/repeat/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/repeat/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/#/repeat/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/repeat/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/repeat/shim.js b/Nodejs/node_modules/es5-ext/test/string/#/repeat/shim.js
new file mode 100644
index 0000000..c584884
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/repeat/shim.js
@@ -0,0 +1,12 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("a", 0), "", "Empty");
+ a(t.call("a", 1), "a", "1");
+ a(t.call("a", 2), "aa", "2");
+ a(t.call("\t", 5), "\t\t\t\t\t", "Whitespace");
+ a(t.call("raz", 3), "razrazraz", "Many chars");
+ a(t.call("raz", 3), "razrazraz", "Many chars");
+ a(t.call("razfoobar", 5), "razfoobarrazfoobarrazfoobarrazfoobarrazfoobar", "Many chars");
+ a(t.call("a", 300).length, 300);
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/starts-with/implement.js b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/implement.js
new file mode 100644
index 0000000..38371a8
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../../string/#/starts-with/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/starts-with/index.js b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/starts-with/shim.js b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/shim.js
new file mode 100644
index 0000000..4b5e4e4
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/starts-with/shim.js
@@ -0,0 +1,14 @@
+// Inspired and in some parts copied from:
+// http://closure-library.googlecode.com/svn/trunk/closure/goog
+// /string/string_test.html
+
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("abc", ""), true, "Empty needle");
+ a(t.call("abcd", "ab"), true, "Starts with needle");
+ a(t.call("abcd", "abcd"), true, "Needle equals haystack");
+ a(t.call("abcd", "bcde", 1), false, "Needle larger than haystack");
+ a(!t.call("abcd", "cd"), true, "Doesn't start with needle");
+ a(t.call("abcd", "bc", 1), true, "Position");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/#/uncapitalize.js b/Nodejs/node_modules/es5-ext/test/string/#/uncapitalize.js
new file mode 100644
index 0000000..cddd847
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/#/uncapitalize.js
@@ -0,0 +1,10 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t.call("raz"), "raz", "Word");
+ a(t.call("BLA"), "bLA", "Uppercase");
+ a(t.call(""), "", "Empty");
+ a(t.call("a"), "a", "One letter");
+ a(t.call("this is a test"), "this is a test", "Sentence");
+ a(t.call("This is a test"), "this is a test", "Capitalized sentence");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/format-method.js b/Nodejs/node_modules/es5-ext/test/string/format-method.js
new file mode 100644
index 0000000..ddb08f5
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/format-method.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function (t, a) {
+ t = t({ a: "A", aa: "B", ab: "C", b: "D", c: function () { return ++this.a; } });
+ a(t.call({ a: 0 }, " %a%aab%abb%b\\%aa%ab%c%c "), " ABbCbD%aaC12 ");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/from-code-point/implement.js b/Nodejs/node_modules/es5-ext/test/string/from-code-point/implement.js
new file mode 100644
index 0000000..00b813d
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/from-code-point/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../string/from-code-point/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/from-code-point/index.js b/Nodejs/node_modules/es5-ext/test/string/from-code-point/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/from-code-point/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/from-code-point/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/from-code-point/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/from-code-point/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/from-code-point/shim.js b/Nodejs/node_modules/es5-ext/test/string/from-code-point/shim.js
new file mode 100644
index 0000000..1bf22ad
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/from-code-point/shim.js
@@ -0,0 +1,47 @@
+// Taken from: https://github.com/mathiasbynens/String.fromCodePoint/blob/master
+// /tests/tests.js
+
+"use strict";
+
+var pow = Math.pow;
+
+module.exports = function (t, a) {
+ var counter, result;
+
+ a(t.length, 1, "Length");
+ a(String.propertyIsEnumerable("fromCodePoint"), false, "Not enumerable");
+
+ a(t(""), "\0", "Empty string");
+ a(t(), "", "No arguments");
+ a(t(-0), "\0", "-0");
+ a(t(0), "\0", "0");
+ a(t(0x1d306), "\uD834\uDF06", "Unicode");
+ a(t(0x1d306, 0x61, 0x1d307), "\uD834\uDF06a\uD834\uDF07", "Complex unicode");
+ a(t(0x61, 0x62, 0x1d307), "ab\uD834\uDF07", "Complex");
+ a(t(false), "\0", "false");
+ a(t(null), "\0", "null");
+
+ a.throws(function () { t("_"); }, RangeError, "_");
+ a.throws(function () { t(Infinity); }, RangeError, "Infinity");
+ a.throws(function () { t(-Infinity); }, RangeError, "-Infinity");
+ a.throws(function () { t(-1); }, RangeError, "-1");
+ a.throws(function () { t(0x10ffff + 1); }, RangeError, "Range error #1");
+ a.throws(function () { t(3.14); }, RangeError, "Range error #2");
+ a.throws(function () { t(3e-2); }, RangeError, "Range error #3");
+ a.throws(function () { t(-Infinity); }, RangeError, "Range error #4");
+ a.throws(function () { t(Number(Infinity)); }, RangeError, "Range error #5");
+ a.throws(function () { t(NaN); }, RangeError, "Range error #6");
+ a.throws(function () { t(undefined); }, RangeError, "Range error #7");
+ a.throws(function () { t({}); }, RangeError, "Range error #8");
+ a.throws(function () { t(/re/); }, RangeError, "Range error #9");
+
+ counter = (pow(2, 15) * 3) / 2;
+ result = [];
+ while (--counter >= 0) result.push(0); // One code unit per symbol
+ t.apply(null, result); // Must not throw
+
+ counter = (pow(2, 15) * 3) / 2;
+ result = [];
+ while (--counter >= 0) result.push(0xffff + 1); // Two code units per symbol
+ t.apply(null, result); // Must not throw
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/is-string.js b/Nodejs/node_modules/es5-ext/test/string/is-string.js
new file mode 100644
index 0000000..0e83122
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/is-string.js
@@ -0,0 +1,11 @@
+"use strict";
+
+module.exports = function (t, a) {
+ a(t(null), false, "Null");
+ a(t(""), true, "Empty string");
+ a(t(12), false, "Number");
+ a(t(false), false, "Boolean");
+ a(t(new Date()), false, "Date");
+ a(t(new String("raz")), true, "String object");
+ a(t("asdfaf"), true, "String");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/random-uniq.js b/Nodejs/node_modules/es5-ext/test/string/random-uniq.js
new file mode 100644
index 0000000..3b6d889
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/random-uniq.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/);
+
+module.exports = function (t, a) {
+ a(typeof t(), "string");
+ a.ok(t().length > 7);
+ a.not(t(), t());
+ a.ok(isValidFormat(t()));
+ a.ok(isValidFormat(t()));
+ a.ok(isValidFormat(t()));
+ a.ok(isValidFormat(t()));
+ a.ok(isValidFormat(t()));
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/random.js b/Nodejs/node_modules/es5-ext/test/string/random.js
new file mode 100644
index 0000000..3fa44ca
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/random.js
@@ -0,0 +1,13 @@
+"use strict";
+
+var isValidFormat = RegExp.prototype.test.bind(/^[a-z0-9]+$/);
+
+module.exports = function (t, a) {
+ a(typeof t(), "string");
+ a.ok(t().length > 7);
+ a.not(t({ isUnique: true }), t({ isUnique: true }));
+ a.ok(isValidFormat(t()));
+ a(t({ length: 1 }).length, 1);
+ a(t({ length: 100 }).length, 100);
+ a(t({ length: 0 }), "");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/string/raw/implement.js b/Nodejs/node_modules/es5-ext/test/string/raw/implement.js
new file mode 100644
index 0000000..f865e00
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/raw/implement.js
@@ -0,0 +1,5 @@
+"use strict";
+
+var isImplemented = require("../../../string/raw/is-implemented");
+
+module.exports = function (a) { a(isImplemented(), true); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/raw/index.js b/Nodejs/node_modules/es5-ext/test/string/raw/index.js
new file mode 100644
index 0000000..10bb8f6
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/raw/index.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = require("./shim");
diff --git a/Nodejs/node_modules/es5-ext/test/string/raw/is-implemented.js b/Nodejs/node_modules/es5-ext/test/string/raw/is-implemented.js
new file mode 100644
index 0000000..566411c
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/raw/is-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t(), "boolean"); };
diff --git a/Nodejs/node_modules/es5-ext/test/string/raw/shim.js b/Nodejs/node_modules/es5-ext/test/string/raw/shim.js
new file mode 100644
index 0000000..f61974f
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/string/raw/shim.js
@@ -0,0 +1,14 @@
+// Partially taken from:
+// https://github.com/paulmillr/es6-shim/blob/master/test/string.js
+
+"use strict";
+
+module.exports = function (t, a) {
+ var callSite = [];
+
+ callSite.raw = ["The total is ", " ($", " with tax)"];
+ a(t(callSite, "{total}", "{total * 1.01}"), "The total is {total} (${total * 1.01} with tax)");
+
+ callSite.raw = [];
+ a(t(callSite, "{total}", "{total * 1.01}"), "");
+};
diff --git a/Nodejs/node_modules/es5-ext/test/to-short-string-representation.js b/Nodejs/node_modules/es5-ext/test/to-short-string-representation.js
new file mode 100644
index 0000000..cac8d87
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/test/to-short-string-representation.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var repeat = require("../string/#/repeat");
+
+module.exports = function (t, a) {
+ a(t(), "undefined");
+ a(t(null), "null");
+ a(t(10), "10");
+ a(t("str"), "str");
+ a(t({ toString: function () { return "miszka"; } }), "miszka");
+ // eslint-disable-next-line symbol-description
+ if (typeof Symbol === "function") a(t(Symbol()), "Symbol()");
+ a(t(Object.create(null)), "");
+ a(t(repeat.call("a", 300)), repeat.call("a", 99) + "…");
+ a(t("mar\ntoo\nfar"), "mar\\ntoo\\nfar");
+};
diff --git a/Nodejs/node_modules/es5-ext/to-short-string-representation.js b/Nodejs/node_modules/es5-ext/to-short-string-representation.js
new file mode 100644
index 0000000..5aede53
--- /dev/null
+++ b/Nodejs/node_modules/es5-ext/to-short-string-representation.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var safeToString = require("./safe-to-string");
+
+var reNewLine = /[\n\r\u2028\u2029]/g;
+
+module.exports = function (value) {
+ var string = safeToString(value);
+ // Trim if too long
+ if (string.length > 100) string = string.slice(0, 99) + "…";
+ // Replace eventual new lines
+ string = string.replace(reNewLine, function (char) {
+ return JSON.stringify(char).slice(1, -1);
+ });
+ return string;
+};
diff --git a/Nodejs/node_modules/es6-iterator/#/chain.js b/Nodejs/node_modules/es6-iterator/#/chain.js
new file mode 100644
index 0000000..190a346
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/#/chain.js
@@ -0,0 +1,40 @@
+"use strict";
+
+var setPrototypeOf = require("es5-ext/object/set-prototype-of")
+ , d = require("d")
+ , Iterator = require("../")
+ , validIterable = require("../valid-iterable")
+
+ , push = Array.prototype.push
+ , defineProperties = Object.defineProperties
+ , IteratorChain;
+
+IteratorChain = function (iterators) {
+ defineProperties(this, {
+ __iterators__: d("", iterators),
+ __current__: d("w", iterators.shift())
+ });
+};
+if (setPrototypeOf) setPrototypeOf(IteratorChain, Iterator);
+
+IteratorChain.prototype = Object.create(Iterator.prototype, {
+ constructor: d(IteratorChain),
+ next: d(function () {
+ var result;
+ if (!this.__current__) return { done: true, value: undefined };
+ result = this.__current__.next();
+ while (result.done) {
+ this.__current__ = this.__iterators__.shift();
+ if (!this.__current__) return { done: true, value: undefined };
+ result = this.__current__.next();
+ }
+ return result;
+ })
+});
+
+module.exports = function () {
+ var iterators = [this];
+ push.apply(iterators, arguments);
+ iterators.forEach(validIterable);
+ return new IteratorChain(iterators);
+};
diff --git a/Nodejs/node_modules/es6-iterator/.editorconfig b/Nodejs/node_modules/es6-iterator/.editorconfig
new file mode 100644
index 0000000..c24a6cd
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/.editorconfig
@@ -0,0 +1,14 @@
+# EditorConfig is awesome: http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*]
+end_of_line = lf
+insert_final_newline = true
+indent_style = tab
+
+[{*.json,*.yml}]
+indent_style = space
+indent_size = 2
diff --git a/Nodejs/node_modules/es6-iterator/.npmignore b/Nodejs/node_modules/es6-iterator/.npmignore
new file mode 100644
index 0000000..a91db65
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/.npmignore
@@ -0,0 +1,12 @@
+.DS_Store
+Thumbs.db
+/.idea
+/.vscode
+npm-debug.log
+/wallaby.js
+/node_modules
+/.travis.yml
+/.gitignore
+/.circle.yml
+/.circleci
+/.appveyor.yml
diff --git a/Nodejs/node_modules/es6-iterator/CHANGELOG.md b/Nodejs/node_modules/es6-iterator/CHANGELOG.md
new file mode 100644
index 0000000..37eb16a
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/CHANGELOG.md
@@ -0,0 +1,27 @@
+# Change Log
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+
+## [2.0.3](https://github.com/medikoo/es6-iterator/compare/v2.0.2...v2.0.3) (2017-10-17)
+
+
+### Bug Fixes
+
+* configurability of toStringTag ([b99f692](https://github.com/medikoo/es6-iterator/commit/b99f692))
+
+
+
+
+## [2.0.2](https://github.com/medikoo/es6-iterator/compare/v2.0.1...v2.0.2) (2017-10-17)
+
+
+### Bug Fixes
+
+* constructor exposure ([dbc0c51](https://github.com/medikoo/es6-iterator/commit/dbc0c51))
+* do not allow non constructor calls ([1f2f800](https://github.com/medikoo/es6-iterator/commit/1f2f800))
+* toString and toStringTag symbol definitions. ([2d17786](https://github.com/medikoo/es6-iterator/commit/2d17786)), closes [#6](https://github.com/medikoo/es6-iterator/issues/6)
+
+## Changelog for previous versions
+
+See `CHANGES` file
diff --git a/Nodejs/node_modules/es6-iterator/CHANGES b/Nodejs/node_modules/es6-iterator/CHANGES
new file mode 100644
index 0000000..83095f7
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/CHANGES
@@ -0,0 +1,42 @@
+For recent changelog see CHANGELOG.md
+
+-----
+
+v2.0.1 -- 2017.03.15
+* Update dependencies
+
+v2.0.0 -- 2015.10.02
+* Use es6-symbol at v3
+
+v1.0.0 -- 2015.06.23
+* Implement support for arguments object
+* Drop support for v0.8 node ('^' in package.json dependencies)
+
+v0.1.3 -- 2015.02.02
+* Update dependencies
+* Fix spelling of LICENSE
+
+v0.1.2 -- 2014.11.19
+* Optimise internal `_next` to not verify internal's list length at all times
+ (#2 thanks @RReverser)
+* Fix documentation examples
+* Configure lint scripts
+
+v0.1.1 -- 2014.04.29
+* Fix es6-symbol dependency version
+
+v0.1.0 -- 2014.04.29
+* Assure strictly npm hosted dependencies
+* Remove sparse arrays dedicated handling (as per spec)
+* Add: isIterable, validIterable and chain (method)
+* Remove toArray, it's addressed by Array.from (polyfil can be found in es5-ext/array/from)
+* Add break possiblity to 'forOf' via 'doBreak' function argument
+* Provide dedicated iterator for array-likes (ArrayIterator) and for strings (StringIterator)
+* Provide @@toStringTag symbol
+* When available rely on @@iterator symbol
+* Remove 32bit integer maximum list length restriction
+* Improve Iterator internals
+* Update to use latest version of dependencies
+
+v0.0.0 -- 2013.10.12
+Initial (dev version)
diff --git a/Nodejs/node_modules/es6-iterator/LICENSE b/Nodejs/node_modules/es6-iterator/LICENSE
new file mode 100644
index 0000000..d7c36d5
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (C) 2013-2017 Mariusz Nowak (www.medikoo.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/es6-iterator/README.md b/Nodejs/node_modules/es6-iterator/README.md
new file mode 100644
index 0000000..288373d
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/README.md
@@ -0,0 +1,148 @@
+# es6-iterator
+## ECMAScript 6 Iterator interface
+
+### Installation
+
+ $ npm install es6-iterator
+
+To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
+
+## API
+
+### Constructors
+
+#### Iterator(list) _(es6-iterator)_
+
+Abstract Iterator interface. Meant for extensions and not to be used on its own.
+
+Accepts any _list_ object (technically object with numeric _length_ property).
+
+_Mind it doesn't iterate strings properly, for that use dedicated [StringIterator](#string-iterator)_
+
+```javascript
+var Iterator = require('es6-iterator')
+var iterator = new Iterator([1, 2, 3]);
+
+iterator.next(); // { value: 1, done: false }
+iterator.next(); // { value: 2, done: false }
+iterator.next(); // { value: 3, done: false }
+iterator.next(); // { value: undefined, done: true }
+```
+
+
+#### ArrayIterator(arrayLike[, kind]) _(es6-iterator/array)_
+
+Dedicated for arrays and array-likes. Supports three iteration kinds:
+* __value__ _(default)_ - Iterates values
+* __key__ - Iterates indexes
+* __key+value__ - Iterates keys and indexes, each iteration value is in _[key, value]_ form.
+
+
+```javascript
+var ArrayIterator = require('es6-iterator/array')
+var iterator = new ArrayIterator([1, 2, 3], 'key+value');
+
+iterator.next(); // { value: [0, 1], done: false }
+iterator.next(); // { value: [1, 2], done: false }
+iterator.next(); // { value: [2, 3], done: false }
+iterator.next(); // { value: undefined, done: true }
+```
+
+May also be used for _arguments_ objects:
+
+```javascript
+(function () {
+ var iterator = new ArrayIterator(arguments);
+
+ iterator.next(); // { value: 1, done: false }
+ iterator.next(); // { value: 2, done: false }
+ iterator.next(); // { value: 3, done: false }
+ iterator.next(); // { value: undefined, done: true }
+}(1, 2, 3));
+```
+
+#### StringIterator(str) _(es6-iterator/string)_
+
+Assures proper iteration over unicode symbols.
+See: http://mathiasbynens.be/notes/javascript-unicode
+
+```javascript
+var StringIterator = require('es6-iterator/string');
+var iterator = new StringIterator('f🙈o🙉o🙊');
+
+iterator.next(); // { value: 'f', done: false }
+iterator.next(); // { value: '🙈', done: false }
+iterator.next(); // { value: 'o', done: false }
+iterator.next(); // { value: '🙉', done: false }
+iterator.next(); // { value: 'o', done: false }
+iterator.next(); // { value: '🙊', done: false }
+iterator.next(); // { value: undefined, done: true }
+```
+
+### Function utilities
+
+#### forOf(iterable, callback[, thisArg]) _(es6-iterator/for-of)_
+
+Polyfill for ECMAScript 6 [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement.
+
+```
+var forOf = require('es6-iterator/for-of');
+var result = [];
+
+forOf('🙈🙉🙊', function (monkey) { result.push(monkey); });
+console.log(result); // ['🙈', '🙉', '🙊'];
+```
+
+Optionally you can break iteration at any point:
+
+```javascript
+var result = [];
+
+forOf([1,2,3,4]', function (val, doBreak) {
+ result.push(monkey);
+ if (val >= 3) doBreak();
+});
+console.log(result); // [1, 2, 3];
+```
+
+#### get(obj) _(es6-iterator/get)_
+
+Return iterator for any iterable object.
+
+```javascript
+var getIterator = require('es6-iterator/get');
+var iterator = get([1,2,3]);
+
+iterator.next(); // { value: 1, done: false }
+iterator.next(); // { value: 2, done: false }
+iterator.next(); // { value: 3, done: false }
+iterator.next(); // { value: undefined, done: true }
+```
+
+#### isIterable(obj) _(es6-iterator/is-iterable)_
+
+Whether _obj_ is iterable
+
+```javascript
+var isIterable = require('es6-iterator/is-iterable');
+
+isIterable(null); // false
+isIterable(true); // false
+isIterable('str'); // true
+isIterable(['a', 'r', 'r']); // true
+isIterable(new ArrayIterator([])); // true
+```
+
+#### validIterable(obj) _(es6-iterator/valid-iterable)_
+
+If _obj_ is an iterable it is returned. Otherwise _TypeError_ is thrown.
+
+### Method extensions
+
+#### iterator.chain(iterator1[, …iteratorn]) _(es6-iterator/#/chain)_
+
+Chain multiple iterators into one.
+
+### Tests [](https://travis-ci.org/medikoo/es6-iterator)
+
+ $ npm test
diff --git a/Nodejs/node_modules/es6-iterator/appveyor.yml b/Nodejs/node_modules/es6-iterator/appveyor.yml
new file mode 100644
index 0000000..942ab82
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/appveyor.yml
@@ -0,0 +1,26 @@
+# Test against the latest version of this Node.js version
+environment:
+ matrix:
+ # node.js
+ - nodejs_version: "0.12"
+ - nodejs_version: "4"
+ - nodejs_version: "6"
+ - nodejs_version: "8"
+
+# Install scripts. (runs after repo cloning)
+install:
+ # Get the latest stable version of Node.js or io.js
+ - ps: Install-Product node $env:nodejs_version
+ # install modules
+ - npm install
+
+# Post-install test scripts.
+test_script:
+ # Output useful info for debugging.
+ - node --version
+ - npm --version
+ # run tests
+ - npm test
+
+# Don't actually build.
+build: off
diff --git a/Nodejs/node_modules/es6-iterator/array.js b/Nodejs/node_modules/es6-iterator/array.js
new file mode 100644
index 0000000..d7a46a4
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/array.js
@@ -0,0 +1,32 @@
+"use strict";
+
+var setPrototypeOf = require("es5-ext/object/set-prototype-of")
+ , contains = require("es5-ext/string/#/contains")
+ , d = require("d")
+ , Symbol = require("es6-symbol")
+ , Iterator = require("./");
+
+var defineProperty = Object.defineProperty, ArrayIterator;
+
+ArrayIterator = module.exports = function (arr, kind) {
+ if (!(this instanceof ArrayIterator)) throw new TypeError("Constructor requires 'new'");
+ Iterator.call(this, arr);
+ if (!kind) kind = "value";
+ else if (contains.call(kind, "key+value")) kind = "key+value";
+ else if (contains.call(kind, "key")) kind = "key";
+ else kind = "value";
+ defineProperty(this, "__kind__", d("", kind));
+};
+if (setPrototypeOf) setPrototypeOf(ArrayIterator, Iterator);
+
+// Internal %ArrayIteratorPrototype% doesn't expose its constructor
+delete ArrayIterator.prototype.constructor;
+
+ArrayIterator.prototype = Object.create(Iterator.prototype, {
+ _resolve: d(function (i) {
+ if (this.__kind__ === "value") return this.__list__[i];
+ if (this.__kind__ === "key+value") return [i, this.__list__[i]];
+ return i;
+ })
+});
+defineProperty(ArrayIterator.prototype, Symbol.toStringTag, d("c", "Array Iterator"));
diff --git a/Nodejs/node_modules/es6-iterator/for-of.js b/Nodejs/node_modules/es6-iterator/for-of.js
new file mode 100644
index 0000000..5d15c34
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/for-of.js
@@ -0,0 +1,47 @@
+"use strict";
+
+var isArguments = require("es5-ext/function/is-arguments")
+ , callable = require("es5-ext/object/valid-callable")
+ , isString = require("es5-ext/string/is-string")
+ , get = require("./get");
+
+var isArray = Array.isArray, call = Function.prototype.call, some = Array.prototype.some;
+
+module.exports = function (iterable, cb /*, thisArg*/) {
+ var mode, thisArg = arguments[2], result, doBreak, broken, i, length, char, code;
+ if (isArray(iterable) || isArguments(iterable)) mode = "array";
+ else if (isString(iterable)) mode = "string";
+ else iterable = get(iterable);
+
+ callable(cb);
+ doBreak = function () {
+ broken = true;
+ };
+ if (mode === "array") {
+ some.call(iterable, function (value) {
+ call.call(cb, thisArg, value, doBreak);
+ return broken;
+ });
+ return;
+ }
+ if (mode === "string") {
+ length = iterable.length;
+ for (i = 0; i < length; ++i) {
+ char = iterable[i];
+ if (i + 1 < length) {
+ code = char.charCodeAt(0);
+ if (code >= 0xd800 && code <= 0xdbff) char += iterable[++i];
+ }
+ call.call(cb, thisArg, char, doBreak);
+ if (broken) break;
+ }
+ return;
+ }
+ result = iterable.next();
+
+ while (!result.done) {
+ call.call(cb, thisArg, result.value, doBreak);
+ if (broken) return;
+ result = iterable.next();
+ }
+};
diff --git a/Nodejs/node_modules/es6-iterator/get.js b/Nodejs/node_modules/es6-iterator/get.js
new file mode 100644
index 0000000..d36c9e2
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/get.js
@@ -0,0 +1,15 @@
+"use strict";
+
+var isArguments = require("es5-ext/function/is-arguments")
+ , isString = require("es5-ext/string/is-string")
+ , ArrayIterator = require("./array")
+ , StringIterator = require("./string")
+ , iterable = require("./valid-iterable")
+ , iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function (obj) {
+ if (typeof iterable(obj)[iteratorSymbol] === "function") return obj[iteratorSymbol]();
+ if (isArguments(obj)) return new ArrayIterator(obj);
+ if (isString(obj)) return new StringIterator(obj);
+ return new ArrayIterator(obj);
+};
diff --git a/Nodejs/node_modules/es6-iterator/index.js b/Nodejs/node_modules/es6-iterator/index.js
new file mode 100644
index 0000000..790475f
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/index.js
@@ -0,0 +1,106 @@
+"use strict";
+
+var clear = require("es5-ext/array/#/clear")
+ , assign = require("es5-ext/object/assign")
+ , callable = require("es5-ext/object/valid-callable")
+ , value = require("es5-ext/object/valid-value")
+ , d = require("d")
+ , autoBind = require("d/auto-bind")
+ , Symbol = require("es6-symbol");
+
+var defineProperty = Object.defineProperty, defineProperties = Object.defineProperties, Iterator;
+
+module.exports = Iterator = function (list, context) {
+ if (!(this instanceof Iterator)) throw new TypeError("Constructor requires 'new'");
+ defineProperties(this, {
+ __list__: d("w", value(list)),
+ __context__: d("w", context),
+ __nextIndex__: d("w", 0)
+ });
+ if (!context) return;
+ callable(context.on);
+ context.on("_add", this._onAdd);
+ context.on("_delete", this._onDelete);
+ context.on("_clear", this._onClear);
+};
+
+// Internal %IteratorPrototype% doesn't expose its constructor
+delete Iterator.prototype.constructor;
+
+defineProperties(
+ Iterator.prototype,
+ assign(
+ {
+ _next: d(function () {
+ var i;
+ if (!this.__list__) return undefined;
+ if (this.__redo__) {
+ i = this.__redo__.shift();
+ if (i !== undefined) return i;
+ }
+ if (this.__nextIndex__ < this.__list__.length) return this.__nextIndex__++;
+ this._unBind();
+ return undefined;
+ }),
+ next: d(function () {
+ return this._createResult(this._next());
+ }),
+ _createResult: d(function (i) {
+ if (i === undefined) return { done: true, value: undefined };
+ return { done: false, value: this._resolve(i) };
+ }),
+ _resolve: d(function (i) {
+ return this.__list__[i];
+ }),
+ _unBind: d(function () {
+ this.__list__ = null;
+ delete this.__redo__;
+ if (!this.__context__) return;
+ this.__context__.off("_add", this._onAdd);
+ this.__context__.off("_delete", this._onDelete);
+ this.__context__.off("_clear", this._onClear);
+ this.__context__ = null;
+ }),
+ toString: d(function () {
+ return "[object " + (this[Symbol.toStringTag] || "Object") + "]";
+ })
+ },
+ autoBind({
+ _onAdd: d(function (index) {
+ if (index >= this.__nextIndex__) return;
+ ++this.__nextIndex__;
+ if (!this.__redo__) {
+ defineProperty(this, "__redo__", d("c", [index]));
+ return;
+ }
+ this.__redo__.forEach(function (redo, i) {
+ if (redo >= index) this.__redo__[i] = ++redo;
+ }, this);
+ this.__redo__.push(index);
+ }),
+ _onDelete: d(function (index) {
+ var i;
+ if (index >= this.__nextIndex__) return;
+ --this.__nextIndex__;
+ if (!this.__redo__) return;
+ i = this.__redo__.indexOf(index);
+ if (i !== -1) this.__redo__.splice(i, 1);
+ this.__redo__.forEach(function (redo, j) {
+ if (redo > index) this.__redo__[j] = --redo;
+ }, this);
+ }),
+ _onClear: d(function () {
+ if (this.__redo__) clear.call(this.__redo__);
+ this.__nextIndex__ = 0;
+ })
+ })
+ )
+);
+
+defineProperty(
+ Iterator.prototype,
+ Symbol.iterator,
+ d(function () {
+ return this;
+ })
+);
diff --git a/Nodejs/node_modules/es6-iterator/is-iterable.js b/Nodejs/node_modules/es6-iterator/is-iterable.js
new file mode 100644
index 0000000..cda7dfe
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/is-iterable.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var isArguments = require("es5-ext/function/is-arguments")
+ , isValue = require("es5-ext/object/is-value")
+ , isString = require("es5-ext/string/is-string");
+
+var iteratorSymbol = require("es6-symbol").iterator
+ , isArray = Array.isArray;
+
+module.exports = function (value) {
+ if (!isValue(value)) return false;
+ if (isArray(value)) return true;
+ if (isString(value)) return true;
+ if (isArguments(value)) return true;
+ return typeof value[iteratorSymbol] === "function";
+};
diff --git a/Nodejs/node_modules/es6-iterator/package.json b/Nodejs/node_modules/es6-iterator/package.json
new file mode 100644
index 0000000..aa0c94e
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/package.json
@@ -0,0 +1,76 @@
+{
+ "_from": "es6-iterator@~2.0.1",
+ "_id": "es6-iterator@2.0.3",
+ "_inBundle": false,
+ "_integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=",
+ "_location": "/es6-iterator",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "es6-iterator@~2.0.1",
+ "name": "es6-iterator",
+ "escapedName": "es6-iterator",
+ "rawSpec": "~2.0.1",
+ "saveSpec": null,
+ "fetchSpec": "~2.0.1"
+ },
+ "_requiredBy": [
+ "/es5-ext",
+ "/es6-map",
+ "/es6-set"
+ ],
+ "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
+ "_shasum": "a7de889141a05a94b0854403b2d0a0fbfa98f3b7",
+ "_spec": "es6-iterator@~2.0.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/es6-map",
+ "author": {
+ "name": "Mariusz Nowak",
+ "email": "medyk@medikoo.com",
+ "url": "http://www.medikoo.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/medikoo/es6-iterator/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "d": "1",
+ "es5-ext": "^0.10.35",
+ "es6-symbol": "^3.1.1"
+ },
+ "deprecated": false,
+ "description": "Iterator abstraction based on ES6 specification",
+ "devDependencies": {
+ "eslint": "^4.9",
+ "eslint-config-medikoo-es5": "^1.4.4",
+ "event-emitter": "^0.3.5",
+ "tad": "^0.2.7"
+ },
+ "eslintConfig": {
+ "extends": "medikoo-es5",
+ "root": true,
+ "rules": {
+ "no-extend-native": "off"
+ }
+ },
+ "homepage": "https://github.com/medikoo/es6-iterator#readme",
+ "keywords": [
+ "iterator",
+ "array",
+ "list",
+ "set",
+ "map",
+ "generator"
+ ],
+ "license": "MIT",
+ "name": "es6-iterator",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/medikoo/es6-iterator.git"
+ },
+ "scripts": {
+ "lint": "eslint --ignore-path=.gitignore .",
+ "test": "node ./node_modules/tad/bin/tad"
+ },
+ "version": "2.0.3"
+}
diff --git a/Nodejs/node_modules/es6-iterator/string.js b/Nodejs/node_modules/es6-iterator/string.js
new file mode 100644
index 0000000..4888225
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/string.js
@@ -0,0 +1,39 @@
+// Thanks @mathiasbynens
+// http://mathiasbynens.be/notes/javascript-unicode#iterating-over-symbols
+
+"use strict";
+
+var setPrototypeOf = require("es5-ext/object/set-prototype-of")
+ , d = require("d")
+ , Symbol = require("es6-symbol")
+ , Iterator = require("./");
+
+var defineProperty = Object.defineProperty, StringIterator;
+
+StringIterator = module.exports = function (str) {
+ if (!(this instanceof StringIterator)) throw new TypeError("Constructor requires 'new'");
+ str = String(str);
+ Iterator.call(this, str);
+ defineProperty(this, "__length__", d("", str.length));
+};
+if (setPrototypeOf) setPrototypeOf(StringIterator, Iterator);
+
+// Internal %ArrayIteratorPrototype% doesn't expose its constructor
+delete StringIterator.prototype.constructor;
+
+StringIterator.prototype = Object.create(Iterator.prototype, {
+ _next: d(function () {
+ if (!this.__list__) return undefined;
+ if (this.__nextIndex__ < this.__length__) return this.__nextIndex__++;
+ this._unBind();
+ return undefined;
+ }),
+ _resolve: d(function (i) {
+ var char = this.__list__[i], code;
+ if (this.__nextIndex__ === this.__length__) return char;
+ code = char.charCodeAt(0);
+ if (code >= 0xd800 && code <= 0xdbff) return char + this.__list__[this.__nextIndex__++];
+ return char;
+ })
+});
+defineProperty(StringIterator.prototype, Symbol.toStringTag, d("c", "String Iterator"));
diff --git a/Nodejs/node_modules/es6-iterator/test/#/chain.js b/Nodejs/node_modules/es6-iterator/test/#/chain.js
new file mode 100644
index 0000000..457356f
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/#/chain.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var Iterator = require("../../");
+
+module.exports = function (t, a) {
+ var i1 = new Iterator(["raz", "dwa", "trzy"])
+ , i2 = new Iterator(["cztery", "pięć", "sześć"])
+ , i3 = new Iterator(["siedem", "osiem", "dziewięć"])
+
+ , iterator = t.call(i1, i2, i3);
+
+ a.deep(iterator.next(), { done: false, value: "raz" }, "#1");
+ a.deep(iterator.next(), { done: false, value: "dwa" }, "#2");
+ a.deep(iterator.next(), { done: false, value: "trzy" }, "#3");
+ a.deep(iterator.next(), { done: false, value: "cztery" }, "#4");
+ a.deep(iterator.next(), { done: false, value: "pięć" }, "#5");
+ a.deep(iterator.next(), { done: false, value: "sześć" }, "#6");
+ a.deep(iterator.next(), { done: false, value: "siedem" }, "#7");
+ a.deep(iterator.next(), { done: false, value: "osiem" }, "#8");
+ a.deep(iterator.next(), { done: false, value: "dziewięć" }, "#9");
+ a.deep(iterator.next(), { done: true, value: undefined }, "Done #1");
+ a.deep(iterator.next(), { done: true, value: undefined }, "Done #2");
+};
diff --git a/Nodejs/node_modules/es6-iterator/test/.eslintrc.json b/Nodejs/node_modules/es6-iterator/test/.eslintrc.json
new file mode 100644
index 0000000..99f0b65
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/.eslintrc.json
@@ -0,0 +1,5 @@
+{
+ "rules": {
+ "id-length": "off"
+ }
+}
diff --git a/Nodejs/node_modules/es6-iterator/test/array.js b/Nodejs/node_modules/es6-iterator/test/array.js
new file mode 100644
index 0000000..447dfa7
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/array.js
@@ -0,0 +1,67 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function (T) {
+ return {
+ "Values": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it;
+
+ it = new T(x);
+ a(it[iteratorSymbol](), it, "@@iterator");
+ a.deep(it.next(), { done: false, value: "raz" }, "#1");
+ a.deep(it.next(), { done: false, value: "dwa" }, "#2");
+ x.splice(1, 0, "elo");
+ a.deep(it.next(), { done: false, value: "dwa" }, "Insert");
+ a.deep(it.next(), { done: false, value: "trzy" }, "#3");
+ a.deep(it.next(), { done: false, value: "cztery" }, "#4");
+ x.pop();
+ a.deep(it.next(), { done: false, value: "pięć" }, "#5");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Keys & Values": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it;
+
+ it = new T(x, "key+value");
+ a(it[iteratorSymbol](), it, "@@iterator");
+ a.deep(it.next(), { done: false, value: [0, "raz"] }, "#1");
+ a.deep(it.next(), { done: false, value: [1, "dwa"] }, "#2");
+ x.splice(1, 0, "elo");
+ a.deep(it.next(), { done: false, value: [2, "dwa"] }, "Insert");
+ a.deep(it.next(), { done: false, value: [3, "trzy"] }, "#3");
+ a.deep(it.next(), { done: false, value: [4, "cztery"] }, "#4");
+ x.pop();
+ a.deep(it.next(), { done: false, value: [5, "pięć"] }, "#5");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Keys": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], it;
+
+ it = new T(x, "key");
+ a(it[iteratorSymbol](), it, "@@iterator");
+ a.deep(it.next(), { done: false, value: 0 }, "#1");
+ a.deep(it.next(), { done: false, value: 1 }, "#2");
+ x.splice(1, 0, "elo");
+ a.deep(it.next(), { done: false, value: 2 }, "Insert");
+ a.deep(it.next(), { done: false, value: 3 }, "#3");
+ a.deep(it.next(), { done: false, value: 4 }, "#4");
+ x.pop();
+ a.deep(it.next(), { done: false, value: 5 }, "#5");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Sparse": function (a) {
+ var x = new Array(6), it;
+
+ x[2] = "raz";
+ x[4] = "dwa";
+ it = new T(x);
+ a.deep(it.next(), { done: false, value: undefined }, "#1");
+ a.deep(it.next(), { done: false, value: undefined }, "#2");
+ a.deep(it.next(), { done: false, value: "raz" }, "#3");
+ a.deep(it.next(), { done: false, value: undefined }, "#4");
+ a.deep(it.next(), { done: false, value: "dwa" }, "#5");
+ a.deep(it.next(), { done: false, value: undefined }, "#6");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ }
+ };
+};
diff --git a/Nodejs/node_modules/es6-iterator/test/for-of.js b/Nodejs/node_modules/es6-iterator/test/for-of.js
new file mode 100644
index 0000000..9b47e97
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/for-of.js
@@ -0,0 +1,42 @@
+"use strict";
+
+var ArrayIterator = require("../array")
+
+ , slice = Array.prototype.slice;
+
+module.exports = function (t, a) {
+ var i = 0, x = ["raz", "dwa", "trzy"], y = {}, called = 0;
+ t(x, function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "Array " + i + "#");
+ a(this, y, "Array: context: " + i++ + "#");
+ }, y);
+ i = 0;
+ t((function () {
+ return arguments;
+}("raz", "dwa", "trzy")), function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "Arguments" + i + "#");
+ a(this, y, "Arguments: context: " + i++ + "#");
+ }, y);
+ i = 0;
+ t(x = "foo", function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
+ a(this, y, "Regular String: context: " + i++ + "#");
+ }, y);
+ i = 0;
+ x = ["r", "💩", "z"];
+ t("r💩z", function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "String " + i + "#");
+ a(this, y, "Unicode String: context: " + i++ + "#");
+ }, y);
+ i = 0;
+ t(new ArrayIterator(x), function () {
+ a.deep(slice.call(arguments, 0, 1), [x[i]], "Iterator " + i + "#");
+ a(this, y, "Iterator: context: " + i++ + "#");
+ }, y);
+
+ t(x = ["raz", "dwa", "trzy"], function (value, doBreak) {
+ ++called;
+ return doBreak();
+ });
+ a(called, 1, "Break");
+};
diff --git a/Nodejs/node_modules/es6-iterator/test/get.js b/Nodejs/node_modules/es6-iterator/test/get.js
new file mode 100644
index 0000000..c5947d3
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/get.js
@@ -0,0 +1,27 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator
+ , Iterator = require("../");
+
+module.exports = function (t, a) {
+ var iterator;
+ a.throws(function () {
+ t();
+}, TypeError, "Null");
+ a.throws(function () {
+ t({});
+}, TypeError, "Plain object");
+ a.throws(function () {
+ t({ length: 0 });
+}, TypeError, "Array-like");
+ iterator = {};
+ iterator[iteratorSymbol] = function () {
+ return new Iterator([]);
+};
+ a(t(iterator) instanceof Iterator, true, "Iterator");
+ a(String(t([])), "[object Array Iterator]", " Array");
+ a(String(t(function () {
+ return arguments;
+}())), "[object Array Iterator]", " Arguments");
+ a(String(t("foo")), "[object String Iterator]", "String");
+};
diff --git a/Nodejs/node_modules/es6-iterator/test/index.js b/Nodejs/node_modules/es6-iterator/test/index.js
new file mode 100644
index 0000000..4898218
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/index.js
@@ -0,0 +1,99 @@
+"use strict";
+
+var ee = require("event-emitter")
+ , iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function (T) {
+ return {
+ "": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć"], it, y, z;
+
+ it = new T(x);
+ a(it[iteratorSymbol](), it, "@@iterator");
+ y = it.next();
+ a.deep(y, { done: false, value: "raz" }, "#1");
+ z = it.next();
+ a.not(y, z, "Recreate result");
+ a.deep(z, { done: false, value: "dwa" }, "#2");
+ a.deep(it.next(), { done: false, value: "trzy" }, "#3");
+ a.deep(it.next(), { done: false, value: "cztery" }, "#4");
+ a.deep(it.next(), { done: false, value: "pięć" }, "#5");
+ a.deep(y = it.next(), { done: true, value: undefined }, "End");
+ a.not(y, it.next(), "Recreate result on dead");
+ },
+ "Emited": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć"], y, it;
+
+ y = ee();
+ it = new T(x, y);
+ a.deep(it.next(), { done: false, value: "raz" }, "#1");
+ a.deep(it.next(), { done: false, value: "dwa" }, "#2");
+ y.emit("_add", x.push("sześć") - 1);
+ a.deep(it.next(), { done: false, value: "trzy" }, "#3");
+ x.splice(1, 0, "półtora");
+ y.emit("_add", 1);
+ a.deep(it.next(), { done: false, value: "półtora" }, "Insert");
+ x.splice(5, 1);
+ y.emit("_delete", 5);
+ a.deep(it.next(), { done: false, value: "cztery" }, "#4");
+ a.deep(it.next(), { done: false, value: "sześć" }, "#5");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited #2": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it;
+
+ y = ee();
+ it = new T(x, y);
+ a.deep(it.next(), { done: false, value: "raz" }, "#1");
+ a.deep(it.next(), { done: false, value: "dwa" }, "#2");
+ x.splice(1, 0, "półtora");
+ y.emit("_add", 1);
+ x.splice(1, 0, "1.25");
+ y.emit("_add", 1);
+ x.splice(0, 1);
+ y.emit("_delete", 0);
+ a.deep(it.next(), { done: false, value: "półtora" }, "Insert");
+ a.deep(it.next(), { done: false, value: "1.25" }, "Insert #2");
+ a.deep(it.next(), { done: false, value: "trzy" }, "#3");
+ a.deep(it.next(), { done: false, value: "cztery" }, "#4");
+ x.splice(5, 1);
+ y.emit("_delete", 5);
+ a.deep(it.next(), { done: false, value: "sześć" }, "#5");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited: Clear #1": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it;
+
+ y = ee();
+ it = new T(x, y);
+ a.deep(it.next(), { done: false, value: "raz" }, "#1");
+ a.deep(it.next(), { done: false, value: "dwa" }, "#2");
+ x.length = 0;
+ y.emit("_clear");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited: Clear #2": function (a) {
+ var x = ["raz", "dwa", "trzy", "cztery", "pięć", "sześć"], y, it;
+
+ y = ee();
+ it = new T(x, y);
+ a.deep(it.next(), { done: false, value: "raz" }, "#1");
+ a.deep(it.next(), { done: false, value: "dwa" }, "#2");
+ x.length = 0;
+ y.emit("_clear");
+ x.push("foo");
+ x.push("bar");
+ a.deep(it.next(), { done: false, value: "foo" }, "#3");
+ a.deep(it.next(), { done: false, value: "bar" }, "#4");
+ x.splice(1, 0, "półtora");
+ y.emit("_add", 1);
+ x.splice(1, 0, "1.25");
+ y.emit("_add", 1);
+ x.splice(0, 1);
+ y.emit("_delete", 0);
+ a.deep(it.next(), { done: false, value: "półtora" }, "Insert");
+ a.deep(it.next(), { done: false, value: "1.25" }, "Insert #2");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ }
+ };
+};
diff --git a/Nodejs/node_modules/es6-iterator/test/is-iterable.js b/Nodejs/node_modules/es6-iterator/test/is-iterable.js
new file mode 100644
index 0000000..5787351
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/is-iterable.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator
+ , Iterator = require("../");
+
+module.exports = function (t, a) {
+ var iterator;
+ a(t(), false, "Undefined");
+ a(t(123), false, "Number");
+ a(t({}), false, "Plain object");
+ a(t({ length: 0 }), false, "Array-like");
+ iterator = {};
+ iterator[iteratorSymbol] = function () {
+ return new Iterator([]);
+};
+ a(t(iterator), true, "Iterator");
+ a(t([]), true, "Array");
+ a(t("foo"), true, "String");
+ a(t(""), true, "Empty string");
+ a(t(function () {
+ return arguments;
+}()), true, "Arguments");
+};
diff --git a/Nodejs/node_modules/es6-iterator/test/string.js b/Nodejs/node_modules/es6-iterator/test/string.js
new file mode 100644
index 0000000..3f2a5b6
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/string.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator;
+
+module.exports = function (T, a) {
+ var it = new T("foobar");
+
+ a(it[iteratorSymbol](), it, "@@iterator");
+ a.deep(it.next(), { done: false, value: "f" }, "#1");
+ a.deep(it.next(), { done: false, value: "o" }, "#2");
+ a.deep(it.next(), { done: false, value: "o" }, "#3");
+ a.deep(it.next(), { done: false, value: "b" }, "#4");
+ a.deep(it.next(), { done: false, value: "a" }, "#5");
+ a.deep(it.next(), { done: false, value: "r" }, "#6");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+
+ a.h1("Outside of BMP");
+ it = new T("r💩z");
+ a.deep(it.next(), { done: false, value: "r" }, "#1");
+ a.deep(it.next(), { done: false, value: "💩" }, "#2");
+ a.deep(it.next(), { done: false, value: "z" }, "#3");
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+};
diff --git a/Nodejs/node_modules/es6-iterator/test/valid-iterable.js b/Nodejs/node_modules/es6-iterator/test/valid-iterable.js
new file mode 100644
index 0000000..b8b2a8a
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/test/valid-iterable.js
@@ -0,0 +1,28 @@
+"use strict";
+
+var iteratorSymbol = require("es6-symbol").iterator
+ , Iterator = require("../");
+
+module.exports = function (t, a) {
+ var obj;
+ a.throws(function () {
+ t();
+}, TypeError, "Undefined");
+ a.throws(function () {
+ t({});
+}, TypeError, "Plain object");
+ a.throws(function () {
+ t({ length: 0 });
+}, TypeError, "Array-like");
+ obj = {};
+ obj[iteratorSymbol] = function () {
+ return new Iterator([]);
+};
+ a(t(obj), obj, "Iterator");
+ obj = [];
+ a(t(obj), obj, "Array");
+ obj = (function () {
+ return arguments;
+}());
+ a(t(obj), obj, "Arguments");
+};
diff --git a/Nodejs/node_modules/es6-iterator/valid-iterable.js b/Nodejs/node_modules/es6-iterator/valid-iterable.js
new file mode 100644
index 0000000..8c6e071
--- /dev/null
+++ b/Nodejs/node_modules/es6-iterator/valid-iterable.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isIterable = require("./is-iterable");
+
+module.exports = function (value) {
+ if (!isIterable(value)) throw new TypeError(value + " is not iterable");
+ return value;
+};
diff --git a/Nodejs/node_modules/es6-map/.lint b/Nodejs/node_modules/es6-map/.lint
new file mode 100644
index 0000000..fa861e0
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/.lint
@@ -0,0 +1,13 @@
+@root
+
+module
+
+indent 2
+maxlen 100
+tabs
+
+ass
+nomen
+plusplus
+
+predef+ Map
diff --git a/Nodejs/node_modules/es6-map/.npmignore b/Nodejs/node_modules/es6-map/.npmignore
new file mode 100644
index 0000000..155e41f
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/.npmignore
@@ -0,0 +1,4 @@
+.DS_Store
+/node_modules
+/npm-debug.log
+/.lintcache
diff --git a/Nodejs/node_modules/es6-map/.travis.yml b/Nodejs/node_modules/es6-map/.travis.yml
new file mode 100644
index 0000000..7560f74
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/.travis.yml
@@ -0,0 +1,13 @@
+sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
+language: node_js
+node_js:
+ - 0.12
+ - 4
+ - 6
+ - 7
+
+notifications:
+ email:
+ - medikoo+es6-map@medikoo.com
+
+script: "npm test && npm run lint"
diff --git a/Nodejs/node_modules/es6-map/CHANGES b/Nodejs/node_modules/es6-map/CHANGES
new file mode 100644
index 0000000..0205ad4
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/CHANGES
@@ -0,0 +1,33 @@
+v0.1.5 -- 2017.03.17
+* Update dependencies
+* Improve documentation
+
+v0.1.4 -- 2016.06.03
+* Update dependencies
+
+v0.1.3 -- 2015.11.18
+* Relax validation of native implementation (do not require proper stringification of Map.prototype)
+
+v0.1.2 -- 2015.10.15
+* Improve native detection
+* Ensure proper inheritance
+* Update up to specification
+* Fix spelling of LICENSE
+* Update dependencies
+
+v0.1.1 -- 2014.10.07
+* Fix isImplemented so native Maps are detected properly
+* Configure lint scripts
+
+v0.1.0 -- 2014.04.29
+* Assure strictly npm hosted dependencies
+* Update to use latest versions of dependencies
+
+v0.0.1 -- 2014.04.25
+* Provide @@toStringTag symbol, and use other ES 6 symbols
+* Fix iterators handling
+* Fix isImplemented so it doesn't crash
+* Update up to changes in dependencies
+
+v0.0.0 -- 2013.11.10
+- Initial (dev) version
diff --git a/Nodejs/node_modules/es6-map/LICENSE b/Nodejs/node_modules/es6-map/LICENSE
new file mode 100644
index 0000000..aaf3528
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2013 Mariusz Nowak (www.medikoo.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/es6-map/README.md b/Nodejs/node_modules/es6-map/README.md
new file mode 100644
index 0000000..d132981
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/README.md
@@ -0,0 +1,79 @@
+# es6-map
+## Map collection as specified in ECMAScript6
+
+__Warning:
+v0.1 version does not ensure O(1) algorithm complexity (but O(n)). This shortcoming will be addressed in v1.0__
+
+
+### Usage
+
+It’s safest to use *es6-map* as a [ponyfill](https://ponyfill.com) – a polyfill which doesn’t touch global objects:
+
+```javascript
+var Map = require('es6-map');
+```
+
+If you want to make sure your environment implements `Map` globally, do:
+
+```javascript
+require('es6-map/implement');
+```
+
+If you strictly want to use the polyfill even if the native `Map` exists, do:
+
+```javascript
+var Map = require('es6-map/polyfill');
+```
+
+### Installation
+
+ $ npm install es6-map
+
+To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
+
+#### API
+
+Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-map-objects). Still if you want quick look, follow examples:
+
+```javascript
+var Map = require('es6-map');
+
+var x = {}, y = {}, map = new Map([['raz', 'one'], ['dwa', 'two'], [x, y]]);
+
+map.size; // 3
+map.get('raz'); // 'one'
+map.get(x); // y
+map.has('raz'); // true
+map.has(x); // true
+map.has('foo'); // false
+map.set('trzy', 'three'); // map
+map.size // 4
+map.get('trzy'); // 'three'
+map.has('trzy'); // true
+map.has('dwa'); // true
+map.delete('dwa'); // true
+map.size; // 3
+
+map.forEach(function (value, key) {
+ // { 'raz', 'one' }, { x, y }, { 'trzy', 'three' } iterated
+});
+
+// FF nightly only:
+for (value of map) {
+ // ['raz', 'one'], [x, y], ['trzy', 'three'] iterated
+}
+
+var iterator = map.values();
+
+iterator.next(); // { done: false, value: 'one' }
+iterator.next(); // { done: false, value: y }
+iterator.next(); // { done: false, value: 'three' }
+iterator.next(); // { done: true, value: undefined }
+
+map.clear(); // undefined
+map.size; // 0
+```
+
+## Tests [](https://travis-ci.org/medikoo/es6-map)
+
+ $ npm test
diff --git a/Nodejs/node_modules/es6-map/implement.js b/Nodejs/node_modules/es6-map/implement.js
new file mode 100644
index 0000000..ff3ebac
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/implement.js
@@ -0,0 +1,7 @@
+'use strict';
+
+if (!require('./is-implemented')()) {
+ Object.defineProperty(require('es5-ext/global'), 'Map',
+ { value: require('./polyfill'), configurable: true, enumerable: false,
+ writable: true });
+}
diff --git a/Nodejs/node_modules/es6-map/index.js b/Nodejs/node_modules/es6-map/index.js
new file mode 100644
index 0000000..3e27caa
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/index.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./is-implemented')() ? Map : require('./polyfill');
diff --git a/Nodejs/node_modules/es6-map/is-implemented.js b/Nodejs/node_modules/es6-map/is-implemented.js
new file mode 100644
index 0000000..cd3b8f2
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/is-implemented.js
@@ -0,0 +1,32 @@
+'use strict';
+
+module.exports = function () {
+ var map, iterator, result;
+ if (typeof Map !== 'function') return false;
+ try {
+ // WebKit doesn't support arguments and crashes
+ map = new Map([['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]);
+ } catch (e) {
+ return false;
+ }
+ if (String(map) !== '[object Map]') return false;
+ if (map.size !== 3) return false;
+ if (typeof map.clear !== 'function') return false;
+ if (typeof map.delete !== 'function') return false;
+ if (typeof map.entries !== 'function') return false;
+ if (typeof map.forEach !== 'function') return false;
+ if (typeof map.get !== 'function') return false;
+ if (typeof map.has !== 'function') return false;
+ if (typeof map.keys !== 'function') return false;
+ if (typeof map.set !== 'function') return false;
+ if (typeof map.values !== 'function') return false;
+
+ iterator = map.entries();
+ result = iterator.next();
+ if (result.done !== false) return false;
+ if (!result.value) return false;
+ if (result.value[0] !== 'raz') return false;
+ if (result.value[1] !== 'one') return false;
+
+ return true;
+};
diff --git a/Nodejs/node_modules/es6-map/is-map.js b/Nodejs/node_modules/es6-map/is-map.js
new file mode 100644
index 0000000..1e1fa82
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/is-map.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var toStringTagSymbol = require('es6-symbol').toStringTag
+
+ , toString = Object.prototype.toString
+ , id = '[object Map]'
+ , Global = (typeof Map === 'undefined') ? null : Map;
+
+module.exports = function (x) {
+ return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) ||
+ (toString.call(x) === id) || (x[toStringTagSymbol] === 'Map'))) || false;
+};
diff --git a/Nodejs/node_modules/es6-map/is-native-implemented.js b/Nodejs/node_modules/es6-map/is-native-implemented.js
new file mode 100644
index 0000000..b0b7a19
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/is-native-implemented.js
@@ -0,0 +1,9 @@
+// Exports true if environment provides native `Map` implementation,
+// whatever that is.
+
+'use strict';
+
+module.exports = (function () {
+ if (typeof Map === 'undefined') return false;
+ return (Object.prototype.toString.call(new Map()) === '[object Map]');
+}());
diff --git a/Nodejs/node_modules/es6-map/lib/iterator-kinds.js b/Nodejs/node_modules/es6-map/lib/iterator-kinds.js
new file mode 100644
index 0000000..5367b38
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/lib/iterator-kinds.js
@@ -0,0 +1,4 @@
+'use strict';
+
+module.exports = require('es5-ext/object/primitive-set')('key',
+ 'value', 'key+value');
diff --git a/Nodejs/node_modules/es6-map/lib/iterator.js b/Nodejs/node_modules/es6-map/lib/iterator.js
new file mode 100644
index 0000000..60f1e8c
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/lib/iterator.js
@@ -0,0 +1,38 @@
+'use strict';
+
+var setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , d = require('d')
+ , Iterator = require('es6-iterator')
+ , toStringTagSymbol = require('es6-symbol').toStringTag
+ , kinds = require('./iterator-kinds')
+
+ , defineProperties = Object.defineProperties
+ , unBind = Iterator.prototype._unBind
+ , MapIterator;
+
+MapIterator = module.exports = function (map, kind) {
+ if (!(this instanceof MapIterator)) return new MapIterator(map, kind);
+ Iterator.call(this, map.__mapKeysData__, map);
+ if (!kind || !kinds[kind]) kind = 'key+value';
+ defineProperties(this, {
+ __kind__: d('', kind),
+ __values__: d('w', map.__mapValuesData__)
+ });
+};
+if (setPrototypeOf) setPrototypeOf(MapIterator, Iterator);
+
+MapIterator.prototype = Object.create(Iterator.prototype, {
+ constructor: d(MapIterator),
+ _resolve: d(function (i) {
+ if (this.__kind__ === 'value') return this.__values__[i];
+ if (this.__kind__ === 'key') return this.__list__[i];
+ return [this.__list__[i], this.__values__[i]];
+ }),
+ _unBind: d(function () {
+ this.__values__ = null;
+ unBind.call(this);
+ }),
+ toString: d(function () { return '[object Map Iterator]'; })
+});
+Object.defineProperty(MapIterator.prototype, toStringTagSymbol,
+ d('c', 'Map Iterator'));
diff --git a/Nodejs/node_modules/es6-map/lib/primitive-iterator.js b/Nodejs/node_modules/es6-map/lib/primitive-iterator.js
new file mode 100644
index 0000000..b9eada3
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/lib/primitive-iterator.js
@@ -0,0 +1,57 @@
+'use strict';
+
+var clear = require('es5-ext/array/#/clear')
+ , assign = require('es5-ext/object/assign')
+ , setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , toStringTagSymbol = require('es6-symbol').toStringTag
+ , d = require('d')
+ , autoBind = require('d/auto-bind')
+ , Iterator = require('es6-iterator')
+ , kinds = require('./iterator-kinds')
+
+ , defineProperties = Object.defineProperties, keys = Object.keys
+ , unBind = Iterator.prototype._unBind
+ , PrimitiveMapIterator;
+
+PrimitiveMapIterator = module.exports = function (map, kind) {
+ if (!(this instanceof PrimitiveMapIterator)) {
+ return new PrimitiveMapIterator(map, kind);
+ }
+ Iterator.call(this, keys(map.__mapKeysData__), map);
+ if (!kind || !kinds[kind]) kind = 'key+value';
+ defineProperties(this, {
+ __kind__: d('', kind),
+ __keysData__: d('w', map.__mapKeysData__),
+ __valuesData__: d('w', map.__mapValuesData__)
+ });
+};
+if (setPrototypeOf) setPrototypeOf(PrimitiveMapIterator, Iterator);
+
+PrimitiveMapIterator.prototype = Object.create(Iterator.prototype, assign({
+ constructor: d(PrimitiveMapIterator),
+ _resolve: d(function (i) {
+ if (this.__kind__ === 'value') return this.__valuesData__[this.__list__[i]];
+ if (this.__kind__ === 'key') return this.__keysData__[this.__list__[i]];
+ return [this.__keysData__[this.__list__[i]],
+ this.__valuesData__[this.__list__[i]]];
+ }),
+ _unBind: d(function () {
+ this.__keysData__ = null;
+ this.__valuesData__ = null;
+ unBind.call(this);
+ }),
+ toString: d(function () { return '[object Map Iterator]'; })
+}, autoBind({
+ _onAdd: d(function (key) { this.__list__.push(key); }),
+ _onDelete: d(function (key) {
+ var index = this.__list__.lastIndexOf(key);
+ if (index < this.__nextIndex__) return;
+ this.__list__.splice(index, 1);
+ }),
+ _onClear: d(function () {
+ clear.call(this.__list__);
+ this.__nextIndex__ = 0;
+ })
+})));
+Object.defineProperty(PrimitiveMapIterator.prototype, toStringTagSymbol,
+ d('c', 'Map Iterator'));
diff --git a/Nodejs/node_modules/es6-map/package.json b/Nodejs/node_modules/es6-map/package.json
new file mode 100644
index 0000000..bea5090
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/package.json
@@ -0,0 +1,74 @@
+{
+ "_from": "es6-map@^0.1.5",
+ "_id": "es6-map@0.1.5",
+ "_inBundle": false,
+ "_integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=",
+ "_location": "/es6-map",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "es6-map@^0.1.5",
+ "name": "es6-map",
+ "escapedName": "es6-map",
+ "rawSpec": "^0.1.5",
+ "saveSpec": null,
+ "fetchSpec": "^0.1.5"
+ },
+ "_requiredBy": [
+ "/mqtt"
+ ],
+ "_resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz",
+ "_shasum": "9136e0503dcc06a301690f0bb14ff4e364e949f0",
+ "_spec": "es6-map@^0.1.5",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/mqtt",
+ "author": {
+ "name": "Mariusz Nowak",
+ "email": "medyk@medikoo.com",
+ "url": "http://www.medikoo.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/medikoo/es6-map/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "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"
+ },
+ "deprecated": false,
+ "description": "ECMAScript6 Map polyfill",
+ "devDependencies": {
+ "tad": "~0.2.7",
+ "xlint": "~0.2.2",
+ "xlint-jslint-medikoo": "~0.1.4"
+ },
+ "homepage": "https://github.com/medikoo/es6-map#readme",
+ "keywords": [
+ "collection",
+ "es6",
+ "shim",
+ "harmony",
+ "list",
+ "hash",
+ "map",
+ "polyfill",
+ "ponyfill",
+ "ecmascript"
+ ],
+ "license": "MIT",
+ "name": "es6-map",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/medikoo/es6-map.git"
+ },
+ "scripts": {
+ "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
+ "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
+ "test": "node ./node_modules/tad/bin/tad"
+ },
+ "version": "0.1.5"
+}
diff --git a/Nodejs/node_modules/es6-map/polyfill.js b/Nodejs/node_modules/es6-map/polyfill.js
new file mode 100644
index 0000000..c638e76
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/polyfill.js
@@ -0,0 +1,104 @@
+'use strict';
+
+var clear = require('es5-ext/array/#/clear')
+ , eIndexOf = require('es5-ext/array/#/e-index-of')
+ , setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , callable = require('es5-ext/object/valid-callable')
+ , validValue = require('es5-ext/object/valid-value')
+ , d = require('d')
+ , ee = require('event-emitter')
+ , Symbol = require('es6-symbol')
+ , iterator = require('es6-iterator/valid-iterable')
+ , forOf = require('es6-iterator/for-of')
+ , Iterator = require('./lib/iterator')
+ , isNative = require('./is-native-implemented')
+
+ , call = Function.prototype.call
+ , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf
+ , MapPoly;
+
+module.exports = MapPoly = function (/*iterable*/) {
+ var iterable = arguments[0], keys, values, self;
+ if (!(this instanceof MapPoly)) throw new TypeError('Constructor requires \'new\'');
+ if (isNative && setPrototypeOf && (Map !== MapPoly)) {
+ self = setPrototypeOf(new Map(), getPrototypeOf(this));
+ } else {
+ self = this;
+ }
+ if (iterable != null) iterator(iterable);
+ defineProperties(self, {
+ __mapKeysData__: d('c', keys = []),
+ __mapValuesData__: d('c', values = [])
+ });
+ if (!iterable) return self;
+ forOf(iterable, function (value) {
+ var key = validValue(value)[0];
+ value = value[1];
+ if (eIndexOf.call(keys, key) !== -1) return;
+ keys.push(key);
+ values.push(value);
+ }, self);
+ return self;
+};
+
+if (isNative) {
+ if (setPrototypeOf) setPrototypeOf(MapPoly, Map);
+ MapPoly.prototype = Object.create(Map.prototype, {
+ constructor: d(MapPoly)
+ });
+}
+
+ee(defineProperties(MapPoly.prototype, {
+ clear: d(function () {
+ if (!this.__mapKeysData__.length) return;
+ clear.call(this.__mapKeysData__);
+ clear.call(this.__mapValuesData__);
+ this.emit('_clear');
+ }),
+ delete: d(function (key) {
+ var index = eIndexOf.call(this.__mapKeysData__, key);
+ if (index === -1) return false;
+ this.__mapKeysData__.splice(index, 1);
+ this.__mapValuesData__.splice(index, 1);
+ this.emit('_delete', index, key);
+ return true;
+ }),
+ entries: d(function () { return new Iterator(this, 'key+value'); }),
+ forEach: d(function (cb/*, thisArg*/) {
+ var thisArg = arguments[1], iterator, result;
+ callable(cb);
+ iterator = this.entries();
+ result = iterator._next();
+ while (result !== undefined) {
+ call.call(cb, thisArg, this.__mapValuesData__[result],
+ this.__mapKeysData__[result], this);
+ result = iterator._next();
+ }
+ }),
+ get: d(function (key) {
+ var index = eIndexOf.call(this.__mapKeysData__, key);
+ if (index === -1) return;
+ return this.__mapValuesData__[index];
+ }),
+ has: d(function (key) {
+ return (eIndexOf.call(this.__mapKeysData__, key) !== -1);
+ }),
+ keys: d(function () { return new Iterator(this, 'key'); }),
+ set: d(function (key, value) {
+ var index = eIndexOf.call(this.__mapKeysData__, key), emit;
+ if (index === -1) {
+ index = this.__mapKeysData__.push(key) - 1;
+ emit = true;
+ }
+ this.__mapValuesData__[index] = value;
+ if (emit) this.emit('_add', index, key);
+ return this;
+ }),
+ size: d.gs(function () { return this.__mapKeysData__.length; }),
+ values: d(function () { return new Iterator(this, 'value'); }),
+ toString: d(function () { return '[object Map]'; })
+}));
+Object.defineProperty(MapPoly.prototype, Symbol.iterator, d(function () {
+ return this.entries();
+}));
+Object.defineProperty(MapPoly.prototype, Symbol.toStringTag, d('c', 'Map'));
diff --git a/Nodejs/node_modules/es6-map/primitive/index.js b/Nodejs/node_modules/es6-map/primitive/index.js
new file mode 100644
index 0000000..8ac2143
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/primitive/index.js
@@ -0,0 +1,117 @@
+'use strict';
+
+var clear = require('es5-ext/object/clear')
+ , setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , validValue = require('es5-ext/object/valid-value')
+ , callable = require('es5-ext/object/valid-callable')
+ , d = require('d')
+ , iterator = require('es6-iterator/valid-iterable')
+ , forOf = require('es6-iterator/for-of')
+ , isNative = require('../is-native-implemented')
+ , MapPolyfill = require('../polyfill')
+ , Iterator = require('../lib/primitive-iterator')
+
+ , call = Function.prototype.call
+ , create = Object.create, defineProperty = Object.defineProperty
+ , defineProperties = Object.defineProperties, getPrototypeOf = Object.getPrototypeOf
+ , hasOwnProperty = Object.prototype.hasOwnProperty
+ , PrimitiveMap;
+
+module.exports = PrimitiveMap = function (/*iterable, serialize*/) {
+ var iterable = arguments[0], serialize = arguments[1], self;
+ if (!(this instanceof PrimitiveMap)) throw new TypeError('Constructor requires \'new\'');
+ if (isNative && setPrototypeOf && (Map !== MapPolyfill)) {
+ self = setPrototypeOf(new Map(), getPrototypeOf(this));
+ } else {
+ self = this;
+ }
+ if (iterable != null) iterator(iterable);
+ if (serialize !== undefined) {
+ callable(serialize);
+ defineProperty(self, '_serialize', d('', serialize));
+ }
+ defineProperties(self, {
+ __mapKeysData__: d('c', create(null)),
+ __mapValuesData__: d('c', create(null)),
+ __size__: d('w', 0)
+ });
+ if (!iterable) return self;
+ forOf(iterable, function (value) {
+ var key = validValue(value)[0], sKey = self._serialize(key);
+ if (sKey == null) throw new TypeError(key + " cannot be serialized");
+ value = value[1];
+ if (hasOwnProperty.call(self.__mapKeysData__, sKey)) {
+ if (self.__mapValuesData__[sKey] === value) return;
+ } else {
+ ++self.__size__;
+ }
+ self.__mapKeysData__[sKey] = key;
+ self.__mapValuesData__[sKey] = value;
+ });
+ return self;
+};
+if (setPrototypeOf) setPrototypeOf(PrimitiveMap, MapPolyfill);
+
+PrimitiveMap.prototype = create(MapPolyfill.prototype, {
+ constructor: d(PrimitiveMap),
+ _serialize: d(function (value) {
+ if (value && (typeof value.toString !== 'function')) return null;
+ return String(value);
+ }),
+ clear: d(function () {
+ if (!this.__size__) return;
+ clear(this.__mapKeysData__);
+ clear(this.__mapValuesData__);
+ this.__size__ = 0;
+ this.emit('_clear');
+ }),
+ delete: d(function (key) {
+ var sKey = this._serialize(key);
+ if (sKey == null) return false;
+ if (!hasOwnProperty.call(this.__mapKeysData__, sKey)) return false;
+ delete this.__mapKeysData__[sKey];
+ delete this.__mapValuesData__[sKey];
+ --this.__size__;
+ this.emit('_delete', sKey);
+ return true;
+ }),
+ entries: d(function () { return new Iterator(this, 'key+value'); }),
+ forEach: d(function (cb/*, thisArg*/) {
+ var thisArg = arguments[1], iterator, result, sKey;
+ callable(cb);
+ iterator = this.entries();
+ result = iterator._next();
+ while (result !== undefined) {
+ sKey = iterator.__list__[result];
+ call.call(cb, thisArg, this.__mapValuesData__[sKey],
+ this.__mapKeysData__[sKey], this);
+ result = iterator._next();
+ }
+ }),
+ get: d(function (key) {
+ var sKey = this._serialize(key);
+ if (sKey == null) return;
+ return this.__mapValuesData__[sKey];
+ }),
+ has: d(function (key) {
+ var sKey = this._serialize(key);
+ if (sKey == null) return false;
+ return hasOwnProperty.call(this.__mapKeysData__, sKey);
+ }),
+ keys: d(function () { return new Iterator(this, 'key'); }),
+ size: d.gs(function () { return this.__size__; }),
+ set: d(function (key, value) {
+ var sKey = this._serialize(key);
+ if (sKey == null) throw new TypeError(key + " cannot be serialized");
+ if (hasOwnProperty.call(this.__mapKeysData__, sKey)) {
+ if (this.__mapValuesData__[sKey] === value) return this;
+ } else {
+ ++this.__size__;
+ }
+ this.__mapKeysData__[sKey] = key;
+ this.__mapValuesData__[sKey] = value;
+ this.emit('_add', sKey);
+ return this;
+ }),
+ values: d(function () { return new Iterator(this, 'value'); })
+});
diff --git a/Nodejs/node_modules/es6-map/test/implement.js b/Nodejs/node_modules/es6-map/test/implement.js
new file mode 100644
index 0000000..3569df6
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/implement.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = function (t, a) { a(typeof Map, 'function'); };
diff --git a/Nodejs/node_modules/es6-map/test/index.js b/Nodejs/node_modules/es6-map/test/index.js
new file mode 100644
index 0000000..907b8c5
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/index.js
@@ -0,0 +1,5 @@
+'use strict';
+
+module.exports = function (T, a) {
+ a((new T([['raz', 1], ['dwa', 2]])).size, 2);
+};
diff --git a/Nodejs/node_modules/es6-map/test/is-implemented.js b/Nodejs/node_modules/es6-map/test/is-implemented.js
new file mode 100644
index 0000000..06df91c
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/is-implemented.js
@@ -0,0 +1,14 @@
+'use strict';
+
+var global = require('es5-ext/global')
+ , polyfill = require('../polyfill');
+
+module.exports = function (t, a) {
+ var cache;
+ a(typeof t(), 'boolean');
+ cache = global.Map;
+ global.Map = polyfill;
+ a(t(), true);
+ if (cache === undefined) delete global.Map;
+ else global.Map = cache;
+};
diff --git a/Nodejs/node_modules/es6-map/test/is-map.js b/Nodejs/node_modules/es6-map/test/is-map.js
new file mode 100644
index 0000000..f600b22
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/is-map.js
@@ -0,0 +1,16 @@
+'use strict';
+
+var MapPoly = require('../polyfill');
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(true), false, "Primitive");
+ a(t('raz'), false, "String");
+ a(t({}), false, "Object");
+ a(t([]), false, "Array");
+ if (typeof Map !== 'undefined') {
+ a(t(new Map()), true, "Native");
+ }
+ a(t(new MapPoly()), true, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-map/test/is-native-implemented.js b/Nodejs/node_modules/es6-map/test/is-native-implemented.js
new file mode 100644
index 0000000..df8ba03
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/is-native-implemented.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = function (t, a) { a(typeof t, 'boolean'); };
diff --git a/Nodejs/node_modules/es6-map/test/lib/iterator-kinds.js b/Nodejs/node_modules/es6-map/test/lib/iterator-kinds.js
new file mode 100644
index 0000000..41ea10c
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/lib/iterator-kinds.js
@@ -0,0 +1,5 @@
+'use strict';
+
+module.exports = function (t, a) {
+ a.deep(t, { key: true, value: true, 'key+value': true });
+};
diff --git a/Nodejs/node_modules/es6-map/test/lib/iterator.js b/Nodejs/node_modules/es6-map/test/lib/iterator.js
new file mode 100644
index 0000000..2688ed2
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/lib/iterator.js
@@ -0,0 +1,13 @@
+'use strict';
+
+var Map = require('../../polyfill')
+ , toArray = require('es5-ext/array/to-array');
+
+module.exports = function (T, a) {
+ var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr);
+
+ a.deep(toArray(new T(map)), arr, "Default");
+ a.deep(toArray(new T(map, 'key+value')), arr, "Key & Value");
+ a.deep(toArray(new T(map, 'value')), ['one', 'two'], "Value");
+ a.deep(toArray(new T(map, 'key')), ['raz', 'dwa'], "Value");
+};
diff --git a/Nodejs/node_modules/es6-map/test/lib/primitive-iterator.js b/Nodejs/node_modules/es6-map/test/lib/primitive-iterator.js
new file mode 100644
index 0000000..ed2790d
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/lib/primitive-iterator.js
@@ -0,0 +1,130 @@
+'use strict';
+
+var iteratorSymbol = require('es6-symbol').iterator
+ , toArray = require('es5-ext/array/to-array')
+ , Map = require('../../primitive')
+
+ , compare, mapToResults;
+
+compare = function (a, b) {
+ if (!a.value) return -1;
+ if (!b.value) return 1;
+ return a.value[0].localeCompare(b.value[0]);
+};
+
+mapToResults = function (arr) {
+ return arr.sort().map(function (value) {
+ return { done: false, value: value };
+ });
+};
+
+module.exports = function (T) {
+ return {
+ "": function (a) {
+ var arr, it, y, z, map, result = [];
+
+ arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
+ ['cztery', 'four'], ['pięć', 'five']];
+ map = new Map(arr);
+
+ it = new T(map);
+ a(it[iteratorSymbol](), it, "@@iterator");
+ y = it.next();
+ result.push(y);
+ z = it.next();
+ a.not(y, z, "Recreate result");
+ result.push(z);
+ result.push(it.next());
+ result.push(it.next());
+ result.push(it.next());
+ a.deep(result.sort(compare), mapToResults(arr));
+ a.deep(y = it.next(), { done: true, value: undefined }, "End");
+ a.not(y, it.next(), "Recreate result on dead");
+ },
+ Emited: function (a) {
+ var arr, it, map, result = [];
+
+ arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
+ ['cztery', 'four'], ['pięć', 'five']];
+ map = new Map(arr);
+
+ it = new T(map);
+ result.push(it.next());
+ result.push(it.next());
+ map.set('sześć', 'six');
+ arr.push(['sześć', 'six']);
+ result.push(it.next());
+ map.delete('pięć');
+ arr.splice(4, 1);
+ result.push(it.next());
+ result.push(it.next());
+ a.deep(result.sort(compare), mapToResults(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited #2": function (a) {
+ var arr, it, map, result = [];
+
+ arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
+ ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']];
+ map = new Map(arr);
+
+ it = new T(map);
+ result.push(it.next());
+ result.push(it.next());
+ map.set('siedem', 'seven');
+ map.delete('siedem');
+ result.push(it.next());
+ result.push(it.next());
+ map.delete('pięć');
+ arr.splice(4, 1);
+ result.push(it.next());
+ a.deep(result.sort(compare), mapToResults(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited: Clear #1": function (a) {
+ var arr, it, map, result = [];
+
+ arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
+ ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']];
+ map = new Map(arr);
+
+ it = new T(map);
+ result.push(it.next());
+ result.push(it.next());
+ arr = [['raz', 'one'], ['dwa', 'two']];
+ map.clear();
+ a.deep(result.sort(compare), mapToResults(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited: Clear #2": function (a) {
+ var arr, it, map, result = [];
+
+ arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three'],
+ ['cztery', 'four'], ['pięć', 'five'], ['sześć', 'six']];
+ map = new Map(arr);
+
+ it = new T(map);
+ result.push(it.next());
+ result.push(it.next());
+ map.clear();
+ map.set('foo', 'bru');
+ map.set('bar', 'far');
+ arr = [['raz', 'one'], ['dwa', 'two'], ['foo', 'bru'], ['bar', 'far']];
+ result.push(it.next());
+ result.push(it.next());
+ a.deep(result.sort(compare), mapToResults(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ Kinds: function (a) {
+ var arr = [['raz', 'one'], ['dwa', 'two']], map = new Map(arr);
+
+ a.deep(toArray(new T(map)).sort(), arr.sort(), "Default");
+ a.deep(toArray(new T(map, 'key+value')).sort(), arr.sort(),
+ "Key + Value");
+ a.deep(toArray(new T(map, 'value')).sort(), ['one', 'two'].sort(),
+ "Value");
+ a.deep(toArray(new T(map, 'key')).sort(), ['raz', 'dwa'].sort(),
+ "Key");
+ }
+ };
+};
diff --git a/Nodejs/node_modules/es6-map/test/polyfill.js b/Nodejs/node_modules/es6-map/test/polyfill.js
new file mode 100644
index 0000000..6816cb0
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/polyfill.js
@@ -0,0 +1,60 @@
+'use strict';
+
+var aFrom = require('es5-ext/array/from')
+ , toArray = require('es5-ext/array/to-array');
+
+module.exports = function (T, a) {
+ var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]
+ , map = new T(arr), x = {}, y = {}, i = 0;
+
+ a(map instanceof T, true, "Map");
+ a(map.size, 3, "Size");
+ a(map.get('raz'), 'one', "Get: contained");
+ a(map.get(x), undefined, "Get: not contained");
+ a(map.has('raz'), true, "Has: contained");
+ a(map.has(x), false, "Has: not contained");
+ a(map.set(x, y), map, "Set: return");
+ a(map.has(x), true, "Set: has");
+ a(map.get(x), y, "Set: get");
+ a(map.size, 4, "Set: Size");
+ map.set('dwa', x);
+ a(map.get('dwa'), x, "Overwrite: get");
+ a(map.size, 4, "Overwrite: size");
+
+ a(map.delete({}), false, "Delete: false");
+
+ arr.push([x, y]);
+ arr[1][1] = x;
+ map.forEach(function () {
+ a.deep(aFrom(arguments), [arr[i][1], arr[i][0], map],
+ "ForEach: Arguments: #" + i);
+ a(this, y, "ForEach: Context: #" + i);
+ if (i === 0) {
+ a(map.delete('raz'), true, "Delete: true");
+ a(map.has('raz'), false, "Delete");
+ a(map.size, 3, "Delete: size");
+ map.set('cztery', 'four');
+ arr.push(['cztery', 'four']);
+ }
+ i++;
+ }, y);
+ arr.splice(0, 1);
+
+ a.deep(toArray(map.entries()), [['dwa', x], ['trzy', 'three'], [x, y],
+ ['cztery', 'four']], "Entries");
+ a.deep(toArray(map.keys()), ['dwa', 'trzy', x, 'cztery'], "Keys");
+ a.deep(toArray(map.values()), [x, 'three', y, 'four'], "Values");
+ a.deep(toArray(map), [['dwa', x], ['trzy', 'three'], [x, y],
+ ['cztery', 'four']], "Iterator");
+
+ map.clear();
+ a(map.size, 0, "Clear: size");
+ a(map.has('trzy'), false, "Clear: has");
+ a.deep(toArray(map), [], "Clear: Values");
+
+ a.h1("Empty initialization");
+ map = new T();
+ map.set('foo', 'bar');
+ a(map.size, 1);
+ a(map.get('foo'), 'bar');
+};
diff --git a/Nodejs/node_modules/es6-map/test/primitive/index.js b/Nodejs/node_modules/es6-map/test/primitive/index.js
new file mode 100644
index 0000000..a99c685
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/primitive/index.js
@@ -0,0 +1,59 @@
+'use strict';
+
+var aFrom = require('es5-ext/array/from')
+ , getIterator = require('es6-iterator/get')
+ , toArray = require('es5-ext/array/to-array');
+
+module.exports = function (T, a) {
+ var arr = [['raz', 'one'], ['dwa', 'two'], ['trzy', 'three']]
+ , map = new T(arr), x = 'other', y = 'other2'
+ , i = 0, result = [];
+
+ a(map instanceof T, true, "Map");
+ a(map.size, 3, "Size");
+ a(map.get('raz'), 'one', "Get: contained");
+ a(map.get(x), undefined, "Get: not contained");
+ a(map.has('raz'), true, "Has: true");
+ a(map.has(x), false, "Has: false");
+ a(map.set(x, y), map, "Add: return");
+ a(map.has(x), true, "Add");
+ a(map.size, 4, "Add: Size");
+ map.set('dwa', x);
+ a(map.get('dwa'), x, "Overwrite: get");
+ a(map.size, 4, "Overwrite: size");
+
+ a(map.delete('else'), false, "Delete: false");
+
+ arr.push([x, y]);
+ arr[1][1] = x;
+ map.forEach(function () {
+ result.push(aFrom(arguments));
+ a(this, y, "ForEach: Context: #" + i);
+ }, y);
+
+ a.deep(result.sort(function (a, b) {
+ return String([a[1], a[0]]).localeCompare([b[1], b[0]]);
+ }), arr.sort().map(function (val) { return [val[1], val[0], map]; }),
+ "ForEach: Arguments");
+
+ a.deep(toArray(map.entries()).sort(), [['dwa', x], ['trzy', 'three'],
+ [x, y], ['raz', 'one']].sort(), "Entries");
+ a.deep(toArray(map.keys()).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
+ "Keys");
+ a.deep(toArray(map.values()).sort(), [x, 'three', y, 'one'].sort(),
+ "Values");
+ a.deep(toArray(getIterator(map)).sort(), [['dwa', x], ['trzy', 'three'],
+ [x, y], ['raz', 'one']].sort(),
+ "Iterator");
+
+ map.clear();
+ a(map.size, 0, "Clear: size");
+ a(map.has('trzy'), false, "Clear: has");
+ a.deep(toArray(map.values()), [], "Clear: Values");
+
+ a.h1("Empty initialization");
+ map = new T();
+ map.set('foo', 'bar');
+ a(map.size, 1);
+ a(map.get('foo'), 'bar');
+};
diff --git a/Nodejs/node_modules/es6-map/test/valid-map.js b/Nodejs/node_modules/es6-map/test/valid-map.js
new file mode 100644
index 0000000..ac03149
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/test/valid-map.js
@@ -0,0 +1,19 @@
+'use strict';
+
+var MapPoly = require('../polyfill');
+
+module.exports = function (t, a) {
+ var map;
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a.throws(function () { t(true); }, TypeError, "Primitive");
+ a.throws(function () { t('raz'); }, TypeError, "String");
+ a.throws(function () { t({}); }, TypeError, "Object");
+ a.throws(function () { t([]); }, TypeError, "Array");
+ if (typeof Map !== 'undefined') {
+ map = new Map();
+ a(t(map), map, "Native");
+ }
+ map = new MapPoly();
+ a(t(map), map, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-map/valid-map.js b/Nodejs/node_modules/es6-map/valid-map.js
new file mode 100644
index 0000000..e2aca87
--- /dev/null
+++ b/Nodejs/node_modules/es6-map/valid-map.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var isMap = require('./is-map');
+
+module.exports = function (x) {
+ if (!isMap(x)) throw new TypeError(x + " is not a Map");
+ return x;
+};
diff --git a/Nodejs/node_modules/es6-set/.lint b/Nodejs/node_modules/es6-set/.lint
new file mode 100644
index 0000000..89386b3
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/.lint
@@ -0,0 +1,13 @@
+@root
+
+module
+
+tabs
+indent 2
+maxlen 100
+
+ass
+nomen
+plusplus
+
+predef+ Set
diff --git a/Nodejs/node_modules/es6-set/.npmignore b/Nodejs/node_modules/es6-set/.npmignore
new file mode 100644
index 0000000..155e41f
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/.npmignore
@@ -0,0 +1,4 @@
+.DS_Store
+/node_modules
+/npm-debug.log
+/.lintcache
diff --git a/Nodejs/node_modules/es6-set/.travis.yml b/Nodejs/node_modules/es6-set/.travis.yml
new file mode 100644
index 0000000..09a917c
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/.travis.yml
@@ -0,0 +1,13 @@
+sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
+language: node_js
+node_js:
+ - 0.12
+ - 4
+ - 6
+ - 7
+
+notifications:
+ email:
+ - medikoo+es6-set@medikoo.com
+
+script: "npm test && npm run lint"
diff --git a/Nodejs/node_modules/es6-set/CHANGES b/Nodejs/node_modules/es6-set/CHANGES
new file mode 100644
index 0000000..21ad4bf
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/CHANGES
@@ -0,0 +1,34 @@
+v0.1.5 -- 2017.03.16
+* Improve documentation
+* Update dependencies
+
+v0.1.4 -- 2016.01.19
+* Ensure Set polyfill function name is `Set` (#2)
+
+v0.1.3 -- 2015.11.18
+* Relax validation of native implementation (do not require proper stringification of Set.prototype)
+
+v0.1.2 -- 2015.10.02
+* Improve native Set detection
+* Fix spelling of LICENSE
+* Set.prototype.filter extension
+* Update dependencies
+
+v0.1.1 -- 2014.10.07
+* Fix isImplemented so it validates native Set properly
+* Add getFirst and getLast extensions
+* Configure linter scripts
+
+v0.1.0 -- 2014.04.29
+* Assure strictly npm hosted dependencies
+* Introduce faster 'primitive' alternative (doesn't guarantee order of iteration)
+* Add isNativeImplemented, and some, every and copy method extensions
+* If native Set is provided polyfill extends it
+* Optimize forEach iteration
+* Remove comparator support (as it was removed from spec)
+* Provide @@toStringTag symbol, ad @@iterator symbols on iterators
+* Update to use latest dependencies versions
+* Improve interals
+
+v0.0.0 -- 2013.10.12
+Initial (dev) version
diff --git a/Nodejs/node_modules/es6-set/LICENSE b/Nodejs/node_modules/es6-set/LICENSE
new file mode 100644
index 0000000..aaf3528
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2013 Mariusz Nowak (www.medikoo.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/es6-set/README.md b/Nodejs/node_modules/es6-set/README.md
new file mode 100644
index 0000000..4ec0a00
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/README.md
@@ -0,0 +1,74 @@
+# es6-set
+## Set collection as specified in ECMAScript6
+
+__Warning:
+v0.1 version does not ensure O(1) algorithm complexity (but O(n)). This shortcoming will be addressed in v1.0__
+
+### Usage
+
+If you want to make sure your environment implements `Set`, do:
+
+```javascript
+require('es6-set/implement');
+```
+
+If you'd like to use native version when it exists and fallback to polyfill if it doesn't, but without implementing `Set` on global scope, do:
+
+```javascript
+var Set = require('es6-set');
+```
+
+If you strictly want to use polyfill even if native `Set` exists, do:
+
+```javascript
+var Set = require('es6-set/polyfill');
+```
+
+### Installation
+
+ $ npm install es6-set
+
+To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
+
+#### API
+
+Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-set-objects). Still if you want quick look, follow examples:
+
+```javascript
+var Set = require('es6-set');
+
+var set = new Set(['raz', 'dwa', {}]);
+
+set.size; // 3
+set.has('raz'); // true
+set.has('foo'); // false
+set.add('foo'); // set
+set.size // 4
+set.has('foo'); // true
+set.has('dwa'); // true
+set.delete('dwa'); // true
+set.size; // 3
+
+set.forEach(function (value) {
+ // 'raz', {}, 'foo' iterated
+});
+
+// FF nightly only:
+for (value of set) {
+ // 'raz', {}, 'foo' iterated
+}
+
+var iterator = set.values();
+
+iterator.next(); // { done: false, value: 'raz' }
+iterator.next(); // { done: false, value: {} }
+iterator.next(); // { done: false, value: 'foo' }
+iterator.next(); // { done: true, value: undefined }
+
+set.clear(); // undefined
+set.size; // 0
+```
+
+## Tests [](https://travis-ci.org/medikoo/es6-set)
+
+ $ npm test
diff --git a/Nodejs/node_modules/es6-set/ext/copy.js b/Nodejs/node_modules/es6-set/ext/copy.js
new file mode 100644
index 0000000..a8fd5c2
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/ext/copy.js
@@ -0,0 +1,5 @@
+'use strict';
+
+var Set = require('../');
+
+module.exports = function () { return new Set(this); };
diff --git a/Nodejs/node_modules/es6-set/ext/every.js b/Nodejs/node_modules/es6-set/ext/every.js
new file mode 100644
index 0000000..ea64ebc
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/ext/every.js
@@ -0,0 +1,18 @@
+'use strict';
+
+var callable = require('es5-ext/object/valid-callable')
+ , forOf = require('es6-iterator/for-of')
+
+ , call = Function.prototype.call;
+
+module.exports = function (cb/*, thisArg*/) {
+ var thisArg = arguments[1], result = true;
+ callable(cb);
+ forOf(this, function (value, doBreak) {
+ if (!call.call(cb, thisArg, value)) {
+ result = false;
+ doBreak();
+ }
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es6-set/ext/filter.js b/Nodejs/node_modules/es6-set/ext/filter.js
new file mode 100644
index 0000000..1178fc5
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/ext/filter.js
@@ -0,0 +1,18 @@
+'use strict';
+
+var callable = require('es5-ext/object/valid-callable')
+ , forOf = require('es6-iterator/for-of')
+ , isSet = require('../is-set')
+ , Set = require('../')
+
+ , call = Function.prototype.call;
+
+module.exports = function (cb/*, thisArg*/) {
+ var thisArg = arguments[1], result;
+ callable(cb);
+ result = isSet(this) ? new this.constructor() : new Set();
+ forOf(this, function (value) {
+ if (call.call(cb, thisArg, value)) result.add(value);
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es6-set/ext/get-first.js b/Nodejs/node_modules/es6-set/ext/get-first.js
new file mode 100644
index 0000000..b5d89fc
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/ext/get-first.js
@@ -0,0 +1,5 @@
+'use strict';
+
+module.exports = function () {
+ return this.values().next().value;
+};
diff --git a/Nodejs/node_modules/es6-set/ext/get-last.js b/Nodejs/node_modules/es6-set/ext/get-last.js
new file mode 100644
index 0000000..d22ce73
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/ext/get-last.js
@@ -0,0 +1,11 @@
+'use strict';
+
+module.exports = function () {
+ var value, iterator = this.values(), item;
+ while (true) {
+ item = iterator.next();
+ if (item.done) break;
+ value = item.value;
+ }
+ return value;
+};
diff --git a/Nodejs/node_modules/es6-set/ext/some.js b/Nodejs/node_modules/es6-set/ext/some.js
new file mode 100644
index 0000000..400a5a0
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/ext/some.js
@@ -0,0 +1,18 @@
+'use strict';
+
+var callable = require('es5-ext/object/valid-callable')
+ , forOf = require('es6-iterator/for-of')
+
+ , call = Function.prototype.call;
+
+module.exports = function (cb/*, thisArg*/) {
+ var thisArg = arguments[1], result = false;
+ callable(cb);
+ forOf(this, function (value, doBreak) {
+ if (call.call(cb, thisArg, value)) {
+ result = true;
+ doBreak();
+ }
+ });
+ return result;
+};
diff --git a/Nodejs/node_modules/es6-set/implement.js b/Nodejs/node_modules/es6-set/implement.js
new file mode 100644
index 0000000..f03362e
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/implement.js
@@ -0,0 +1,7 @@
+'use strict';
+
+if (!require('./is-implemented')()) {
+ Object.defineProperty(require('es5-ext/global'), 'Set',
+ { value: require('./polyfill'), configurable: true, enumerable: false,
+ writable: true });
+}
diff --git a/Nodejs/node_modules/es6-set/index.js b/Nodejs/node_modules/es6-set/index.js
new file mode 100644
index 0000000..daa7886
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/index.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./is-implemented')() ? Set : require('./polyfill');
diff --git a/Nodejs/node_modules/es6-set/is-implemented.js b/Nodejs/node_modules/es6-set/is-implemented.js
new file mode 100644
index 0000000..7f1bfbb
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/is-implemented.js
@@ -0,0 +1,24 @@
+'use strict';
+
+module.exports = function () {
+ var set, iterator, result;
+ if (typeof Set !== 'function') return false;
+ set = new Set(['raz', 'dwa', 'trzy']);
+ if (String(set) !== '[object Set]') return false;
+ if (set.size !== 3) return false;
+ if (typeof set.add !== 'function') return false;
+ if (typeof set.clear !== 'function') return false;
+ if (typeof set.delete !== 'function') return false;
+ if (typeof set.entries !== 'function') return false;
+ if (typeof set.forEach !== 'function') return false;
+ if (typeof set.has !== 'function') return false;
+ if (typeof set.keys !== 'function') return false;
+ if (typeof set.values !== 'function') return false;
+
+ iterator = set.values();
+ result = iterator.next();
+ if (result.done !== false) return false;
+ if (result.value !== 'raz') return false;
+
+ return true;
+};
diff --git a/Nodejs/node_modules/es6-set/is-native-implemented.js b/Nodejs/node_modules/es6-set/is-native-implemented.js
new file mode 100644
index 0000000..e8b0160
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/is-native-implemented.js
@@ -0,0 +1,9 @@
+// Exports true if environment provides native `Set` implementation,
+// whatever that is.
+
+'use strict';
+
+module.exports = (function () {
+ if (typeof Set === 'undefined') return false;
+ return (Object.prototype.toString.call(Set.prototype) === '[object Set]');
+}());
diff --git a/Nodejs/node_modules/es6-set/is-set.js b/Nodejs/node_modules/es6-set/is-set.js
new file mode 100644
index 0000000..6b491dd
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/is-set.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var toString = Object.prototype.toString
+ , toStringTagSymbol = require('es6-symbol').toStringTag
+
+ , id = '[object Set]'
+ , Global = (typeof Set === 'undefined') ? null : Set;
+
+module.exports = function (x) {
+ return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) ||
+ (toString.call(x) === id) || (x[toStringTagSymbol] === 'Set'))) || false;
+};
diff --git a/Nodejs/node_modules/es6-set/lib/iterator.js b/Nodejs/node_modules/es6-set/lib/iterator.js
new file mode 100644
index 0000000..6069a8a
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/lib/iterator.js
@@ -0,0 +1,30 @@
+'use strict';
+
+var setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , contains = require('es5-ext/string/#/contains')
+ , d = require('d')
+ , Iterator = require('es6-iterator')
+ , toStringTagSymbol = require('es6-symbol').toStringTag
+
+ , defineProperty = Object.defineProperty
+ , SetIterator;
+
+SetIterator = module.exports = function (set, kind) {
+ if (!(this instanceof SetIterator)) return new SetIterator(set, kind);
+ Iterator.call(this, set.__setData__, set);
+ if (!kind) kind = 'value';
+ else if (contains.call(kind, 'key+value')) kind = 'key+value';
+ else kind = 'value';
+ defineProperty(this, '__kind__', d('', kind));
+};
+if (setPrototypeOf) setPrototypeOf(SetIterator, Iterator);
+
+SetIterator.prototype = Object.create(Iterator.prototype, {
+ constructor: d(SetIterator),
+ _resolve: d(function (i) {
+ if (this.__kind__ === 'value') return this.__list__[i];
+ return [this.__list__[i], this.__list__[i]];
+ }),
+ toString: d(function () { return '[object Set Iterator]'; })
+});
+defineProperty(SetIterator.prototype, toStringTagSymbol, d('c', 'Set Iterator'));
diff --git a/Nodejs/node_modules/es6-set/lib/primitive-iterator.js b/Nodejs/node_modules/es6-set/lib/primitive-iterator.js
new file mode 100644
index 0000000..1f0326a
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/lib/primitive-iterator.js
@@ -0,0 +1,53 @@
+'use strict';
+
+var clear = require('es5-ext/array/#/clear')
+ , assign = require('es5-ext/object/assign')
+ , setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , contains = require('es5-ext/string/#/contains')
+ , d = require('d')
+ , autoBind = require('d/auto-bind')
+ , Iterator = require('es6-iterator')
+ , toStringTagSymbol = require('es6-symbol').toStringTag
+
+ , defineProperties = Object.defineProperties, keys = Object.keys
+ , unBind = Iterator.prototype._unBind
+ , PrimitiveSetIterator;
+
+PrimitiveSetIterator = module.exports = function (set, kind) {
+ if (!(this instanceof PrimitiveSetIterator)) {
+ return new PrimitiveSetIterator(set, kind);
+ }
+ Iterator.call(this, keys(set.__setData__), set);
+ kind = (!kind || !contains.call(kind, 'key+value')) ? 'value' : 'key+value';
+ defineProperties(this, {
+ __kind__: d('', kind),
+ __data__: d('w', set.__setData__)
+ });
+};
+if (setPrototypeOf) setPrototypeOf(PrimitiveSetIterator, Iterator);
+
+PrimitiveSetIterator.prototype = Object.create(Iterator.prototype, assign({
+ constructor: d(PrimitiveSetIterator),
+ _resolve: d(function (i) {
+ var value = this.__data__[this.__list__[i]];
+ return (this.__kind__ === 'value') ? value : [value, value];
+ }),
+ _unBind: d(function () {
+ this.__data__ = null;
+ unBind.call(this);
+ }),
+ toString: d(function () { return '[object Set Iterator]'; })
+}, autoBind({
+ _onAdd: d(function (key) { this.__list__.push(key); }),
+ _onDelete: d(function (key) {
+ var index = this.__list__.lastIndexOf(key);
+ if (index < this.__nextIndex__) return;
+ this.__list__.splice(index, 1);
+ }),
+ _onClear: d(function () {
+ clear.call(this.__list__);
+ this.__nextIndex__ = 0;
+ })
+})));
+Object.defineProperty(PrimitiveSetIterator.prototype, toStringTagSymbol,
+ d('c', 'Set Iterator'));
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.lint b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.lint
new file mode 100644
index 0000000..df1e53c
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.lint
@@ -0,0 +1,15 @@
+@root
+
+module
+
+tabs
+indent 2
+maxlen 100
+
+ass
+nomen
+plusplus
+newcap
+vars
+
+predef+ Symbol
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.npmignore b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.npmignore
new file mode 100644
index 0000000..155e41f
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.npmignore
@@ -0,0 +1,4 @@
+.DS_Store
+/node_modules
+/npm-debug.log
+/.lintcache
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.travis.yml b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.travis.yml
new file mode 100644
index 0000000..0b1f5e4
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/.travis.yml
@@ -0,0 +1,11 @@
+sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
+language: node_js
+node_js:
+ - 0.12
+ - v4
+ - v5
+ - v6
+
+notifications:
+ email:
+ - medikoo+es6-symbol@medikoo.com
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/CHANGES b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/CHANGES
new file mode 100644
index 0000000..017d409
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/CHANGES
@@ -0,0 +1,57 @@
+v3.1.1 -- 2017.03.15
+* Improve documentation
+* Improve error messages
+* Update dependencies
+
+v3.1.0 -- 2016.06.03
+* Fix internals of symbol detection
+* Ensure Symbol.prototype[Symbol.toPrimitive] in all cases returns primitive value
+ (fixes Node v6 support)
+* Create native symbols whenver possible
+
+v3.0.2 -- 2015.12.12
+* Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of
+ polyfill. See #13
+
+v3.0.1 -- 2015.10.22
+* Workaround for IE11 bug (reported in #12)
+
+v3.0.0 -- 2015.10.02
+* Reuse native symbols (e.g. iterator, toStringTag etc.) in a polyfill if they're available
+ Otherwise polyfill symbols may not be recognized by other functions
+* Improve documentation
+
+v2.0.1 -- 2015.01.28
+* Fix Symbol.prototype[Symbol.isPrimitive] implementation
+* Improve validation within Symbol.prototype.toString and
+ Symbol.prototype.valueOf
+
+v2.0.0 -- 2015.01.28
+* Update up to changes in specification:
+ * Implement `for` and `keyFor`
+ * Remove `Symbol.create` and `Symbol.isRegExp`
+ * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and
+ `Symbol.split`
+* Rename `validSymbol` to `validateSymbol`
+* Improve documentation
+* Remove dead test modules
+
+v1.0.0 -- 2015.01.26
+* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value)
+* Introduce initialization via hidden constructor
+* Fix isSymbol handling of polyfill values when native Symbol is present
+* Fix spelling of LICENSE
+* Configure lint scripts
+
+v0.1.1 -- 2014.10.07
+* Fix isImplemented, so it returns true in case of polyfill
+* Improve documentations
+
+v0.1.0 -- 2014.04.28
+* Assure strictly npm dependencies
+* Update to use latest versions of dependencies
+* Fix implementation detection so it doesn't crash on `String(symbol)`
+* throw on `new Symbol()` (as decided by TC39)
+
+v0.0.0 -- 2013.11.15
+* Initial (dev) version
\ No newline at end of file
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/LICENSE b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/LICENSE
new file mode 100644
index 0000000..04724a3
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2013-2015 Mariusz Nowak (www.medikoo.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/README.md b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/README.md
new file mode 100644
index 0000000..fea9906
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/README.md
@@ -0,0 +1,71 @@
+# es6-symbol
+## ECMAScript 6 Symbol polyfill
+
+For more information about symbols see following links
+- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html)
+- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
+- [Specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-constructor)
+
+### Limitations
+
+Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely.
+
+### Usage
+
+If you'd like to use native version when it exists and fallback to [ponyfill](https://ponyfill.com) if it doesn't, use *es6-symbol* as following:
+
+```javascript
+var Symbol = require('es6-symbol');
+```
+
+If you want to make sure your environment implements `Symbol` globally, do:
+
+```javascript
+require('es6-symbol/implement');
+```
+
+If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:
+
+```javascript
+var Symbol = require('es6-symbol/polyfill');
+```
+
+#### API
+
+Best is to refer to [specification](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-symbol-objects). Still if you want quick look, follow examples:
+
+```javascript
+var Symbol = require('es6-symbol');
+
+var symbol = Symbol('My custom symbol');
+var x = {};
+
+x[symbol] = 'foo';
+console.log(x[symbol]); 'foo'
+
+// Detect iterable:
+var iterator, result;
+if (possiblyIterable[Symbol.iterator]) {
+ iterator = possiblyIterable[Symbol.iterator]();
+ result = iterator.next();
+ while(!result.done) {
+ console.log(result.value);
+ result = iterator.next();
+ }
+}
+```
+
+### Installation
+#### NPM
+
+In your project path:
+
+ $ npm install es6-symbol
+
+##### Browser
+
+To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
+
+## Tests [](https://travis-ci.org/medikoo/es6-symbol)
+
+ $ npm test
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/implement.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/implement.js
new file mode 100644
index 0000000..153edac
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/implement.js
@@ -0,0 +1,7 @@
+'use strict';
+
+if (!require('./is-implemented')()) {
+ Object.defineProperty(require('es5-ext/global'), 'Symbol',
+ { value: require('./polyfill'), configurable: true, enumerable: false,
+ writable: true });
+}
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/index.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/index.js
new file mode 100644
index 0000000..609f1fa
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/index.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = require('./is-implemented')() ? Symbol : require('./polyfill');
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-implemented.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-implemented.js
new file mode 100644
index 0000000..93629d2
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-implemented.js
@@ -0,0 +1,17 @@
+'use strict';
+
+var validTypes = { object: true, symbol: true };
+
+module.exports = function () {
+ var symbol;
+ if (typeof Symbol !== 'function') return false;
+ symbol = Symbol('test symbol');
+ try { String(symbol); } catch (e) { return false; }
+
+ // Return 'true' also for polyfills
+ if (!validTypes[typeof Symbol.iterator]) return false;
+ if (!validTypes[typeof Symbol.toPrimitive]) return false;
+ if (!validTypes[typeof Symbol.toStringTag]) return false;
+
+ return true;
+};
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-native-implemented.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-native-implemented.js
new file mode 100644
index 0000000..8676d0e
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-native-implemented.js
@@ -0,0 +1,5 @@
+// Exports true if environment provides native `Symbol` implementation
+
+'use strict';
+
+module.exports = typeof Symbol === 'function' && typeof Symbol() === 'symbol';
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-symbol.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-symbol.js
new file mode 100644
index 0000000..074cb07
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/is-symbol.js
@@ -0,0 +1,9 @@
+'use strict';
+
+module.exports = function (x) {
+ if (!x) return false;
+ if (typeof x === 'symbol') return true;
+ if (!x.constructor) return false;
+ if (x.constructor.name !== 'Symbol') return false;
+ return (x[x.constructor.toStringTag] === 'Symbol');
+};
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/package.json b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/package.json
new file mode 100644
index 0000000..db78ddf
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/package.json
@@ -0,0 +1,68 @@
+{
+ "_from": "es6-symbol@3.1.1",
+ "_id": "es6-symbol@3.1.1",
+ "_inBundle": false,
+ "_integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=",
+ "_location": "/es6-set/es6-symbol",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "es6-symbol@3.1.1",
+ "name": "es6-symbol",
+ "escapedName": "es6-symbol",
+ "rawSpec": "3.1.1",
+ "saveSpec": null,
+ "fetchSpec": "3.1.1"
+ },
+ "_requiredBy": [
+ "/es6-set"
+ ],
+ "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
+ "_shasum": "bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77",
+ "_spec": "es6-symbol@3.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/es6-set",
+ "author": {
+ "name": "Mariusz Nowak",
+ "email": "medyk@medikoo.com",
+ "url": "http://www.medikoo.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/medikoo/es6-symbol/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "d": "1",
+ "es5-ext": "~0.10.14"
+ },
+ "deprecated": false,
+ "description": "ECMAScript 6 Symbol polyfill",
+ "devDependencies": {
+ "tad": "~0.2.7",
+ "xlint": "~0.2.2",
+ "xlint-jslint-medikoo": "~0.1.4"
+ },
+ "homepage": "https://github.com/medikoo/es6-symbol#readme",
+ "keywords": [
+ "symbol",
+ "private",
+ "property",
+ "es6",
+ "ecmascript",
+ "harmony",
+ "ponyfill",
+ "polyfill"
+ ],
+ "license": "MIT",
+ "name": "es6-symbol",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/medikoo/es6-symbol.git"
+ },
+ "scripts": {
+ "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
+ "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
+ "test": "node ./node_modules/tad/bin/tad"
+ },
+ "version": "3.1.1"
+}
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/polyfill.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/polyfill.js
new file mode 100644
index 0000000..dca879a
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/polyfill.js
@@ -0,0 +1,118 @@
+// ES2015 Symbol polyfill for environments that do not (or partially) support it
+
+'use strict';
+
+var d = require('d')
+ , validateSymbol = require('./validate-symbol')
+
+ , create = Object.create, defineProperties = Object.defineProperties
+ , defineProperty = Object.defineProperty, objPrototype = Object.prototype
+ , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null)
+ , isNativeSafe;
+
+if (typeof Symbol === 'function') {
+ NativeSymbol = Symbol;
+ try {
+ String(NativeSymbol());
+ isNativeSafe = true;
+ } catch (ignore) {}
+}
+
+var generateName = (function () {
+ var created = create(null);
+ return function (desc) {
+ var postfix = 0, name, ie11BugWorkaround;
+ while (created[desc + (postfix || '')]) ++postfix;
+ desc += (postfix || '');
+ created[desc] = true;
+ name = '@@' + desc;
+ defineProperty(objPrototype, name, d.gs(null, function (value) {
+ // For IE11 issue see:
+ // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/
+ // ie11-broken-getters-on-dom-objects
+ // https://github.com/medikoo/es6-symbol/issues/12
+ if (ie11BugWorkaround) return;
+ ie11BugWorkaround = true;
+ defineProperty(this, name, d(value));
+ ie11BugWorkaround = false;
+ }));
+ return name;
+ };
+}());
+
+// Internal constructor (not one exposed) for creating Symbol instances.
+// This one is used to ensure that `someSymbol instanceof Symbol` always return false
+HiddenSymbol = function Symbol(description) {
+ if (this instanceof HiddenSymbol) throw new TypeError('Symbol is not a constructor');
+ return SymbolPolyfill(description);
+};
+
+// Exposed `Symbol` constructor
+// (returns instances of HiddenSymbol)
+module.exports = SymbolPolyfill = function Symbol(description) {
+ var symbol;
+ if (this instanceof Symbol) throw new TypeError('Symbol is not a constructor');
+ if (isNativeSafe) return NativeSymbol(description);
+ symbol = create(HiddenSymbol.prototype);
+ description = (description === undefined ? '' : String(description));
+ return defineProperties(symbol, {
+ __description__: d('', description),
+ __name__: d('', generateName(description))
+ });
+};
+defineProperties(SymbolPolyfill, {
+ for: d(function (key) {
+ if (globalSymbols[key]) return globalSymbols[key];
+ return (globalSymbols[key] = SymbolPolyfill(String(key)));
+ }),
+ keyFor: d(function (s) {
+ var key;
+ validateSymbol(s);
+ for (key in globalSymbols) if (globalSymbols[key] === s) return key;
+ }),
+
+ // To ensure proper interoperability with other native functions (e.g. Array.from)
+ // fallback to eventual native implementation of given symbol
+ hasInstance: d('', (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill('hasInstance')),
+ isConcatSpreadable: d('', (NativeSymbol && NativeSymbol.isConcatSpreadable) ||
+ SymbolPolyfill('isConcatSpreadable')),
+ iterator: d('', (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill('iterator')),
+ match: d('', (NativeSymbol && NativeSymbol.match) || SymbolPolyfill('match')),
+ replace: d('', (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill('replace')),
+ search: d('', (NativeSymbol && NativeSymbol.search) || SymbolPolyfill('search')),
+ species: d('', (NativeSymbol && NativeSymbol.species) || SymbolPolyfill('species')),
+ split: d('', (NativeSymbol && NativeSymbol.split) || SymbolPolyfill('split')),
+ toPrimitive: d('', (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill('toPrimitive')),
+ toStringTag: d('', (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill('toStringTag')),
+ unscopables: d('', (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill('unscopables'))
+});
+
+// Internal tweaks for real symbol producer
+defineProperties(HiddenSymbol.prototype, {
+ constructor: d(SymbolPolyfill),
+ toString: d('', function () { return this.__name__; })
+});
+
+// Proper implementation of methods exposed on Symbol.prototype
+// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype
+defineProperties(SymbolPolyfill.prototype, {
+ toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }),
+ valueOf: d(function () { return validateSymbol(this); })
+});
+defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () {
+ var symbol = validateSymbol(this);
+ if (typeof symbol === 'symbol') return symbol;
+ return symbol.toString();
+}));
+defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol'));
+
+// Proper implementaton of toPrimitive and toStringTag for returned symbol instances
+defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag,
+ d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
+
+// Note: It's important to define `toPrimitive` as last one, as some implementations
+// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)
+// And that may invoke error in definition flow:
+// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149
+defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
+ d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/implement.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/implement.js
new file mode 100644
index 0000000..eb35c30
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/implement.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = function (t, a) { a(typeof Symbol, 'function'); };
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/index.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/index.js
new file mode 100644
index 0000000..62b3296
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/index.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var d = require('d')
+
+ , defineProperty = Object.defineProperty;
+
+module.exports = function (T, a) {
+ var symbol = T('test'), x = {};
+ defineProperty(x, symbol, d('foo'));
+ a(x.test, undefined, "Name");
+ a(x[symbol], 'foo', "Get");
+};
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-implemented.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-implemented.js
new file mode 100644
index 0000000..bb0d645
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-implemented.js
@@ -0,0 +1,14 @@
+'use strict';
+
+var global = require('es5-ext/global')
+ , polyfill = require('../polyfill');
+
+module.exports = function (t, a) {
+ var cache;
+ a(typeof t(), 'boolean');
+ cache = global.Symbol;
+ global.Symbol = polyfill;
+ a(t(), true);
+ if (cache === undefined) delete global.Symbol;
+ else global.Symbol = cache;
+};
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-native-implemented.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-native-implemented.js
new file mode 100644
index 0000000..df8ba03
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-native-implemented.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = function (t, a) { a(typeof t, 'boolean'); };
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-symbol.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-symbol.js
new file mode 100644
index 0000000..ac24b9a
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/is-symbol.js
@@ -0,0 +1,16 @@
+'use strict';
+
+var SymbolPoly = require('../polyfill');
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(true), false, "Primitive");
+ a(t('raz'), false, "String");
+ a(t({}), false, "Object");
+ a(t([]), false, "Array");
+ if (typeof Symbol !== 'undefined') {
+ a(t(Symbol()), true, "Native");
+ }
+ a(t(SymbolPoly()), true, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/polyfill.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/polyfill.js
new file mode 100644
index 0000000..8b65790
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/polyfill.js
@@ -0,0 +1,29 @@
+'use strict';
+
+var d = require('d')
+ , isSymbol = require('../is-symbol')
+
+ , defineProperty = Object.defineProperty;
+
+module.exports = function (T, a) {
+ var symbol = T('test'), x = {};
+ defineProperty(x, symbol, d('foo'));
+ a(x.test, undefined, "Name");
+ a(x[symbol], 'foo', "Get");
+ a(x instanceof T, false);
+
+ a(isSymbol(symbol), true, "Symbol");
+ a(isSymbol(T.iterator), true, "iterator");
+ a(isSymbol(T.toStringTag), true, "toStringTag");
+
+ x = {};
+ x[symbol] = 'foo';
+ if (typeof symbol !== 'symbol') {
+ a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false,
+ value: 'foo', writable: true });
+ }
+ symbol = T.for('marko');
+ a(isSymbol(symbol), true);
+ a(T.for('marko'), symbol);
+ a(T.keyFor(symbol), 'marko');
+};
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/validate-symbol.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/validate-symbol.js
new file mode 100644
index 0000000..2c8f84c
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/test/validate-symbol.js
@@ -0,0 +1,19 @@
+'use strict';
+
+var SymbolPoly = require('../polyfill');
+
+module.exports = function (t, a) {
+ var symbol;
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a.throws(function () { t(true); }, TypeError, "Primitive");
+ a.throws(function () { t('raz'); }, TypeError, "String");
+ a.throws(function () { t({}); }, TypeError, "Object");
+ a.throws(function () { t([]); }, TypeError, "Array");
+ if (typeof Symbol !== 'undefined') {
+ symbol = Symbol();
+ a(t(symbol), symbol, "Native");
+ }
+ symbol = SymbolPoly();
+ a(t(symbol), symbol, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-set/node_modules/es6-symbol/validate-symbol.js b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/validate-symbol.js
new file mode 100644
index 0000000..4275004
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/node_modules/es6-symbol/validate-symbol.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var isSymbol = require('./is-symbol');
+
+module.exports = function (value) {
+ if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
+ return value;
+};
diff --git a/Nodejs/node_modules/es6-set/package.json b/Nodejs/node_modules/es6-set/package.json
new file mode 100644
index 0000000..0f4f99e
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/package.json
@@ -0,0 +1,72 @@
+{
+ "_from": "es6-set@~0.1.5",
+ "_id": "es6-set@0.1.5",
+ "_inBundle": false,
+ "_integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=",
+ "_location": "/es6-set",
+ "_phantomChildren": {
+ "d": "1.0.1",
+ "es5-ext": "0.10.53"
+ },
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "es6-set@~0.1.5",
+ "name": "es6-set",
+ "escapedName": "es6-set",
+ "rawSpec": "~0.1.5",
+ "saveSpec": null,
+ "fetchSpec": "~0.1.5"
+ },
+ "_requiredBy": [
+ "/es6-map"
+ ],
+ "_resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
+ "_shasum": "d2b3ec5d4d800ced818db538d28974db0a73ccb1",
+ "_spec": "es6-set@~0.1.5",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/es6-map",
+ "author": {
+ "name": "Mariusz Nowak",
+ "email": "medyk@medikoo.com",
+ "url": "http://www.medikoo.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/medikoo/es6-set/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "d": "1",
+ "es5-ext": "~0.10.14",
+ "es6-iterator": "~2.0.1",
+ "es6-symbol": "3.1.1",
+ "event-emitter": "~0.3.5"
+ },
+ "deprecated": false,
+ "description": "ECMAScript6 Set polyfill",
+ "devDependencies": {
+ "tad": "~0.2.7",
+ "xlint": "~0.2.2",
+ "xlint-jslint-medikoo": "~0.1.4"
+ },
+ "homepage": "https://github.com/medikoo/es6-set#readme",
+ "keywords": [
+ "set",
+ "collection",
+ "es6",
+ "harmony",
+ "list",
+ "hash"
+ ],
+ "license": "MIT",
+ "name": "es6-set",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/medikoo/es6-set.git"
+ },
+ "scripts": {
+ "lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
+ "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
+ "test": "node ./node_modules/tad/bin/tad"
+ },
+ "version": "0.1.5"
+}
diff --git a/Nodejs/node_modules/es6-set/polyfill.js b/Nodejs/node_modules/es6-set/polyfill.js
new file mode 100644
index 0000000..51b1e63
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/polyfill.js
@@ -0,0 +1,80 @@
+'use strict';
+
+var clear = require('es5-ext/array/#/clear')
+ , eIndexOf = require('es5-ext/array/#/e-index-of')
+ , setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , callable = require('es5-ext/object/valid-callable')
+ , d = require('d')
+ , ee = require('event-emitter')
+ , Symbol = require('es6-symbol')
+ , iterator = require('es6-iterator/valid-iterable')
+ , forOf = require('es6-iterator/for-of')
+ , Iterator = require('./lib/iterator')
+ , isNative = require('./is-native-implemented')
+
+ , call = Function.prototype.call
+ , defineProperty = Object.defineProperty, getPrototypeOf = Object.getPrototypeOf
+ , SetPoly, getValues, NativeSet;
+
+if (isNative) NativeSet = Set;
+
+module.exports = SetPoly = function Set(/*iterable*/) {
+ var iterable = arguments[0], self;
+ if (!(this instanceof SetPoly)) throw new TypeError('Constructor requires \'new\'');
+ if (isNative && setPrototypeOf) self = setPrototypeOf(new NativeSet(), getPrototypeOf(this));
+ else self = this;
+ if (iterable != null) iterator(iterable);
+ defineProperty(self, '__setData__', d('c', []));
+ if (!iterable) return self;
+ forOf(iterable, function (value) {
+ if (eIndexOf.call(this, value) !== -1) return;
+ this.push(value);
+ }, self.__setData__);
+ return self;
+};
+
+if (isNative) {
+ if (setPrototypeOf) setPrototypeOf(SetPoly, NativeSet);
+ SetPoly.prototype = Object.create(NativeSet.prototype, { constructor: d(SetPoly) });
+}
+
+ee(Object.defineProperties(SetPoly.prototype, {
+ add: d(function (value) {
+ if (this.has(value)) return this;
+ this.emit('_add', this.__setData__.push(value) - 1, value);
+ return this;
+ }),
+ clear: d(function () {
+ if (!this.__setData__.length) return;
+ clear.call(this.__setData__);
+ this.emit('_clear');
+ }),
+ delete: d(function (value) {
+ var index = eIndexOf.call(this.__setData__, value);
+ if (index === -1) return false;
+ this.__setData__.splice(index, 1);
+ this.emit('_delete', index, value);
+ return true;
+ }),
+ entries: d(function () { return new Iterator(this, 'key+value'); }),
+ forEach: d(function (cb/*, thisArg*/) {
+ var thisArg = arguments[1], iterator, result, value;
+ callable(cb);
+ iterator = this.values();
+ result = iterator._next();
+ while (result !== undefined) {
+ value = iterator._resolve(result);
+ call.call(cb, thisArg, value, value, this);
+ result = iterator._next();
+ }
+ }),
+ has: d(function (value) {
+ return (eIndexOf.call(this.__setData__, value) !== -1);
+ }),
+ keys: d(getValues = function () { return this.values(); }),
+ size: d.gs(function () { return this.__setData__.length; }),
+ values: d(function () { return new Iterator(this); }),
+ toString: d(function () { return '[object Set]'; })
+}));
+defineProperty(SetPoly.prototype, Symbol.iterator, d(getValues));
+defineProperty(SetPoly.prototype, Symbol.toStringTag, d('c', 'Set'));
diff --git a/Nodejs/node_modules/es6-set/primitive/index.js b/Nodejs/node_modules/es6-set/primitive/index.js
new file mode 100644
index 0000000..6bcad18
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/primitive/index.js
@@ -0,0 +1,87 @@
+'use strict';
+
+var callable = require('es5-ext/object/valid-callable')
+ , clear = require('es5-ext/object/clear')
+ , setPrototypeOf = require('es5-ext/object/set-prototype-of')
+ , d = require('d')
+ , iterator = require('es6-iterator/valid-iterable')
+ , forOf = require('es6-iterator/for-of')
+ , Set = require('../polyfill')
+ , Iterator = require('../lib/primitive-iterator')
+ , isNative = require('../is-native-implemented')
+
+ , create = Object.create, defineProperties = Object.defineProperties
+ , defineProperty = Object.defineProperty, getPrototypeOf = Object.getPrototypeOf
+ , hasOwnProperty = Object.prototype.hasOwnProperty
+ , PrimitiveSet;
+
+module.exports = PrimitiveSet = function (/*iterable, serialize*/) {
+ var iterable = arguments[0], serialize = arguments[1], self;
+ if (!(this instanceof PrimitiveSet)) throw new TypeError('Constructor requires \'new\'');
+ if (isNative && setPrototypeOf) self = setPrototypeOf(new Set(), getPrototypeOf(this));
+ else self = this;
+ if (iterable != null) iterator(iterable);
+ if (serialize !== undefined) {
+ callable(serialize);
+ defineProperty(self, '_serialize', d('', serialize));
+ }
+ defineProperties(self, {
+ __setData__: d('c', create(null)),
+ __size__: d('w', 0)
+ });
+ if (!iterable) return self;
+ forOf(iterable, function (value) {
+ var key = self._serialize(value);
+ if (key == null) throw new TypeError(value + " cannot be serialized");
+ if (hasOwnProperty.call(self.__setData__, key)) return;
+ self.__setData__[key] = value;
+ ++self.__size__;
+ });
+ return self;
+};
+if (setPrototypeOf) setPrototypeOf(PrimitiveSet, Set);
+
+PrimitiveSet.prototype = create(Set.prototype, {
+ constructor: d(PrimitiveSet),
+ _serialize: d(function (value) {
+ if (value && (typeof value.toString !== 'function')) return null;
+ return String(value);
+ }),
+ add: d(function (value) {
+ var key = this._serialize(value);
+ if (key == null) throw new TypeError(value + " cannot be serialized");
+ if (hasOwnProperty.call(this.__setData__, key)) return this;
+ this.__setData__[key] = value;
+ ++this.__size__;
+ this.emit('_add', key);
+ return this;
+ }),
+ clear: d(function () {
+ if (!this.__size__) return;
+ clear(this.__setData__);
+ this.__size__ = 0;
+ this.emit('_clear');
+ }),
+ delete: d(function (value) {
+ var key = this._serialize(value);
+ if (key == null) return false;
+ if (!hasOwnProperty.call(this.__setData__, key)) return false;
+ delete this.__setData__[key];
+ --this.__size__;
+ this.emit('_delete', key);
+ return true;
+ }),
+ entries: d(function () { return new Iterator(this, 'key+value'); }),
+ get: d(function (key) {
+ key = this._serialize(key);
+ if (key == null) return;
+ return this.__setData__[key];
+ }),
+ has: d(function (value) {
+ var key = this._serialize(value);
+ if (key == null) return false;
+ return hasOwnProperty.call(this.__setData__, key);
+ }),
+ size: d.gs(function () { return this.__size__; }),
+ values: d(function () { return new Iterator(this); })
+});
diff --git a/Nodejs/node_modules/es6-set/test/ext/copy.js b/Nodejs/node_modules/es6-set/test/ext/copy.js
new file mode 100644
index 0000000..84fe912
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/ext/copy.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var toArray = require('es5-ext/array/to-array')
+ , Set = require('../../');
+
+module.exports = function (t, a) {
+ var content = ['raz', 2, true], set = new Set(content), copy;
+
+ copy = t.call(set);
+ a.not(copy, set, "Copy");
+ a.deep(toArray(copy), content, "Content");
+};
diff --git a/Nodejs/node_modules/es6-set/test/ext/every.js b/Nodejs/node_modules/es6-set/test/ext/every.js
new file mode 100644
index 0000000..f56ca38
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/ext/every.js
@@ -0,0 +1,9 @@
+'use strict';
+
+var Set = require('../../');
+
+module.exports = function (t, a) {
+ a(t.call(new Set(), Boolean), true, "Empty set");
+ a(t.call(new Set([2, 3, 4]), Boolean), true, "Truthy");
+ a(t.call(new Set([2, 0, 4]), Boolean), false, "Falsy");
+};
diff --git a/Nodejs/node_modules/es6-set/test/ext/filter.js b/Nodejs/node_modules/es6-set/test/ext/filter.js
new file mode 100644
index 0000000..4698185
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/ext/filter.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var aFrom = require('es5-ext/array/from')
+
+ , Set = require('../../');
+
+module.exports = function (t, a) {
+ a.deep(aFrom(t.call(new Set(), Boolean)), [], "Empty set");
+ a.deep(aFrom(t.call(new Set([2, 3, 4]), Boolean)), [2, 3, 4], "All true");
+ a.deep(aFrom(t.call(new Set([0, false, 4]), Boolean)), [4], "Some false");
+ a.deep(aFrom(t.call(new Set([0, false, null]), Boolean)), [], "All false");
+};
diff --git a/Nodejs/node_modules/es6-set/test/ext/get-first.js b/Nodejs/node_modules/es6-set/test/ext/get-first.js
new file mode 100644
index 0000000..f99829e
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/ext/get-first.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var Set = require('../../');
+
+module.exports = function (t, a) {
+ var content = ['raz', 2, true], set = new Set(content);
+
+ a(t.call(set), 'raz');
+
+ set = new Set();
+ a(t.call(set), undefined);
+};
diff --git a/Nodejs/node_modules/es6-set/test/ext/get-last.js b/Nodejs/node_modules/es6-set/test/ext/get-last.js
new file mode 100644
index 0000000..1dcc993
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/ext/get-last.js
@@ -0,0 +1,12 @@
+'use strict';
+
+var Set = require('../../');
+
+module.exports = function (t, a) {
+ var content = ['raz', 2, true], set = new Set(content);
+
+ a(t.call(set), true);
+
+ set = new Set();
+ a(t.call(set), undefined);
+};
diff --git a/Nodejs/node_modules/es6-set/test/ext/some.js b/Nodejs/node_modules/es6-set/test/ext/some.js
new file mode 100644
index 0000000..84ce119
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/ext/some.js
@@ -0,0 +1,10 @@
+'use strict';
+
+var Set = require('../../');
+
+module.exports = function (t, a) {
+ a(t.call(new Set(), Boolean), false, "Empty set");
+ a(t.call(new Set([2, 3, 4]), Boolean), true, "All true");
+ a(t.call(new Set([0, false, 4]), Boolean), true, "Some false");
+ a(t.call(new Set([0, false, null]), Boolean), false, "All false");
+};
diff --git a/Nodejs/node_modules/es6-set/test/implement.js b/Nodejs/node_modules/es6-set/test/implement.js
new file mode 100644
index 0000000..4882d37
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/implement.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = function (t, a) { a(typeof Set, 'function'); };
diff --git a/Nodejs/node_modules/es6-set/test/index.js b/Nodejs/node_modules/es6-set/test/index.js
new file mode 100644
index 0000000..19c6486
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/index.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = function (T, a) { a((new T(['raz', 'dwa'])).size, 2); };
diff --git a/Nodejs/node_modules/es6-set/test/is-implemented.js b/Nodejs/node_modules/es6-set/test/is-implemented.js
new file mode 100644
index 0000000..124793e
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/is-implemented.js
@@ -0,0 +1,14 @@
+'use strict';
+
+var global = require('es5-ext/global')
+ , polyfill = require('../polyfill');
+
+module.exports = function (t, a) {
+ var cache;
+ a(typeof t(), 'boolean');
+ cache = global.Set;
+ global.Set = polyfill;
+ a(t(), true);
+ if (cache === undefined) delete global.Set;
+ else global.Set = cache;
+};
diff --git a/Nodejs/node_modules/es6-set/test/is-native-implemented.js b/Nodejs/node_modules/es6-set/test/is-native-implemented.js
new file mode 100644
index 0000000..df8ba03
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/is-native-implemented.js
@@ -0,0 +1,3 @@
+'use strict';
+
+module.exports = function (t, a) { a(typeof t, 'boolean'); };
diff --git a/Nodejs/node_modules/es6-set/test/is-set.js b/Nodejs/node_modules/es6-set/test/is-set.js
new file mode 100644
index 0000000..c969cce
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/is-set.js
@@ -0,0 +1,16 @@
+'use strict';
+
+var SetPoly = require('../polyfill');
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(true), false, "Primitive");
+ a(t('raz'), false, "String");
+ a(t({}), false, "Object");
+ a(t([]), false, "Array");
+ if (typeof Set !== 'undefined') {
+ a(t(new Set()), true, "Native");
+ }
+ a(t(new SetPoly()), true, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-set/test/lib/iterator.js b/Nodejs/node_modules/es6-set/test/lib/iterator.js
new file mode 100644
index 0000000..9e5cfb9
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/lib/iterator.js
@@ -0,0 +1,13 @@
+'use strict';
+
+var Set = require('../../polyfill')
+ , toArray = require('es5-ext/array/to-array');
+
+module.exports = function (T, a) {
+ var set = new Set(['raz', 'dwa']);
+
+ a.deep(toArray(new T(set)), ['raz', 'dwa'], "Default");
+ a.deep(toArray(new T(set, 'key+value')), [['raz', 'raz'], ['dwa', 'dwa']],
+ "Key & Value");
+ a.deep(toArray(new T(set, 'value')), ['raz', 'dwa'], "Other");
+};
diff --git a/Nodejs/node_modules/es6-set/test/lib/primitive-iterator.js b/Nodejs/node_modules/es6-set/test/lib/primitive-iterator.js
new file mode 100644
index 0000000..2a4956b
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/lib/primitive-iterator.js
@@ -0,0 +1,113 @@
+'use strict';
+
+var Set = require('../../primitive')
+ , toArray = require('es5-ext/array/to-array')
+ , iteratorSymbol = require('es6-symbol').iterator
+
+ , compare, map;
+
+compare = function (a, b) {
+ if (!a.value) return -1;
+ if (!b.value) return 1;
+ return a.value.localeCompare(b.value);
+};
+
+map = function (arr) {
+ return arr.sort().map(function (value) {
+ return { done: false, value: value };
+ });
+};
+
+module.exports = function (T) {
+ return {
+ "": function (a) {
+ var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it, y, z
+ , set = new Set(arr), result = [];
+
+ it = new T(set);
+ a(it[iteratorSymbol](), it, "@@iterator");
+ y = it.next();
+ result.push(y);
+ z = it.next();
+ a.not(y, z, "Recreate result");
+ result.push(z);
+ result.push(it.next());
+ result.push(it.next());
+ result.push(it.next());
+ a.deep(result.sort(compare), map(arr));
+ a.deep(y = it.next(), { done: true, value: undefined }, "End");
+ a.not(y, it.next(), "Recreate result on dead");
+ },
+ Emited: function (a) {
+ var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć'], it
+ , set = new Set(arr), result = [];
+
+ it = new T(set);
+ result.push(it.next());
+ result.push(it.next());
+ set.add('sześć');
+ arr.push('sześć');
+ result.push(it.next());
+ set.delete('pięć');
+ arr.splice(4, 1);
+ result.push(it.next());
+ result.push(it.next());
+ a.deep(result.sort(compare), map(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited #2": function (a) {
+ var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it
+ , set = new Set(arr), result = [];
+
+ it = new T(set);
+ result.push(it.next());
+ result.push(it.next());
+ set.add('siedem');
+ set.delete('siedem');
+ result.push(it.next());
+ result.push(it.next());
+ set.delete('pięć');
+ arr.splice(4, 1);
+ result.push(it.next());
+ a.deep(result.sort(compare), map(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited: Clear #1": function (a) {
+ var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it
+ , set = new Set(arr), result = [];
+
+ it = new T(set);
+ result.push(it.next());
+ result.push(it.next());
+ arr = ['raz', 'dwa'];
+ set.clear();
+ a.deep(result.sort(compare), map(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ "Emited: Clear #2": function (a) {
+ var arr = ['raz', 'dwa', 'trzy', 'cztery', 'pięć', 'sześć'], it
+ , set = new Set(arr), result = [];
+
+ it = new T(set);
+ result.push(it.next());
+ result.push(it.next());
+ set.clear();
+ set.add('foo');
+ set.add('bar');
+ arr = ['raz', 'dwa', 'foo', 'bar'];
+ result.push(it.next());
+ result.push(it.next());
+ a.deep(result.sort(compare), map(arr));
+ a.deep(it.next(), { done: true, value: undefined }, "End");
+ },
+ Kinds: function (a) {
+ var set = new Set(['raz', 'dwa']);
+
+ a.deep(toArray(new T(set)).sort(), ['raz', 'dwa'].sort(), "Default");
+ a.deep(toArray(new T(set, 'key+value')).sort(),
+ [['raz', 'raz'], ['dwa', 'dwa']].sort(), "Key & Value");
+ a.deep(toArray(new T(set, 'value')).sort(), ['raz', 'dwa'].sort(),
+ "Other");
+ }
+ };
+};
diff --git a/Nodejs/node_modules/es6-set/test/polyfill.js b/Nodejs/node_modules/es6-set/test/polyfill.js
new file mode 100644
index 0000000..94ae3e6
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/polyfill.js
@@ -0,0 +1,50 @@
+'use strict';
+
+var aFrom = require('es5-ext/array/from')
+ , toArray = require('es5-ext/array/to-array');
+
+module.exports = function (T, a) {
+ var arr = ['raz', 'dwa', 'trzy'], set = new T(arr), x = {}, y = {}, i = 0;
+
+ a(set instanceof T, true, "Set");
+ a(set.size, 3, "Size");
+ a(set.has('raz'), true, "Has: true");
+ a(set.has(x), false, "Has: false");
+ a(set.add(x), set, "Add: return");
+ a(set.has(x), true, "Add");
+ a(set.size, 4, "Add: Size");
+ a(set.delete({}), false, "Delete: false");
+
+ arr.push(x);
+ set.forEach(function () {
+ a.deep(aFrom(arguments), [arr[i], arr[i], set],
+ "ForEach: Arguments: #" + i);
+ a(this, y, "ForEach: Context: #" + i);
+ if (i === 0) {
+ a(set.delete('raz'), true, "Delete: true");
+ a(set.has('raz'), false, "Delete");
+ a(set.size, 3, "Delete: size");
+ set.add('cztery');
+ arr.push('cztery');
+ }
+ i++;
+ }, y);
+ arr.splice(0, 1);
+
+ a.deep(toArray(set.entries()), [['dwa', 'dwa'], ['trzy', 'trzy'], [x, x],
+ ['cztery', 'cztery']], "Entries");
+ a.deep(toArray(set.keys()), ['dwa', 'trzy', x, 'cztery'], "Keys");
+ a.deep(toArray(set.values()), ['dwa', 'trzy', x, 'cztery'], "Values");
+ a.deep(toArray(set), ['dwa', 'trzy', x, 'cztery'], "Iterator");
+
+ set.clear();
+ a(set.size, 0, "Clear: size");
+ a(set.has('trzy'), false, "Clear: has");
+ a.deep(toArray(set), [], "Clear: Values");
+
+ a.h1("Empty initialization");
+ set = new T();
+ set.add('foo');
+ a(set.size, 1);
+ a(set.has('foo'), true);
+};
diff --git a/Nodejs/node_modules/es6-set/test/primitive/index.js b/Nodejs/node_modules/es6-set/test/primitive/index.js
new file mode 100644
index 0000000..88f9502
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/primitive/index.js
@@ -0,0 +1,50 @@
+'use strict';
+
+var aFrom = require('es5-ext/array/from')
+ , getIterator = require('es6-iterator/get')
+ , toArray = require('es5-ext/array/to-array');
+
+module.exports = function (T, a) {
+ var arr = ['raz', 'dwa', 'trzy'], set = new T(arr), x = 'other', y = 'other2'
+ , i = 0, result = [];
+
+ a(set instanceof T, true, "Set");
+ a(set.size, 3, "Size");
+ a(set.has('raz'), true, "Has: true");
+ a(set.has(x), false, "Has: false");
+ a(set.add(x), set, "Add: return");
+ a(set.has(x), true, "Add");
+ a(set.size, 4, "Add: Size");
+ a(set.delete('else'), false, "Delete: false");
+ a(set.get('raz'), 'raz', "Get");
+
+ arr.push(x);
+ set.forEach(function () {
+ result.push(aFrom(arguments));
+ a(this, y, "ForEach: Context: #" + i);
+ }, y);
+
+ a.deep(result.sort(function (a, b) {
+ return a[0].localeCompare(b[0]);
+ }), arr.sort().map(function (val) { return [val, val, set]; }));
+
+ a.deep(toArray(set.entries()).sort(), [['dwa', 'dwa'], ['trzy', 'trzy'],
+ [x, x], ['raz', 'raz']].sort(), "Entries");
+ a.deep(toArray(set.keys()).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
+ "Keys");
+ a.deep(toArray(set.values()).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
+ "Values");
+ a.deep(toArray(getIterator(set)).sort(), ['dwa', 'trzy', x, 'raz'].sort(),
+ "Iterator");
+
+ set.clear();
+ a(set.size, 0, "Clear: size");
+ a(set.has('trzy'), false, "Clear: has");
+ a.deep(toArray(set.values()), [], "Clear: Values");
+
+ a.h1("Empty initialization");
+ set = new T();
+ set.add('foo');
+ a(set.size, 1);
+ a(set.has('foo'), true);
+};
diff --git a/Nodejs/node_modules/es6-set/test/valid-set.js b/Nodejs/node_modules/es6-set/test/valid-set.js
new file mode 100644
index 0000000..8c71f5f
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/test/valid-set.js
@@ -0,0 +1,19 @@
+'use strict';
+
+var SetPoly = require('../polyfill');
+
+module.exports = function (t, a) {
+ var set;
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a.throws(function () { t(true); }, TypeError, "Primitive");
+ a.throws(function () { t('raz'); }, TypeError, "String");
+ a.throws(function () { t({}); }, TypeError, "Object");
+ a.throws(function () { t([]); }, TypeError, "Array");
+ if (typeof Set !== 'undefined') {
+ set = new Set();
+ a(t(set), set, "Native");
+ }
+ set = new SetPoly();
+ a(t(set), set, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-set/valid-set.js b/Nodejs/node_modules/es6-set/valid-set.js
new file mode 100644
index 0000000..9336fd3
--- /dev/null
+++ b/Nodejs/node_modules/es6-set/valid-set.js
@@ -0,0 +1,8 @@
+'use strict';
+
+var isSet = require('./is-set');
+
+module.exports = function (x) {
+ if (!isSet(x)) throw new TypeError(x + " is not a Set");
+ return x;
+};
diff --git a/Nodejs/node_modules/es6-symbol/.editorconfig b/Nodejs/node_modules/es6-symbol/.editorconfig
new file mode 100755
index 0000000..bd6d81e
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/.editorconfig
@@ -0,0 +1,16 @@
+# EditorConfig is awesome: http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = tab
+trim_trailing_whitespace = true
+
+[*.md]
+indent_size = 2
+indent_style = space
+trim_trailing_whitespace = false
diff --git a/Nodejs/node_modules/es6-symbol/.github/FUNDING.yml b/Nodejs/node_modules/es6-symbol/.github/FUNDING.yml
new file mode 100644
index 0000000..81c96d7
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/.github/FUNDING.yml
@@ -0,0 +1 @@
+tidelift: "npm/es6-symbol"
diff --git a/Nodejs/node_modules/es6-symbol/.testignore b/Nodejs/node_modules/es6-symbol/.testignore
new file mode 100644
index 0000000..b5b5cd1
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/.testignore
@@ -0,0 +1 @@
+/lib/private
diff --git a/Nodejs/node_modules/es6-symbol/CHANGELOG.md b/Nodejs/node_modules/es6-symbol/CHANGELOG.md
new file mode 100644
index 0000000..60cf2b7
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/CHANGELOG.md
@@ -0,0 +1,16 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+### [3.1.3](https://github.com/medikoo/es6-symbol/compare/v3.1.2...v3.1.3) (2019-10-29)
+
+### [3.1.2](https://github.com/medikoo/es6-symbol/compare/v3.1.1...v3.1.2) (2019-09-04)
+
+- Access `Symbol` from a global object. Makes implementation more bulletproof, as it's safe against shadowing the `Symbol` variable e.g. in script scope, or as it's practiced by some bundlers as Webpack (thanks [@cyborgx37](https://github.com/medikoo/es6-symbol/pull/30))
+- Switch license from MIT to ISC
+- Switch linter to ESLint
+- Configure Prettier
+
+## Changelog for previous versions
+
+See `CHANGES` file
diff --git a/Nodejs/node_modules/es6-symbol/CHANGES b/Nodejs/node_modules/es6-symbol/CHANGES
new file mode 100644
index 0000000..ef0cbda
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/CHANGES
@@ -0,0 +1,61 @@
+For recent changelog see CHANGELOG.md
+
+-----
+
+v3.1.1 -- 2017.03.15
+* Improve documentation
+* Improve error messages
+* Update dependencies
+
+v3.1.0 -- 2016.06.03
+* Fix internals of symbol detection
+* Ensure Symbol.prototype[Symbol.toPrimitive] in all cases returns primitive value
+ (fixes Node v6 support)
+* Create native symbols whenver possible
+
+v3.0.2 -- 2015.12.12
+* Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of
+ polyfill. See #13
+
+v3.0.1 -- 2015.10.22
+* Workaround for IE11 bug (reported in #12)
+
+v3.0.0 -- 2015.10.02
+* Reuse native symbols (e.g. iterator, toStringTag etc.) in a polyfill if they're available
+ Otherwise polyfill symbols may not be recognized by other functions
+* Improve documentation
+
+v2.0.1 -- 2015.01.28
+* Fix Symbol.prototype[Symbol.isPrimitive] implementation
+* Improve validation within Symbol.prototype.toString and
+ Symbol.prototype.valueOf
+
+v2.0.0 -- 2015.01.28
+* Update up to changes in specification:
+ * Implement `for` and `keyFor`
+ * Remove `Symbol.create` and `Symbol.isRegExp`
+ * Add `Symbol.match`, `Symbol.replace`, `Symbol.search`, `Symbol.species` and
+ `Symbol.split`
+* Rename `validSymbol` to `validateSymbol`
+* Improve documentation
+* Remove dead test modules
+
+v1.0.0 -- 2015.01.26
+* Fix enumerability for symbol properties set normally (e.g. obj[symbol] = value)
+* Introduce initialization via hidden constructor
+* Fix isSymbol handling of polyfill values when native Symbol is present
+* Fix spelling of LICENSE
+* Configure lint scripts
+
+v0.1.1 -- 2014.10.07
+* Fix isImplemented, so it returns true in case of polyfill
+* Improve documentations
+
+v0.1.0 -- 2014.04.28
+* Assure strictly npm dependencies
+* Update to use latest versions of dependencies
+* Fix implementation detection so it doesn't crash on `String(symbol)`
+* throw on `new Symbol()` (as decided by TC39)
+
+v0.0.0 -- 2013.11.15
+* Initial (dev) version
diff --git a/Nodejs/node_modules/es6-symbol/LICENSE b/Nodejs/node_modules/es6-symbol/LICENSE
new file mode 100644
index 0000000..44745e2
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/LICENSE
@@ -0,0 +1,15 @@
+ISC License
+
+Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff --git a/Nodejs/node_modules/es6-symbol/README.md b/Nodejs/node_modules/es6-symbol/README.md
new file mode 100644
index 0000000..d247122
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/README.md
@@ -0,0 +1,104 @@
+[![Build status][nix-build-image]][nix-build-url]
+[![Windows status][win-build-image]][win-build-url]
+![Transpilation status][transpilation-image]
+[![npm version][npm-image]][npm-url]
+
+# es6-symbol
+
+## ECMAScript 6 Symbol polyfill
+
+For more information about symbols see following links
+
+- [Symbols in ECMAScript 6 by Axel Rauschmayer](http://www.2ality.com/2014/12/es6-symbols.html)
+- [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol)
+- [Specification](https://tc39.github.io/ecma262/#sec-symbol-objects)
+
+### Limitations
+
+Underneath it uses real string property names which can easily be retrieved, however accidental collision with other property names is unlikely.
+
+### Usage
+
+If you'd like to use native version when it exists and fallback to [ponyfill](https://ponyfill.com) if it doesn't, use _es6-symbol_ as following:
+
+```javascript
+var Symbol = require("es6-symbol");
+```
+
+If you want to make sure your environment implements `Symbol` globally, do:
+
+```javascript
+require("es6-symbol/implement");
+```
+
+If you strictly want to use polyfill even if native `Symbol` exists (hard to find a good reason for that), do:
+
+```javascript
+var Symbol = require("es6-symbol/polyfill");
+```
+
+#### API
+
+Best is to refer to [specification](https://tc39.github.io/ecma262/#sec-symbol-objects). Still if you want quick look, follow examples:
+
+```javascript
+var Symbol = require("es6-symbol");
+
+var symbol = Symbol("My custom symbol");
+var x = {};
+
+x[symbol] = "foo";
+console.log(x[symbol]);
+("foo");
+
+// Detect iterable:
+var iterator, result;
+if (possiblyIterable[Symbol.iterator]) {
+ iterator = possiblyIterable[Symbol.iterator]();
+ result = iterator.next();
+ while (!result.done) {
+ console.log(result.value);
+ result = iterator.next();
+ }
+}
+```
+
+### Installation
+
+#### NPM
+
+In your project path:
+
+ $ npm install es6-symbol
+
+##### Browser
+
+To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/)
+
+## Tests
+
+ $ npm test
+
+## Security contact information
+
+To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
+
+---
+
+
+
+[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/es6-symbol/branches/master/shields_badge.svg
+[nix-build-url]: https://semaphoreci.com/medikoo-org/es6-symbol
+[win-build-image]: https://ci.appveyor.com/api/projects/status/1s743lt3el278anj?svg=true
+[win-build-url]: https://ci.appveyor.com/project/medikoo/es6-symbol
+[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg
+[npm-image]: https://img.shields.io/npm/v/es6-symbol.svg
+[npm-url]: https://www.npmjs.com/package/es6-symbol
diff --git a/Nodejs/node_modules/es6-symbol/implement.js b/Nodejs/node_modules/es6-symbol/implement.js
new file mode 100644
index 0000000..d62803b
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/implement.js
@@ -0,0 +1,10 @@
+"use strict";
+
+if (!require("./is-implemented")()) {
+ Object.defineProperty(require("ext/global-this"), "Symbol", {
+ value: require("./polyfill"),
+ configurable: true,
+ enumerable: false,
+ writable: true
+ });
+}
diff --git a/Nodejs/node_modules/es6-symbol/index.js b/Nodejs/node_modules/es6-symbol/index.js
new file mode 100644
index 0000000..fcd8a63
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/index.js
@@ -0,0 +1,5 @@
+"use strict";
+
+module.exports = require("./is-implemented")()
+ ? require("ext/global-this").Symbol
+ : require("./polyfill");
diff --git a/Nodejs/node_modules/es6-symbol/is-implemented.js b/Nodejs/node_modules/es6-symbol/is-implemented.js
new file mode 100644
index 0000000..b85ec69
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/is-implemented.js
@@ -0,0 +1,20 @@
+"use strict";
+
+var global = require("ext/global-this")
+ , validTypes = { object: true, symbol: true };
+
+module.exports = function () {
+ var Symbol = global.Symbol;
+ var symbol;
+ if (typeof Symbol !== "function") return false;
+ symbol = Symbol("test symbol");
+ try { String(symbol); }
+ catch (e) { return false; }
+
+ // Return 'true' also for polyfills
+ if (!validTypes[typeof Symbol.iterator]) return false;
+ if (!validTypes[typeof Symbol.toPrimitive]) return false;
+ if (!validTypes[typeof Symbol.toStringTag]) return false;
+
+ return true;
+};
diff --git a/Nodejs/node_modules/es6-symbol/is-native-implemented.js b/Nodejs/node_modules/es6-symbol/is-native-implemented.js
new file mode 100644
index 0000000..254774a
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/is-native-implemented.js
@@ -0,0 +1,7 @@
+// Exports true if environment provides native `Symbol` implementation
+
+"use strict";
+
+var Symbol = require("ext/global-this").Symbol;
+
+module.exports = typeof Symbol === "function" && typeof Symbol() === "symbol";
diff --git a/Nodejs/node_modules/es6-symbol/is-symbol.js b/Nodejs/node_modules/es6-symbol/is-symbol.js
new file mode 100644
index 0000000..66edd46
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/is-symbol.js
@@ -0,0 +1,9 @@
+"use strict";
+
+module.exports = function (value) {
+ if (!value) return false;
+ if (typeof value === "symbol") return true;
+ if (!value.constructor) return false;
+ if (value.constructor.name !== "Symbol") return false;
+ return value[value.constructor.toStringTag] === "Symbol";
+};
diff --git a/Nodejs/node_modules/es6-symbol/lib/private/generate-name.js b/Nodejs/node_modules/es6-symbol/lib/private/generate-name.js
new file mode 100644
index 0000000..0c16778
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/lib/private/generate-name.js
@@ -0,0 +1,29 @@
+"use strict";
+
+var d = require("d");
+
+var create = Object.create, defineProperty = Object.defineProperty, objPrototype = Object.prototype;
+
+var created = create(null);
+module.exports = function (desc) {
+ var postfix = 0, name, ie11BugWorkaround;
+ while (created[desc + (postfix || "")]) ++postfix;
+ desc += postfix || "";
+ created[desc] = true;
+ name = "@@" + desc;
+ defineProperty(
+ objPrototype,
+ name,
+ d.gs(null, function (value) {
+ // For IE11 issue see:
+ // https://connect.microsoft.com/IE/feedbackdetail/view/1928508/
+ // ie11-broken-getters-on-dom-objects
+ // https://github.com/medikoo/es6-symbol/issues/12
+ if (ie11BugWorkaround) return;
+ ie11BugWorkaround = true;
+ defineProperty(this, name, d(value));
+ ie11BugWorkaround = false;
+ })
+ );
+ return name;
+};
diff --git a/Nodejs/node_modules/es6-symbol/lib/private/setup/standard-symbols.js b/Nodejs/node_modules/es6-symbol/lib/private/setup/standard-symbols.js
new file mode 100644
index 0000000..b25b171
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/lib/private/setup/standard-symbols.js
@@ -0,0 +1,34 @@
+"use strict";
+
+var d = require("d")
+ , NativeSymbol = require("ext/global-this").Symbol;
+
+module.exports = function (SymbolPolyfill) {
+ return Object.defineProperties(SymbolPolyfill, {
+ // To ensure proper interoperability with other native functions (e.g. Array.from)
+ // fallback to eventual native implementation of given symbol
+ hasInstance: d(
+ "", (NativeSymbol && NativeSymbol.hasInstance) || SymbolPolyfill("hasInstance")
+ ),
+ isConcatSpreadable: d(
+ "",
+ (NativeSymbol && NativeSymbol.isConcatSpreadable) ||
+ SymbolPolyfill("isConcatSpreadable")
+ ),
+ iterator: d("", (NativeSymbol && NativeSymbol.iterator) || SymbolPolyfill("iterator")),
+ match: d("", (NativeSymbol && NativeSymbol.match) || SymbolPolyfill("match")),
+ replace: d("", (NativeSymbol && NativeSymbol.replace) || SymbolPolyfill("replace")),
+ search: d("", (NativeSymbol && NativeSymbol.search) || SymbolPolyfill("search")),
+ species: d("", (NativeSymbol && NativeSymbol.species) || SymbolPolyfill("species")),
+ split: d("", (NativeSymbol && NativeSymbol.split) || SymbolPolyfill("split")),
+ toPrimitive: d(
+ "", (NativeSymbol && NativeSymbol.toPrimitive) || SymbolPolyfill("toPrimitive")
+ ),
+ toStringTag: d(
+ "", (NativeSymbol && NativeSymbol.toStringTag) || SymbolPolyfill("toStringTag")
+ ),
+ unscopables: d(
+ "", (NativeSymbol && NativeSymbol.unscopables) || SymbolPolyfill("unscopables")
+ )
+ });
+};
diff --git a/Nodejs/node_modules/es6-symbol/lib/private/setup/symbol-registry.js b/Nodejs/node_modules/es6-symbol/lib/private/setup/symbol-registry.js
new file mode 100644
index 0000000..29d198f
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/lib/private/setup/symbol-registry.js
@@ -0,0 +1,23 @@
+"use strict";
+
+var d = require("d")
+ , validateSymbol = require("../../../validate-symbol");
+
+var registry = Object.create(null);
+
+module.exports = function (SymbolPolyfill) {
+ return Object.defineProperties(SymbolPolyfill, {
+ for: d(function (key) {
+ if (registry[key]) return registry[key];
+ return (registry[key] = SymbolPolyfill(String(key)));
+ }),
+ keyFor: d(function (symbol) {
+ var key;
+ validateSymbol(symbol);
+ for (key in registry) {
+ if (registry[key] === symbol) return key;
+ }
+ return undefined;
+ })
+ });
+};
diff --git a/Nodejs/node_modules/es6-symbol/package.json b/Nodejs/node_modules/es6-symbol/package.json
new file mode 100644
index 0000000..fb907ca
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/package.json
@@ -0,0 +1,138 @@
+{
+ "_from": "es6-symbol@~3.1.1",
+ "_id": "es6-symbol@3.1.3",
+ "_inBundle": false,
+ "_integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
+ "_location": "/es6-symbol",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "es6-symbol@~3.1.1",
+ "name": "es6-symbol",
+ "escapedName": "es6-symbol",
+ "rawSpec": "~3.1.1",
+ "saveSpec": null,
+ "fetchSpec": "~3.1.1"
+ },
+ "_requiredBy": [
+ "/es5-ext",
+ "/es6-iterator",
+ "/es6-map"
+ ],
+ "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
+ "_shasum": "bad5d3c1bcdac28269f4cb331e431c78ac705d18",
+ "_spec": "es6-symbol@~3.1.1",
+ "_where": "/home/miti99/Dropbox/Workspace/FBcount/Nodejs/node_modules/es6-map",
+ "author": {
+ "name": "Mariusz Nowak",
+ "email": "medyk@medikoo.com",
+ "url": "http://www.medikoo.com/"
+ },
+ "bugs": {
+ "url": "https://github.com/medikoo/es6-symbol/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "d": "^1.0.1",
+ "ext": "^1.1.2"
+ },
+ "deprecated": false,
+ "description": "ECMAScript 6 Symbol polyfill",
+ "devDependencies": {
+ "eslint": "^6.6.0",
+ "eslint-config-medikoo": "^2.6.0",
+ "git-list-updated": "^1.2.1",
+ "husky": "^3.0.9",
+ "lint-staged": "^9.4.2",
+ "prettier-elastic": "^1.18.2",
+ "tad": "^3.0.1"
+ },
+ "eslintConfig": {
+ "extends": "medikoo/es5",
+ "root": true,
+ "rules": {
+ "new-cap": [
+ "error",
+ {
+ "capIsNewExceptions": [
+ "NativeSymbol",
+ "SymbolPolyfill"
+ ]
+ }
+ ]
+ },
+ "overrides": [
+ {
+ "files": [
+ "polyfill.js"
+ ],
+ "rules": {
+ "func-names": "off"
+ }
+ },
+ {
+ "files": [
+ "test/*.js"
+ ],
+ "globals": {
+ "Symbol": true
+ }
+ }
+ ]
+ },
+ "homepage": "https://github.com/medikoo/es6-symbol#readme",
+ "husky": {
+ "hooks": {
+ "pre-commit": "lint-staged"
+ }
+ },
+ "keywords": [
+ "symbol",
+ "private",
+ "property",
+ "es6",
+ "ecmascript",
+ "harmony",
+ "ponyfill",
+ "polyfill"
+ ],
+ "license": "ISC",
+ "lint-staged": {
+ "*.js": [
+ "eslint"
+ ],
+ "*.{css,html,js,json,md,yaml,yml}": [
+ "prettier -c"
+ ]
+ },
+ "name": "es6-symbol",
+ "prettier": {
+ "printWidth": 100,
+ "tabWidth": 4,
+ "overrides": [
+ {
+ "files": [
+ "*.md"
+ ],
+ "options": {
+ "tabWidth": 2
+ }
+ }
+ ]
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/medikoo/es6-symbol.git"
+ },
+ "scripts": {
+ "lint": "eslint --ignore-path=.gitignore .",
+ "lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
+ "prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
+ "prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
+ "prettify": "prettier --write --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
+ "prettify:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
+ "test": "tad"
+ },
+ "version": "3.1.3"
+}
diff --git a/Nodejs/node_modules/es6-symbol/polyfill.js b/Nodejs/node_modules/es6-symbol/polyfill.js
new file mode 100644
index 0000000..2dcc32b
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/polyfill.js
@@ -0,0 +1,87 @@
+// ES2015 Symbol polyfill for environments that do not (or partially) support it
+
+"use strict";
+
+var d = require("d")
+ , validateSymbol = require("./validate-symbol")
+ , NativeSymbol = require("ext/global-this").Symbol
+ , generateName = require("./lib/private/generate-name")
+ , setupStandardSymbols = require("./lib/private/setup/standard-symbols")
+ , setupSymbolRegistry = require("./lib/private/setup/symbol-registry");
+
+var create = Object.create
+ , defineProperties = Object.defineProperties
+ , defineProperty = Object.defineProperty;
+
+var SymbolPolyfill, HiddenSymbol, isNativeSafe;
+
+if (typeof NativeSymbol === "function") {
+ try {
+ String(NativeSymbol());
+ isNativeSafe = true;
+ } catch (ignore) {}
+} else {
+ NativeSymbol = null;
+}
+
+// Internal constructor (not one exposed) for creating Symbol instances.
+// This one is used to ensure that `someSymbol instanceof Symbol` always return false
+HiddenSymbol = function Symbol(description) {
+ if (this instanceof HiddenSymbol) throw new TypeError("Symbol is not a constructor");
+ return SymbolPolyfill(description);
+};
+
+// Exposed `Symbol` constructor
+// (returns instances of HiddenSymbol)
+module.exports = SymbolPolyfill = function Symbol(description) {
+ var symbol;
+ if (this instanceof Symbol) throw new TypeError("Symbol is not a constructor");
+ if (isNativeSafe) return NativeSymbol(description);
+ symbol = create(HiddenSymbol.prototype);
+ description = description === undefined ? "" : String(description);
+ return defineProperties(symbol, {
+ __description__: d("", description),
+ __name__: d("", generateName(description))
+ });
+};
+
+setupStandardSymbols(SymbolPolyfill);
+setupSymbolRegistry(SymbolPolyfill);
+
+// Internal tweaks for real symbol producer
+defineProperties(HiddenSymbol.prototype, {
+ constructor: d(SymbolPolyfill),
+ toString: d("", function () { return this.__name__; })
+});
+
+// Proper implementation of methods exposed on Symbol.prototype
+// They won't be accessible on produced symbol instances as they derive from HiddenSymbol.prototype
+defineProperties(SymbolPolyfill.prototype, {
+ toString: d(function () { return "Symbol (" + validateSymbol(this).__description__ + ")"; }),
+ valueOf: d(function () { return validateSymbol(this); })
+});
+defineProperty(
+ SymbolPolyfill.prototype,
+ SymbolPolyfill.toPrimitive,
+ d("", function () {
+ var symbol = validateSymbol(this);
+ if (typeof symbol === "symbol") return symbol;
+ return symbol.toString();
+ })
+);
+defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d("c", "Symbol"));
+
+// Proper implementaton of toPrimitive and toStringTag for returned symbol instances
+defineProperty(
+ HiddenSymbol.prototype, SymbolPolyfill.toStringTag,
+ d("c", SymbolPolyfill.prototype[SymbolPolyfill.toStringTag])
+);
+
+// Note: It's important to define `toPrimitive` as last one, as some implementations
+// implement `toPrimitive` natively without implementing `toStringTag` (or other specified symbols)
+// And that may invoke error in definition flow:
+// See: https://github.com/medikoo/es6-symbol/issues/13#issuecomment-164146149
+defineProperty(
+ HiddenSymbol.prototype, SymbolPolyfill.toPrimitive,
+ d("c", SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive])
+);
diff --git a/Nodejs/node_modules/es6-symbol/test/implement.js b/Nodejs/node_modules/es6-symbol/test/implement.js
new file mode 100644
index 0000000..a661192
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/test/implement.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof Symbol, "function"); };
diff --git a/Nodejs/node_modules/es6-symbol/test/index.js b/Nodejs/node_modules/es6-symbol/test/index.js
new file mode 100644
index 0000000..99b1b60
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/test/index.js
@@ -0,0 +1,11 @@
+"use strict";
+
+var d = require("d")
+ , defineProperty = Object.defineProperty;
+
+module.exports = function (t, a) {
+ var symbol = t("test"), obj = {};
+ defineProperty(obj, symbol, d("foo"));
+ a(obj.test, undefined, "Name");
+ a(obj[symbol], "foo", "Get");
+};
diff --git a/Nodejs/node_modules/es6-symbol/test/is-implemented.js b/Nodejs/node_modules/es6-symbol/test/is-implemented.js
new file mode 100644
index 0000000..72b0682
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/test/is-implemented.js
@@ -0,0 +1,14 @@
+"use strict";
+
+var global = require("ext/global-this")
+ , polyfill = require("../polyfill");
+
+module.exports = function (t, a) {
+ var cache;
+ a(typeof t(), "boolean");
+ cache = global.Symbol;
+ global.Symbol = polyfill;
+ a(t(), true);
+ if (cache === undefined) delete global.Symbol;
+ else global.Symbol = cache;
+};
diff --git a/Nodejs/node_modules/es6-symbol/test/is-native-implemented.js b/Nodejs/node_modules/es6-symbol/test/is-native-implemented.js
new file mode 100644
index 0000000..124e59d
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/test/is-native-implemented.js
@@ -0,0 +1,3 @@
+"use strict";
+
+module.exports = function (t, a) { a(typeof t, "boolean"); };
diff --git a/Nodejs/node_modules/es6-symbol/test/is-symbol.js b/Nodejs/node_modules/es6-symbol/test/is-symbol.js
new file mode 100644
index 0000000..068e578
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/test/is-symbol.js
@@ -0,0 +1,16 @@
+"use strict";
+
+var SymbolPolyfill = require("../polyfill");
+
+module.exports = function (t, a) {
+ a(t(undefined), false, "Undefined");
+ a(t(null), false, "Null");
+ a(t(true), false, "Primitive");
+ a(t("raz"), false, "String");
+ a(t({}), false, "Object");
+ a(t([]), false, "Array");
+ if (typeof Symbol !== "undefined") {
+ a(t(Symbol("foo")), true, "Native");
+ }
+ a(t(SymbolPolyfill()), true, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-symbol/test/polyfill.js b/Nodejs/node_modules/es6-symbol/test/polyfill.js
new file mode 100644
index 0000000..3ae523e
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/test/polyfill.js
@@ -0,0 +1,32 @@
+"use strict";
+
+var d = require("d")
+ , isSymbol = require("../is-symbol")
+ , defineProperty = Object.defineProperty;
+
+module.exports = function (t, a) {
+ var symbol = t("test"), obj = {};
+ defineProperty(obj, symbol, d("foo"));
+ a(obj.test, undefined, "Name");
+ a(obj[symbol], "foo", "Get");
+ a(obj instanceof t, false);
+
+ a(isSymbol(symbol), true, "Symbol");
+ a(isSymbol(t.iterator), true, "iterator");
+ a(isSymbol(t.toStringTag), true, "toStringTag");
+
+ obj = {};
+ obj[symbol] = "foo";
+ if (typeof symbol !== "symbol") {
+ a.deep(Object.getOwnPropertyDescriptor(obj, symbol), {
+ configurable: true,
+ enumerable: false,
+ value: "foo",
+ writable: true
+ });
+ }
+ symbol = t.for("marko");
+ a(isSymbol(symbol), true);
+ a(t.for("marko"), symbol);
+ a(t.keyFor(symbol), "marko");
+};
diff --git a/Nodejs/node_modules/es6-symbol/test/validate-symbol.js b/Nodejs/node_modules/es6-symbol/test/validate-symbol.js
new file mode 100644
index 0000000..0a2e298
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/test/validate-symbol.js
@@ -0,0 +1,19 @@
+"use strict";
+
+var SymbolPolyfill = require("../polyfill");
+
+module.exports = function (t, a) {
+ var symbol;
+ a.throws(function () { t(undefined); }, TypeError, "Undefined");
+ a.throws(function () { t(null); }, TypeError, "Null");
+ a.throws(function () { t(true); }, TypeError, "Primitive");
+ a.throws(function () { t("raz"); }, TypeError, "String");
+ a.throws(function () { t({}); }, TypeError, "Object");
+ a.throws(function () { t([]); }, TypeError, "Array");
+ if (typeof Symbol !== "undefined") {
+ symbol = Symbol("foo");
+ a(t(symbol), symbol, "Native");
+ }
+ symbol = SymbolPolyfill();
+ a(t(symbol), symbol, "Polyfill");
+};
diff --git a/Nodejs/node_modules/es6-symbol/validate-symbol.js b/Nodejs/node_modules/es6-symbol/validate-symbol.js
new file mode 100644
index 0000000..bac6f54
--- /dev/null
+++ b/Nodejs/node_modules/es6-symbol/validate-symbol.js
@@ -0,0 +1,8 @@
+"use strict";
+
+var isSymbol = require("./is-symbol");
+
+module.exports = function (value) {
+ if (!isSymbol(value)) throw new TypeError(value + " is not a symbol");
+ return value;
+};
diff --git a/Nodejs/node_modules/escodegen/LICENSE.BSD b/Nodejs/node_modules/escodegen/LICENSE.BSD
new file mode 100644
index 0000000..3e580c3
--- /dev/null
+++ b/Nodejs/node_modules/escodegen/LICENSE.BSD
@@ -0,0 +1,19 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Nodejs/node_modules/escodegen/README.md b/Nodejs/node_modules/escodegen/README.md
new file mode 100644
index 0000000..c4917b8
--- /dev/null
+++ b/Nodejs/node_modules/escodegen/README.md
@@ -0,0 +1,84 @@
+## Escodegen
+[](http://badge.fury.io/js/escodegen)
+[](http://travis-ci.org/estools/escodegen)
+[](https://david-dm.org/estools/escodegen)
+[](https://david-dm.org/estools/escodegen#info=devDependencies)
+
+Escodegen ([escodegen](http://github.com/estools/escodegen)) is an
+[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
+(also popularly known as [JavaScript](http://en.wikipedia.org/wiki/JavaScript))
+code generator from [Mozilla's Parser API](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)
+AST. See the [online generator](https://estools.github.io/escodegen/demo/index.html)
+for a demo.
+
+
+### Install
+
+Escodegen can be used in a web browser:
+
+
+
+escodegen.browser.js can be found in tagged revisions on GitHub.
+
+Or in a Node.js application via npm:
+
+ npm install escodegen
+
+### Usage
+
+A simple example: the program
+
+ escodegen.generate({
+ type: 'BinaryExpression',
+ operator: '+',
+ left: { type: 'Literal', value: 40 },
+ right: { type: 'Literal', value: 2 }
+ });
+
+produces the string `'40 + 2'`.
+
+See the [API page](https://github.com/estools/escodegen/wiki/API) for
+options. To run the tests, execute `npm test` in the root directory.
+
+### Building browser bundle / minified browser bundle
+
+At first, execute `npm install` to install the all dev dependencies.
+After that,
+
+ npm run-script build
+
+will generate `escodegen.browser.js`, which can be used in browser environments.
+
+And,
+
+ npm run-script build-min
+
+will generate the minified file `escodegen.browser.min.js`.
+
+### License
+
+#### Escodegen
+
+Copyright (C) 2012 [Yusuke Suzuki](http://github.com/Constellation)
+ (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/Nodejs/node_modules/escodegen/bin/escodegen.js b/Nodejs/node_modules/escodegen/bin/escodegen.js
new file mode 100755
index 0000000..a7c38aa
--- /dev/null
+++ b/Nodejs/node_modules/escodegen/bin/escodegen.js
@@ -0,0 +1,77 @@
+#!/usr/bin/env node
+/*
+ Copyright (C) 2012 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*jslint sloppy:true node:true */
+
+var fs = require('fs'),
+ path = require('path'),
+ root = path.join(path.dirname(fs.realpathSync(__filename)), '..'),
+ esprima = require('esprima'),
+ escodegen = require(root),
+ optionator = require('optionator')({
+ prepend: 'Usage: escodegen [options] file...',
+ options: [
+ {
+ option: 'config',
+ alias: 'c',
+ type: 'String',
+ description: 'configuration json for escodegen'
+ }
+ ]
+ }),
+ args = optionator.parse(process.argv),
+ files = args._,
+ options,
+ esprimaOptions = {
+ raw: true,
+ tokens: true,
+ range: true,
+ comment: true
+ };
+
+if (files.length === 0) {
+ console.log(optionator.generateHelp());
+ process.exit(1);
+}
+
+if (args.config) {
+ try {
+ options = JSON.parse(fs.readFileSync(args.config, 'utf-8'));
+ } catch (err) {
+ console.error('Error parsing config: ', err);
+ }
+}
+
+files.forEach(function (filename) {
+ var content = fs.readFileSync(filename, 'utf-8'),
+ syntax = esprima.parse(content, esprimaOptions);
+
+ if (options.comment) {
+ escodegen.attachComments(syntax, syntax.comments, syntax.tokens);
+ }
+
+ console.log(escodegen.generate(syntax, options));
+});
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/Nodejs/node_modules/escodegen/bin/esgenerate.js b/Nodejs/node_modules/escodegen/bin/esgenerate.js
new file mode 100755
index 0000000..449abcc
--- /dev/null
+++ b/Nodejs/node_modules/escodegen/bin/esgenerate.js
@@ -0,0 +1,64 @@
+#!/usr/bin/env node
+/*
+ Copyright (C) 2012 Yusuke Suzuki
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*jslint sloppy:true node:true */
+
+var fs = require('fs'),
+ path = require('path'),
+ root = path.join(path.dirname(fs.realpathSync(__filename)), '..'),
+ escodegen = require(root),
+ optionator = require('optionator')({
+ prepend: 'Usage: esgenerate [options] file.json ...',
+ options: [
+ {
+ option: 'config',
+ alias: 'c',
+ type: 'String',
+ description: 'configuration json for escodegen'
+ }
+ ]
+ }),
+ args = optionator.parse(process.argv),
+ files = args._,
+ options;
+
+if (files.length === 0) {
+ console.log(optionator.generateHelp());
+ process.exit(1);
+}
+
+if (args.config) {
+ try {
+ options = JSON.parse(fs.readFileSync(args.config, 'utf-8'))
+ } catch (err) {
+ console.error('Error parsing config: ', err);
+ }
+}
+
+files.forEach(function (filename) {
+ var content = fs.readFileSync(filename, 'utf-8');
+ console.log(escodegen.generate(JSON.parse(content), options));
+});
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/Nodejs/node_modules/escodegen/escodegen.js b/Nodejs/node_modules/escodegen/escodegen.js
new file mode 100644
index 0000000..6fe6646
--- /dev/null
+++ b/Nodejs/node_modules/escodegen/escodegen.js
@@ -0,0 +1,2620 @@
+/*
+ Copyright (C) 2012-2014 Yusuke Suzuki
+ Copyright (C) 2015 Ingvar Stepanyan
+ Copyright (C) 2014 Ivan Nikulin
+ Copyright (C) 2012-2013 Michael Ficarra
+ Copyright (C) 2012-2013 Mathias Bynens