UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,270 lines (1,269 loc) 583 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": "Rx", "range": [ 18, 20 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 6 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "require", "range": [ 23, 30 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 16 } } }, "arguments": [ { "type": "Literal", "value": "../../dist/cjs/Rx", "raw": "'../../dist/cjs/Rx'", "range": [ 31, 50 ], "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 36 } } } ], "range": [ 23, 51 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 37 } } }, "range": [ 18, 51 ], "loc": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 37 } } } ], "kind": "var", "range": [ 14, 52 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 38 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "Observable", "range": [ 57, 67 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 70, 72 ], "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 73, 83 ], "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 30 } } }, "range": [ 70, 83 ], "loc": { "start": { "line": 3, "column": 17 }, "end": { "line": 3, "column": 30 } } }, "range": [ 57, 83 ], "loc": { "start": { "line": 3, "column": 4 }, "end": { "line": 3, "column": 30 } } } ], "kind": "var", "range": [ 53, 84 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 31 } }, "trailingComments": [ { "type": "Block", "value": "* @test {findIndex} ", "range": [ 85, 109 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 24 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 110, 118 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.prototype.findIndex", "raw": "'Observable.prototype.findIndex'", "range": [ 119, 151 ], "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 41 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "truePredicate", "range": [ 180, 193 ], "loc": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 26 } } }, "params": [ { "type": "Identifier", "name": "x", "range": [ 194, 195 ], "loc": { "start": { "line": 6, "column": 27 }, "end": { "line": 6, "column": 28 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "Literal", "value": true, "raw": "true", "range": [ 214, 218 ], "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 7, "column": 19 } } }, "range": [ 207, 219 ], "loc": { "start": { "line": 7, "column": 8 }, "end": { "line": 7, "column": 20 } } } ], "range": [ 197, 225 ], "loc": { "start": { "line": 6, "column": 30 }, "end": { "line": 8, "column": 5 } } }, "generator": false, "expression": false, "range": [ 171, 225 ], "loc": { "start": { "line": 6, "column": 4 }, "end": { "line": 8, "column": 5 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 230, 239 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "findIndex(x => x % 5 === 0)", "raw": "'findIndex(x => x % 5 === 0)'", "range": [ 240, 269 ], "loc": { "start": { "line": 9, "column": 14 }, "end": { "line": 9, "column": 43 } } } ], "range": [ 230, 270 ], "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 44 } } }, "arguments": [ { "type": "Literal", "value": "should return matching element from source emits single element", "raw": "'should return matching element from source emits single element'", "range": [ 271, 336 ], "loc": { "start": { "line": 9, "column": 45 }, "end": { "line": 9, "column": 110 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "values", "range": [ 364, 370 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 18 } } }, "init": { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "a", "range": [ 375, 376 ], "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 24 } } }, "value": { "type": "Literal", "value": 3, "raw": "3", "range": [ 378, 379 ], "loc": { "start": { "line": 10, "column": 26 }, "end": { "line": 10, "column": 27 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 375, 379 ], "loc": { "start": { "line": 10, "column": 23 }, "end": { "line": 10, "column": 27 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "b", "range": [ 381, 382 ], "loc": { "start": { "line": 10, "column": 29 }, "end": { "line": 10, "column": 30 } } }, "value": { "type": "Literal", "value": 9, "raw": "9", "range": [ 384, 385 ], "loc": { "start": { "line": 10, "column": 32 }, "end": { "line": 10, "column": 33 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 381, 385 ], "loc": { "start": { "line": 10, "column": 29 }, "end": { "line": 10, "column": 33 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "c", "range": [ 387, 388 ], "loc": { "start": { "line": 10, "column": 35 }, "end": { "line": 10, "column": 36 } } }, "value": { "type": "Literal", "value": 15, "raw": "15", "range": [ 390, 392 ], "loc": { "start": { "line": 10, "column": 38 }, "end": { "line": 10, "column": 40 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 387, 392 ], "loc": { "start": { "line": 10, "column": 35 }, "end": { "line": 10, "column": 40 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "d", "range": [ 394, 395 ], "loc": { "start": { "line": 10, "column": 42 }, "end": { "line": 10, "column": 43 } } }, "value": { "type": "Literal", "value": 20, "raw": "20", "range": [ 397, 399 ], "loc": { "start": { "line": 10, "column": 45 }, "end": { "line": 10, "column": 47 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 394, 399 ], "loc": { "start": { "line": 10, "column": 42 }, "end": { "line": 10, "column": 47 } } } ], "range": [ 373, 401 ], "loc": { "start": { "line": 10, "column": 21 }, "end": { "line": 10, "column": 49 } } }, "range": [ 364, 401 ], "loc": { "start": { "line": 10, "column": 12 }, "end": { "line": 10, "column": 49 } } } ], "kind": "var", "range": [ 360, 402 ], "loc": { "start": { "line": 10, "column": 8 }, "end": { "line": 10, "column": 50 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "source", "range": [ 415, 421 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "hot", "range": [ 424, 427 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 24 } } }, "arguments": [ { "type": "Literal", "value": "---a--b--c--d---|", "raw": "'---a--b--c--d---|'", "range": [ 428, 447 ], "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 44 } } }, { "type": "Identifier", "name": "values", "range": [ 449, 455 ], "loc": { "start": { "line": 11, "column": 46 }, "end": { "line": 11, "column": 52 } } } ], "range": [ 424, 456 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 53 } } }, "range": [ 415, 456 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 53 } } } ], "kind": "var", "range": [ 411, 457 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 54 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "subs", "range": [ 470, 474 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 16 } } }, "init": { "type": "Literal", "value": "^ ! ", "raw": "'^ ! '", "range": [ 477, 496 ], "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 12, "column": 38 } } }, "range": [ 470, 496 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 38 } } } ], "kind": "var", "range": [ 466, 497 ], "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 39 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 510, 518 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 20 } } }, "init": { "type": "Literal", "value": "---------(x|) ", "raw": "'---------(x|) '", "range": [ 521, 540 ], "loc": { "start": { "line": 13, "column": 23 }, "end": { "line": 13, "column": 42 } } }, "range": [ 510, 540 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 42 } } } ], "kind": "var", "range": [ 506, 541 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 43 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "predicate", "range": [ 554, 563 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 21 } } }, "init": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 576, 577 ], "loc": { "start": { "line": 14, "column": 34 }, "end": { "line": 14, "column": 35 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "===", "left": { "type": "BinaryExpression", "operator": "%", "left": { "type": "Identifier", "name": "x", "range": [ 588, 589 ], "loc": { "start": { "line": 14, "column": 46 }, "end": { "line": 14, "column": 47 } } }, "right": { "type": "Literal", "value": 5, "raw": "5", "range": [ 592, 593 ], "loc": { "start": { "line": 14, "column": 50 }, "end": { "line": 14, "column": 51 } } }, "range": [ 588, 593 ], "loc": { "start": { "line": 14, "column": 46 }, "end": { "line": 14, "column": 51 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [ 598, 599 ], "loc": { "start": { "line": 14, "column": 56 }, "end": { "line": 14, "column": 57 } } }, "range": [ 588, 599 ], "loc": { "start": { "line": 14, "column": 46 }, "end": { "line": 14, "column": 57 } } }, "range": [ 581, 600 ], "loc": { "start": { "line": 14, "column": 39 }, "end": { "line": 14, "column": 58 } } } ],