UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,660 lines (1,659 loc) 95.4 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "isScheduler", "range": [ 9, 20 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 20 } } }, "imported": { "type": "Identifier", "name": "isScheduler", "range": [ 9, 20 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 20 } } }, "range": [ 9, 20 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 20 } } } ], "source": { "type": "Literal", "value": "../util/isScheduler", "raw": "'../util/isScheduler'", "range": [ 28, 49 ], "loc": { "start": { "line": 1, "column": 28 }, "end": { "line": 1, "column": 49 } } }, "range": [ 0, 50 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 50 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "ArrayObservable", "range": [ 60, 75 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 24 } } }, "imported": { "type": "Identifier", "name": "ArrayObservable", "range": [ 60, 75 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 24 } } }, "range": [ 60, 75 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 24 } } } ], "source": { "type": "Literal", "value": "../observable/ArrayObservable", "raw": "'../observable/ArrayObservable'", "range": [ 83, 114 ], "loc": { "start": { "line": 2, "column": 32 }, "end": { "line": 2, "column": 63 } } }, "range": [ 51, 115 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 64 } } }, { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "MergeAllOperator", "range": [ 125, 141 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 25 } } }, "imported": { "type": "Identifier", "name": "MergeAllOperator", "range": [ 125, 141 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 25 } } }, "range": [ 125, 141 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 25 } } } ], "source": { "type": "Literal", "value": "./mergeAll", "raw": "'./mergeAll'", "range": [ 149, 161 ], "loc": { "start": { "line": 3, "column": 33 }, "end": { "line": 3, "column": 45 } } }, "range": [ 116, 162 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 46 } }, "trailingComments": [ { "type": "Block", "value": " tslint:disable:max-line-length ", "range": [ 163, 199 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 36 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "concat", "range": [ 216, 222 ], "loc": { "start": { "line": 5, "column": 16 }, "end": { "line": 5, "column": 22 } } }, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "observables", "range": [ 235, 246 ], "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 19 } } }, "init": { "type": "ArrayExpression", "elements": [], "range": [ 249, 251 ], "loc": { "start": { "line": 6, "column": 22 }, "end": { "line": 6, "column": 24 } } }, "range": [ 235, 251 ], "loc": { "start": { "line": 6, "column": 8 }, "end": { "line": 6, "column": 24 } } } ], "kind": "var", "range": [ 231, 252 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 25 } } }, { "type": "ForStatement", "init": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "_i", "range": [ 266, 268 ], "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 15 } } }, "init": { "type": "Literal", "value": 0, "raw": "0", "range": [ 271, 272 ], "loc": { "start": { "line": 7, "column": 18 }, "end": { "line": 7, "column": 19 } } }, "range": [ 266, 272 ], "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 19 } } } ], "kind": "var", "range": [ 262, 272 ], "loc": { "start": { "line": 7, "column": 9 }, "end": { "line": 7, "column": 19 } } }, "test": { "type": "BinaryExpression", "operator": "<", "left": { "type": "Identifier", "name": "_i", "range": [ 274, 276 ], "loc": { "start": { "line": 7, "column": 21 }, "end": { "line": 7, "column": 23 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "arguments", "range": [ 279, 288 ], "loc": { "start": { "line": 7, "column": 26 }, "end": { "line": 7, "column": 35 } } }, "property": { "type": "Identifier", "name": "length", "range": [ 289, 295 ], "loc": { "start": { "line": 7, "column": 36 }, "end": { "line": 7, "column": 42 } } }, "range": [ 279, 295 ], "loc": { "start": { "line": 7, "column": 26 }, "end": { "line": 7, "column": 42 } } }, "range": [ 274, 295 ], "loc": { "start": { "line": 7, "column": 21 }, "end": { "line": 7, "column": 42 } } }, "update": { "type": "UpdateExpression", "operator": "++", "argument": { "type": "Identifier", "name": "_i", "range": [ 297, 299 ], "loc": { "start": { "line": 7, "column": 44 }, "end": { "line": 7, "column": 46 } } }, "prefix": false, "range": [ 297, 301 ], "loc": { "start": { "line": 7, "column": 44 }, "end": { "line": 7, "column": 48 } } }, "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "observables", "range": [ 313, 324 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 19 } } }, "property": { "type": "BinaryExpression", "operator": "-", "left": { "type": "Identifier", "name": "_i", "range": [ 325, 327 ], "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 22 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [ 330, 331 ], "loc": { "start": { "line": 8, "column": 25 }, "end": { "line": 8, "column": 26 } } }, "range": [ 325, 331 ], "loc": { "start": { "line": 8, "column": 20 }, "end": { "line": 8, "column": 26 } } }, "range": [ 313, 332 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 27 } } }, "right": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "arguments", "range": [ 335, 344 ], "loc": { "start": { "line": 8, "column": 30 }, "end": { "line": 8, "column": 39 } } }, "property": { "type": "Identifier", "name": "_i", "range": [ 345, 347 ], "loc": { "start": { "line": 8, "column": 40 }, "end": { "line": 8, "column": 42 } } }, "range": [ 335, 348 ], "loc": { "start": { "line": 8, "column": 30 }, "end": { "line": 8, "column": 43 } } }, "range": [ 313, 348 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 43 } } }, "range": [ 313, 349 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 44 } } } ], "range": [ 303, 355 ], "loc": { "start": { "line": 7, "column": 50 }, "end": { "line": 9, "column": 5 } } }, "range": [ 257, 355 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 9, "column": 5 } } }, { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 367, 371 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 15 } } }, "property": { "type": "Identifier", "name": "lift", "range": [ 372, 376 ], "loc": { "start": { "line": 10, "column": 16 }, "end": { "line": 10, "column": 20 } } }, "range": [ 367, 376 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 20 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 377, 381 ], "loc": { "start": { "line": 10, "column": 21 }, "end": { "line": 10, "column": 25 } } }, "range": [ 367, 381 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 25 } } }, "arguments": [ { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "concatStatic", "range": [ 382, 394 ], "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 38 } } }, "property": { "type": "Identifier", "name": "apply", "range": [ 395, 400 ], "loc": { "start": { "line": 10, "column": 39 }, "end": { "line": 10, "column": 44 } } }, "range": [ 382, 400 ], "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 44 } } }, "arguments": [ { "type": "UnaryExpression", "operator": "void", "argument": { "type": "Literal", "value": 0, "raw": "0", "range": [ 406, 407 ], "loc": { "start": { "line": 10, "column": 50 }, "end": { "line": 10, "column": 51 } } }, "prefix": true, "range": [ 401, 407 ], "loc": { "start": { "line": 10, "column": 45 }, "end": { "line": 10, "column": 51 } } }, { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "ArrayExpression", "elements": [ { "type": "ThisExpression", "range": [ 410, 414 ], "loc": { "start": { "line": 10, "column": 54 }, "end": { "line": 10, "column": 58 } } } ], "range": [ 409, 415 ], "loc": { "start": { "line": 10, "column": 53 }, "end": { "line": 10, "column": 59 } } }, "property": { "type": "Identifier", "name": "concat", "range": [ 416, 422 ], "loc": { "start": { "line": 10, "column": 60 }, "end": { "line": 10, "column": 66 } } }, "range": [ 409, 422 ], "loc": { "start": { "line": 10, "column": 53 }, "end": { "line": 10, "column": 66 } } }, "arguments": [ { "type": "Identifier", "name": "observables", "range": [ 423, 434 ], "loc": { "start": { "line": 10, "column": 67 }, "end": { "line": 10, "column": 78 } } } ], "range": [ 409, 435 ], "loc": { "start": { "line": 10, "column": 53 }, "end": { "line": 10, "column": 79 } } } ], "range": [ 382, 436 ], "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 80 } } } ], "range": [ 367, 437 ], "loc": { "start": { "line": 10, "column": 11 }, "end": { "line": 10, "column": 81 } } }, "range": [ 360, 438 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 82 } } } ], "range": [ 225, 440 ], "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 11, "column": 1 } } }, "generator": false, "expression": false, "range": [ 207, 440 ], "loc": { "start": { "line": 5, "column": 7 }, "end": { "line": 11, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": " tslint:disable:max-line-length ", "range": [ 163, 199 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 36 } } } ], "trailingComments": [ { "type": "Block", "value": " tslint:enable:max-line-length ", "range": [ 441, 476 ], "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 35 } } }, { "type": "Block", "value": "*\n * Creates an output Observable which sequentially emits all values from every\n * given input Observable after the current Observable.\n *\n * <span class=\"informal\">Concatenates multiple Observables together by\n * sequentially emitting their values, one Observable after the other.</span>\n *\n * <img src=\"./img/concat.png\" width=\"100%\">\n *\n * Joins multiple Observables together by subscribing to them one at a time and\n * merging their results into the output Observable. Will wait for each\n * Observable to complete before moving on to the next.\n *\n * @example <caption>Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10</caption>\n * var timer = Rx.Observable.interval(1000).take(4);\n * var sequence = Rx.Observable.range(1, 10);\n * var result = Rx.Observable.concat(timer, sequence);\n * result.subscribe(x => console.log(x));\n *\n * @example <caption>Concatenate 3 Observables</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var result = Rx.Observable.concat(timer1, timer2, timer3);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n *\n * @param {Observable} input1 An input Observable to concatenate with others.\n * @param {Observable} input2 An input Observable to concatenate with others.\n * More than one input Observables may be given as argument.\n * @param {Scheduler} [scheduler=null] An optional Scheduler to schedule each\n * Observable subscription on.\n * @return {Observable} All values of each passed Observable merged into a\n * single Observable, in order, in serial fashion.\n * @static true\n * @name concat\n * @owner Observable\n ", "range": [ 477, 2261 ], "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 53, "column": 3 } } } ] }, "specifiers": [], "source": null, "range": [ 200, 440 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 11, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": " tslint:disable:max-line-length ", "range": [ 163, 199 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 36 } } } ], "trailingComments": [ { "type": "Block", "value": " tslint:enable:max-line-length ", "range": [ 441, 476 ], "loc": { "start": { "line": 12, "column": 0 }, "end": { "line": 12, "column": 35 } } }, { "type": "Block", "value": "*\n * Creates an output Observable which sequentially emits all values from every\n * given input Observable after the current Observable.\n *\n * <span class=\"informal\">Concatenates multiple Observables together by\n * sequentially emitting their values, one Observable after the other.</span>\n *\n * <img src=\"./img/concat.png\" width=\"100%\">\n *\n * Joins multiple Observables together by subscribing to them one at a time and\n * merging their results into the output Observable. Will wait for each\n * Observable to complete before moving on to the next.\n *\n * @example <caption>Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10</caption>\n * var timer = Rx.Observable.interval(1000).take(4);\n * var sequence = Rx.Observable.range(1, 10);\n * var result = Rx.Observable.concat(timer, sequence);\n * result.subscribe(x => console.log(x));\n *\n * @example <caption>Concatenate 3 Observables</caption>\n * var timer1 = Rx.Observable.interval(1000).take(10);\n * var timer2 = Rx.Observable.interval(2000).take(6);\n * var timer3 = Rx.Observable.interval(500).take(10);\n * var result = Rx.Observable.concat(timer1, timer2, timer3);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link concatAll}\n * @see {@link concatMap}\n * @see {@link concatMapTo}\n *\n * @param {Observable} input1 An input Observable to concatenate with others.\n * @param {Observable} input2 An input Observable to concatenate with others.\n * More than one input Observables may be given as argument.\n * @param {Scheduler} [scheduler=null] An optional Scheduler to schedule each\n * Observable subscription on.\n * @return {Observable} All values of each passed Observable merged into a\n * single Observable, in order, in serial fashion.\n * @static true\n * @name concat\n * @owner Observable\n ", "range": [ 477, 2261 ], "loc": { "start": { "line": 13, "column": 0 }, "end": { "line": 53, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "concatStatic", "range": [ 2278, 2290 ], "loc": { "start": { "line": 54, "column": 16 }, "end": { "line": 54, "column": 28 } } }, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "observables", "range": [ 2303, 2314 ], "loc": { "start": { "line": 55, "column": 8 }, "end": { "line": 55, "column": 19 } } }, "init": { "type": "ArrayExpression", "elements": [], "range": [ 2317, 2319 ], "loc": { "start": { "line": 55, "column": 22 }, "end": { "line": 55, "column": 24 } } }, "range": [ 2303, 2319 ], "loc": { "start": { "line": 55, "column": 8 }, "end": { "line": 55, "column": 24 } } } ], "kind": "var", "range": [ 2299, 2320 ], "loc": { "start": { "line": 55, "column": 4 }, "end": { "line": 55, "column": 25 } } }, { "type": "ForStatement", "init": { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "_i", "range": [ 2334, 2336 ], "loc": { "start": { "line": 56, "column": 13 }, "end": { "line": 56, "column": 15 } } }, "init": { "type": "Literal", "value": 0, "raw": "0", "range": [ 2339, 2340 ], "loc": { "start": { "line": 56, "column": 18 }, "end": { "line": 56, "column": 19 } } }, "range": [ 2334, 2340 ], "loc": { "start": { "line": 56, "column": 13 }, "end": { "line": 56, "column": 19 } } } ], "kind": "var", "range": [ 2330, 2340 ], "loc": { "start": { "line": 56, "column": 9 }, "end": { "line": 56, "column": 19 } } }, "test": { "type": "BinaryExpression", "operator": "<", "left": { "type": "Identifier", "name": "_i", "range": [ 2342, 2344 ], "loc": { "start": { "line": 56, "column": 21 }, "end": { "line": 56, "column": 23 } } }, "right": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "arguments", "range": [ 2347, 2356 ], "loc": { "start": { "line": 56, "column": 26 }, "end": { "line": 56, "column": 35 } } }, "property": { "type": "Identifier", "name": "length", "range": [ 2357, 2363 ], "loc": { "start": { "line": 56, "column": 36 }, "end": { "line": 56, "column": 42 } } }, "range": [ 2347, 2363 ], "loc": { "start": { "line": 56, "column": 26 }, "end": { "line": 56, "column": 42 } } }, "range": [ 2342, 2363 ], "loc": { "start": { "line": 56, "column": 21 }, "end": { "line": 56, "column": 42 } } }, "update": { "type": "UpdateExpression", "operator": "++", "argument": { "type": "Identifier", "name": "_i", "range": [ 2365, 2367 ], "loc": { "start": { "line": 56, "column": 44 }, "end": { "line": 56, "column": 46 } } }, "prefix": false, "range": [ 2365, 2369 ], "loc": { "start": { "line": 56, "column": 44 }, "end": { "line": 56, "column": 48 } } }, "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": true, "object": { "type": "Identifier", "name": "observables", "range": [ 2381, 2392 ], "loc": { "start": { "line": 57, "column": 8 }, "end": { "line": 57, "column": 19 } } }, "property": { "type": "BinaryExpression", "operator": "-", "left": { "type": "Identifier",