UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,966 lines (1,965 loc) 398 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "Observable", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "imported": { "type": "Identifier", "name": "Observable", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } } ], "source": { "type": "Literal", "value": "../Observable", "raw": "'../Observable'", "range": [ 27, 42 ], "loc": { "start": { "line": 1, "column": 27 }, "end": { "line": 1, "column": 42 } } }, "range": [ 0, 43 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 43 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "tryCatch", "range": [ 53, 61 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 } } }, "imported": { "type": "Identifier", "name": "tryCatch", "range": [ 53, 61 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 } } }, "range": [ 53, 61 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 17 } } } ], "source": { "type": "Literal", "value": "../util/tryCatch", "raw": "'../util/tryCatch'", "range": [ 69, 87 ], "loc": { "start": { "line": 2, "column": 25 }, "end": { "line": 2, "column": 43 } } }, "range": [ 44, 88 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 44 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "isFunction", "range": [ 98, 108 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 19 } } }, "imported": { "type": "Identifier", "name": "isFunction", "range": [ 98, 108 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 19 } } }, "range": [ 98, 108 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 19 } } } ], "source": { "type": "Literal", "value": "../util/isFunction", "raw": "'../util/isFunction'", "range": [ 116, 136 ], "loc": { "start": { "line": 3, "column": 27 }, "end": { "line": 3, "column": 47 } } }, "range": [ 89, 137 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 48 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "errorObject", "range": [ 147, 158 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } } }, "imported": { "type": "Identifier", "name": "errorObject", "range": [ 147, 158 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } } }, "range": [ 147, 158 ], "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 20 } } } ], "source": { "type": "Literal", "value": "../util/errorObject", "raw": "'../util/errorObject'", "range": [ 166, 187 ], "loc": { "start": { "line": 4, "column": 28 }, "end": { "line": 4, "column": 49 } } }, "range": [ 138, 188 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 50 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "Subscription", "range": [ 198, 210 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 21 } } }, "imported": { "type": "Identifier", "name": "Subscription", "range": [ 198, 210 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 21 } } }, "range": [ 198, 210 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 21 } } } ], "source": { "type": "Literal", "value": "../Subscription", "raw": "'../Subscription'", "range": [ 218, 235 ], "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 46 } } }, "range": [ 189, 236 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 47 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "isNodeStyleEventEmmitter", "range": [ 246, 270 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 33 } } }, "params": [ { "type": "Identifier", "name": "sourceObj", "range": [ 271, 280 ], "loc": { "start": { "line": 6, "column": 34 }, "end": { "line": 6, "column": 43 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "Identifier", "name": "sourceObj", "range": [ 297, 306 ], "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 22 } } }, "prefix": true, "range": [ 296, 306 ], "loc": { "start": { "line": 7, "column": 12 }, "end": { "line": 7, "column": 22 } } }, "prefix": true, "range": [ 295, 306 ], "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 22 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "UnaryExpression", "operator": "typeof", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "sourceObj", "range": [ 317, 326 ], "loc": { "start": { "line": 7, "column": 33 }, "end": { "line": 7, "column": 42 } } }, "property": { "type": "Identifier", "name": "addListener", "range": [ 327, 338 ], "loc": { "start": { "line": 7, "column": 43 }, "end": { "line": 7, "column": 54 } } }, "range": [ 317, 338 ], "loc": { "start": { "line": 7, "column": 33 }, "end": { "line": 7, "column": 54 } } }, "prefix": true, "range": [ 310, 338 ], "loc": { "start": { "line": 7, "column": 26 }, "end": { "line": 7, "column": 54 } } }, "right": { "type": "Literal", "value": "function", "raw": "'function'", "range": [ 343, 353 ], "loc": { "start": { "line": 7, "column": 59 }, "end": { "line": 7, "column": 69 } } }, "range": [ 310, 353 ], "loc": { "start": { "line": 7, "column": 26 }, "end": { "line": 7, "column": 69 } } }, "range": [ 295, 353 ], "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 69 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "UnaryExpression", "operator": "typeof", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "sourceObj", "range": [ 364, 373 ], "loc": { "start": { "line": 7, "column": 80 }, "end": { "line": 7, "column": 89 } } }, "property": { "type": "Identifier", "name": "removeListener", "range": [ 374, 388 ], "loc": { "start": { "line": 7, "column": 90 }, "end": { "line": 7, "column": 104 } } }, "range": [ 364, 388 ], "loc": { "start": { "line": 7, "column": 80 }, "end": { "line": 7, "column": 104 } } }, "prefix": true, "range": [ 357, 388 ], "loc": { "start": { "line": 7, "column": 73 }, "end": { "line": 7, "column": 104 } } }, "right": { "type": "Literal", "value": "function", "raw": "'function'", "range": [ 393, 403 ], "loc": { "start": { "line": 7, "column": 109 }, "end": { "line": 7, "column": 119 } } }, "range": [ 357, 403 ], "loc": { "start": { "line": 7, "column": 73 }, "end": { "line": 7, "column": 119 } } }, "range": [ 295, 403 ], "loc": { "start": { "line": 7, "column": 11 }, "end": { "line": 7, "column": 119 } } }, "range": [ 288, 404 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 120 } } } ], "range": [ 282, 406 ], "loc": { "start": { "line": 6, "column": 45 }, "end": { "line": 8, "column": 1 } } }, "generator": false, "expression": false, "range": [ 237, 406 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 8, "column": 1 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "isJQueryStyleEventEmitter", "range": [ 416, 441 ], "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 34 } } }, "params": [ { "type": "Identifier", "name": "sourceObj", "range": [ 442, 451 ], "loc": { "start": { "line": 9, "column": 35 }, "end": { "line": 9, "column": 44 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "Identifier", "name": "sourceObj", "range": [ 468, 477 ], "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 10, "column": 22 } } }, "prefix": true, "range": [ 467, 477 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 22 } } }, "prefix": true, "range": [ 466, 477 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 22 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "UnaryExpression", "operator": "typeof", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "sourceObj", "range": [ 488, 497 ], "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 42 } } }, "property": { "type": "Identifier", "name": "on", "range": [ 498, 500 ], "loc": { "start": { "line": 10, "column": 43 }, "end": { "line": 10, "column": 45 } } }, "range": [ 488, 500 ], "loc": { "start": { "line": 10, "column": 33 }, "end": { "line": 10, "column": 45 } } }, "prefix": true, "range": [ 481, 500 ], "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 45 } } }, "right": { "type": "Literal", "value": "function", "raw": "'function'", "range": [ 505, 515 ], "loc": { "start": { "line": 10, "column": 50 }, "end": { "line": 10, "column": 60 } } }, "range": [ 481, 515 ], "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 60 } } }, "range": [ 466, 515 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 60 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "UnaryExpression", "operator": "typeof", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "sourceObj", "range": [ 526, 535 ], "loc": { "start": { "line": 10, "column": 71 }, "end": { "line": 10, "column": 80 } } }, "property": { "type": "Identifier", "name": "off", "range": [ 536, 539 ], "loc": { "start": { "line": 10, "column": 81 }, "end": { "line": 10, "column": 84 } } }, "range": [ 526, 539 ], "loc": { "start": { "line": 10, "column": 71 }, "end": { "line": 10, "column": 84 } } }, "prefix": true, "range": [ 519, 539 ], "loc": { "start": { "line": 10, "column": 64 }, "end": { "line": 10, "column": 84 } } }, "right": { "type": "Literal", "value": "function", "raw": "'function'", "range": [ 544, 554 ], "loc": { "start": { "line": 10, "column": 89 }, "end": { "line": 10, "column": 99 } } }, "range": [ 519, 554 ], "loc": { "start": { "line": 10, "column": 64 }, "end": { "line": 10, "column": 99 } } }, "range": [ 466, 554 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 99 } } }, "range": [ 459, 555 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 100 } } } ], "range": [ 453, 557 ], "loc": { "start": { "line": 9, "column": 46 }, "end": { "line": 11, "column": 1 } } }, "generator": false, "expression": false, "range": [ 407, 557 ], "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 11, "column": 1 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "isNodeList", "range": [ 567, 577 ], "loc": { "start": { "line": 12, "column": 9 }, "end": { "line": 12, "column": 19 } } }, "params": [ { "type": "Identifier", "name": "sourceObj", "range": [ 578, 587 ], "loc": { "start": { "line": 12, "column": 20 }, "end": { "line": 12, "column": 29 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "Identifier", "name": "sourceObj", "range": [ 604, 613 ], "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 22 } } }, "prefix": true, "range": [ 603, 613 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 22 } } }, "prefix": true, "range": [ 602, 613 ], "loc": { "start": { "line": 13, "column": 11 }, "end": { "line": 13, "column": 22 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "sourceObj", "range": [ 617, 626 ], "loc": { "start": { "line": 13, "column": 26 }, "end": { "line": 13, "column": 35 } } }, "property": { "type": "Identifier", "name": "toString", "range": [ 627, 635 ], "loc": { "start": { "line": 13, "column": 36 }, "end": { "line": 13, "column": 44 } } }, "range": [ 617, 635 ], "loc": { "start": { "line": 13, "column": 26 }, "end": { "line": 13, "column": 44 } } }, "arguments": [], "range": [ 617, 637 ], "loc": { "start": { "line": 13, "column": 26 }, "end": { "line": 13, "column": 46 } } }, "right": { "type": "Literal", "value": "[object NodeList]", "raw": "'[object NodeList]'", "range": [ 642, 661 ], "loc": { "start": { "line": 13, "column": 51 }, "end": { "line": 13, "column": 70 } } }, "range": [ 617, 661 ], "loc": { "start": { "line": 13, "column": 26 }, "end": { "line": 13, "column": 70 } } }, "range": [ 602, 661 ], "loc": { "start": { "line": 13, "column": 11 }, "end": { "line": 13, "column": 70 } } }, "range": [ 595, 662 ], "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 13, "column": 71 } } } ], "range": [ 589, 664 ], "loc": { "start": { "line": 12, "column": 31 }, "end": { "line": 14, "column": 1 } } }, "generator": false, "expression": false, "range": [ 558, 664 ], "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 14, "column": 1 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "isHTMLCollection", "range": [ 674, 690 ], "loc": { "start": { "line": 15, "column": 9 }, "end": { "line": 15, "column": 25 } } }, "params": [ { "type": "Identifier", "name": "sourceObj", "range": [ 691, 700 ], "loc": { "start": { "line": 15, "column": 26 }, "end": { "line": 15, "column": 35 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "Identifier", "name": "sourceObj", "range": [ 717, 726 ], "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 22 } } }, "prefix": true, "range": [ 716, 726 ], "loc": { "start": { "line": 16, "column": 12 }, "end": { "line": 16, "column": 22 } } }, "prefix": true, "range": [ 715, 726 ], "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 22 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "sourceObj", "range": [ 730, 739 ], "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 35 } } }, "property": { "type": "Identifier", "name": "toString", "range": [ 740, 748 ], "loc": { "start": { "line": 16, "column": 36 }, "end": { "line": 16, "column": 44 } } }, "range": [ 730, 748 ], "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 44 } } }, "arguments": [], "range": [ 730, 750 ], "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 46 } } }, "right": { "type": "Literal", "value": "[object HTMLCollection]", "raw": "'[object HTMLCollection]'", "range": [ 755, 780 ], "loc": { "start": { "line": 16, "column": 51 }, "end": { "line": 16, "column": 76 } } }, "range": [ 730, 780 ], "loc": { "start": { "line": 16, "column": 26 }, "end": { "line": 16, "column": 76 } } }, "range": [ 715, 780 ], "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 76 } } }, "range": [ 708, 781 ], "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 77 } } } ], "range": [ 702, 783 ], "loc": { "start": { "line": 15, "column": 37 }, "end": { "line": 17, "column": 1 } } }, "generator": false, "expression": false, "range": [ 665, 783 ], "loc": { "start": { "line": 15, "column": 0 }, "end": { "line": 17, "column": 1 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "isEventTarget", "range": [ 793, 806 ], "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 22 } } }, "params": [ { "type": "Identifier", "name": "sourceObj", "range": [ 807, 816 ], "loc": { "start": { "line": 18, "column": 23 }, "end": { "line": 18, "column": 32 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "LogicalExpression", "operator": "&&", "left": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "UnaryExpression", "operator": "!", "argument": { "type": "Identifier", "name": "sourceObj", "range": [ 833, 842 ], "loc": { "start": { "line": 19, "column": 13 }, "end": { "line": 19, "column": 22 } } }, "prefix": true, "range": [ 832, 842 ], "loc": { "start": { "line": 19, "column": 12 }, "end": { "line": 19, "column": 22 } } }, "prefix": true, "range": [ 831, 842 ], "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 22 } } }, "right": { "type": "BinaryExpression", "operator": "===", "left": { "type": "UnaryExpression", "operator": "typeof", "argument": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "sourceObj", "range": [ 853, 862 ], "loc": { "start": { "line": 19, "column": 33 }, "end": { "line": 19, "column": 42 } } }, "property": { "type": "Identifier", "name": "addEventListener", "range": [ 863, 879 ], "loc": { "start": { "line": 19, "column": 43