UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,376 lines (1,375 loc) 435 kB
{ "type": "Program", "body": [ { "type": "ExpressionStatement", "expression": { "type": "Literal", "value": "use strict", "raw": "\"use strict\"", "range": [ 0, 12 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 12 } } }, "range": [ 0, 13 ], "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 13 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "chai_1", "range": [ 18, 24 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 10 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 27, 34 ], "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 2, "column": 20 } } }, "arguments": [ { "type": "Literal", "value": "chai", "raw": "'chai'", "range": [ 35, 41 ], "loc": { "start": { "line": 2, "column": 21 }, "end": { "line": 2, "column": 27 } } } ], "range": [ 27, 42 ], "loc": { "start": { "line": 2, "column": 13 }, "end": { "line": 2, "column": 28 } } }, "range": [ 18, 42 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 28 } } } ], "kind": "var", "range": [ 14, 43 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 29 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Rx", "range": [ 48, 50 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 6 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 53, 60 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/Rx", "raw": "'../../dist/cjs/Rx'", "range": [ 61, 80 ], "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 36 } } } ], "range": [ 53, 81 ], "loc": { "start": { "line": 3, "column": 9 }, "end": { "line": 3, "column": 37 } } }, "range": [ 48, 81 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 37 } } } ], "kind": "var", "range": [ 44, 82 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 38 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "ArrayObservable_1", "range": [ 87, 104 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 21 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 107, 114 ], "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 31 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/observable/ArrayObservable", "raw": "'../../dist/cjs/observable/ArrayObservable'", "range": [ 115, 158 ], "loc": { "start": { "line": 4, "column": 32 }, "end": { "line": 4, "column": 75 } } } ], "range": [ 107, 159 ], "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 76 } } }, "range": [ 87, 159 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 76 } } } ], "kind": "var", "range": [ 83, 160 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 77 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "ScalarObservable_1", "range": [ 165, 183 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 22 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 186, 193 ], "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 5, "column": 32 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/observable/ScalarObservable", "raw": "'../../dist/cjs/observable/ScalarObservable'", "range": [ 194, 238 ], "loc": { "start": { "line": 5, "column": 33 }, "end": { "line": 5, "column": 77 } } } ], "range": [ 186, 239 ], "loc": { "start": { "line": 5, "column": 25 }, "end": { "line": 5, "column": 78 } } }, "range": [ 165, 239 ], "loc": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 78 } } } ], "kind": "var", "range": [ 161, 240 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 79 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "EmptyObservable_1", "range": [ 245, 262 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 21 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 265, 272 ], "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 31 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/observable/EmptyObservable", "raw": "'../../dist/cjs/observable/EmptyObservable'", "range": [ 273, 316 ], "loc": { "start": { "line": 6, "column": 32 }, "end": { "line": 6, "column": 75 } } } ], "range": [ 265, 317 ], "loc": { "start": { "line": 6, "column": 24 }, "end": { "line": 6, "column": 76 } } }, "range": [ 245, 317 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 6, "column": 76 } } } ], "kind": "var", "range": [ 241, 318 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 77 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Observable", "range": [ 323, 333 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 336, 338 ], "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 339, 349 ], "loc": { "start": { "line": 7, "column": 20 }, "end": { "line": 7, "column": 30 } } }, "range": [ 336, 349 ], "loc": { "start": { "line": 7, "column": 17 }, "end": { "line": 7, "column": 30 } } }, "range": [ 323, 349 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 30 } } } ], "kind": "var", "range": [ 319, 350 ], "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 31 } }, "trailingComments": [ { "type": "Block", "value": "* @test {of} ", "range": [ 351, 368 ], "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 17 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 369, 377 ], "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.of", "raw": "'Observable.of'", "range": [ 378, 393 ], "loc": { "start": { "line": 9, "column": 9 }, "end": { "line": 9, "column": 24 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 413, 422 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "of(1, 2, 3)", "raw": "'of(1, 2, 3)'", "range": [ 423, 436 ], "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 27 } } } ], "range": [ 413, 437 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 28 } } }, "arguments": [ { "type": "Literal", "value": "should create a cold observable that emits 1, 2, 3", "raw": "'should create a cold observable that emits 1, 2, 3'", "range": [ 438, 490 ], "loc": { "start": { "line": 10, "column": 29 }, "end": { "line": 10, "column": 81 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "e1", "range": [ 518, 520 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 14 } } }, "init": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 523, 533 ], "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 27 } } }, "property": { "type": "Identifier", "name": "of", "range": [ 534, 536 ], "loc": { "start": { "line": 11, "column": 28 }, "end": { "line": 11, "column": 30 } } }, "range": [ 523, 536 ], "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 30 } } }, "arguments": [ { "type": "Literal", "value": 1, "raw": "1", "range": [ 537, 538 ], "loc": { "start": { "line": 11, "column": 31 }, "end": { "line": 11, "column": 32 } } }, { "type": "Literal", "value": 2, "raw": "2", "range": [ 540, 541 ], "loc": { "start": { "line": 11, "column": 34 }, "end": { "line": 11, "column": 35 } } }, { "type": "Literal", "value": 3, "raw": "3", "range": [ 543, 544 ], "loc": { "start": { "line": 11, "column": 37 }, "end": { "line": 11, "column": 38 } } } ], "range": [ 523, 545 ], "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 39 } } }, "property": { "type": "Identifier", "name": "concatMap", "range": [ 559, 568 ], "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 22 } } }, "range": [ 523, 568 ], "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 12, "column": 22 } } }, "arguments": [ { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 579, 580 ], "loc": { "start": { "line": 12, "column": 33 }, "end": { "line": 12, "column": 34 } } }, { "type": "Identifier", "name": "i", "range": [ 582, 583 ], "loc": { "start": { "line": 12, "column": 36 }, "end": { "line": 12, "column": 37 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Observable", "range": [ 594, 604 ], "loc": { "start": { "line": 12, "column": 48 }, "end": { "line": 12, "column": 58 } } }, "property": { "type": "Identifier", "name": "of", "range": [ 605, 607 ], "loc": { "start": { "line": 12, "column": 59 }, "end": { "line": 12, "column": 61 } } }, "range": [ 594, 607 ], "loc": { "start": { "line": 12, "column": 48 }, "end": { "line": 12, "column": 61 } } }, "arguments": [ { "type": "Identifier", "name": "x", "range": [ 608, 609 ], "loc": { "start": { "line": 12, "column": 62 }, "end": { "line": 12, "column": 63 } } } ], "range": [ 594, 610 ], "loc": { "start": { "line": 12, "column": 48 }, "end": { "line": 12, "column": 64 } } }, "property": { "type": "Identifier", "name": "delay", "range": [ 611, 616 ], "loc": { "start": { "line": 12, "column": 65 }, "end": { "line": 12, "column": 70 } } }, "range": [ 594, 616 ], "loc": { "start": { "line": 12, "column": 48 }, "end": { "line": 12, "column": 70 } } }, "arguments": [ { "type": "ConditionalExpression", "test": { "type": "BinaryExpression", "operator": "===", "left": { "type": "Identifier", "name": "i", "range": [ 617, 618 ], "loc": { "start": { "line": 12, "column": 71 }, "end": { "line": 12, "column": 72 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [ 623, 624 ], "loc": { "start": { "line": 12, "column": 77 }, "end": { "line": 12, "column": 78 } } }, "range": [ 617, 624 ], "loc": { "start": { "line": 12, "column": 71 }, "end": { "line": 12, "column": 78 } } }, "consequent": { "type": "Literal", "value": 0, "raw": "0", "range": [ 627, 628 ], "loc": { "start": { "line": 12, "column": 81 }, "end": { "line": 12, "column": 82 } } }, "alternate": { "type": "Literal", "value": 20, "raw": "20", "range": [ 631, 633 ], "loc": { "start": { "line": 12, "column": 85 }, "end": { "line": 12, "column": 87 } } }, "range": [ 617, 633 ], "loc": { "start": { "line": 12, "column": 71 }, "end": { "line": 12, "column": 87 } } }, { "type": "Identifier", "name": "rxTestScheduler", "range": [ 635, 650 ], "loc": { "start": { "line": 12, "column": 89 }, "end": { "line": 12, "column": 104 } } } ], "range": [ 594, 651 ], "loc": { "start": { "line": 12, "column": 48 }, "end": { "line": 12, "column": 105 } } }, "range": [ 587, 652 ],