UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,336 lines (1,335 loc) 584 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": "Observable", "range": [ 87, 97 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 14 } } }, "init": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "Rx", "range": [ 100, 102 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 19 } } }, "property": { "type": "Identifier", "name": "Observable", "range": [ 103, 113 ], "loc": { "start": { "line": 4, "column": 20 }, "end": { "line": 4, "column": 30 } } }, "range": [ 100, 113 ], "loc": { "start": { "line": 4, "column": 17 }, "end": { "line": 4, "column": 30 } } }, "range": [ 87, 113 ], "loc": { "start": { "line": 4, "column": 4 }, "end": { "line": 4, "column": 30 } } } ], "kind": "var", "range": [ 83, 114 ], "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 31 } }, "trailingComments": [ { "type": "Block", "value": "* @test {find} ", "range": [ 115, 134 ], "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 19 } } } ] }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "describe", "range": [ 135, 143 ], "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 8 } } }, "arguments": [ { "type": "Literal", "value": "Observable.prototype.find", "raw": "'Observable.prototype.find'", "range": [ 144, 171 ], "loc": { "start": { "line": 6, "column": 9 }, "end": { "line": 6, "column": 36 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "truePredicate", "range": [ 200, 213 ], "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 26 } } }, "params": [ { "type": "Identifier", "name": "x", "range": [ 214, 215 ], "loc": { "start": { "line": 7, "column": 27 }, "end": { "line": 7, "column": 28 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "Literal", "value": true, "raw": "true", "range": [ 234, 238 ], "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 8, "column": 19 } } }, "range": [ 227, 239 ], "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 20 } } } ], "range": [ 217, 245 ], "loc": { "start": { "line": 7, "column": 30 }, "end": { "line": 9, "column": 5 } } }, "generator": false, "expression": false, "range": [ 191, 245 ], "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 9, "column": 5 } } }, { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "asDiagram", "range": [ 250, 259 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 13 } } }, "arguments": [ { "type": "Literal", "value": "find(x => x % 5 === 0)", "raw": "'find(x => x % 5 === 0)'", "range": [ 260, 284 ], "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 10, "column": 38 } } } ], "range": [ 250, 285 ], "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 39 } } }, "arguments": [ { "type": "Literal", "value": "should return matching element from source emits single element", "raw": "'should return matching element from source emits single element'", "range": [ 286, 351 ], "loc": { "start": { "line": 10, "column": 40 }, "end": { "line": 10, "column": 105 } } }, { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "values", "range": [ 379, 385 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 18 } } }, "init": { "type": "ObjectExpression", "properties": [ { "type": "Property", "key": { "type": "Identifier", "name": "a", "range": [ 390, 391 ], "loc": { "start": { "line": 11, "column": 23 }, "end": { "line": 11, "column": 24 } } }, "value": { "type": "Literal", "value": 3, "raw": "3", "range": [ 393, 394 ], "loc": { "start": { "line": 11, "column": 26 }, "end": { "line": 11, "column": 27 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 390, 394 ], "loc": { "start": { "line": 11, "column": 23 }, "end": { "line": 11, "column": 27 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "b", "range": [ 396, 397 ], "loc": { "start": { "line": 11, "column": 29 }, "end": { "line": 11, "column": 30 } } }, "value": { "type": "Literal", "value": 9, "raw": "9", "range": [ 399, 400 ], "loc": { "start": { "line": 11, "column": 32 }, "end": { "line": 11, "column": 33 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 396, 400 ], "loc": { "start": { "line": 11, "column": 29 }, "end": { "line": 11, "column": 33 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "c", "range": [ 402, 403 ], "loc": { "start": { "line": 11, "column": 35 }, "end": { "line": 11, "column": 36 } } }, "value": { "type": "Literal", "value": 15, "raw": "15", "range": [ 405, 407 ], "loc": { "start": { "line": 11, "column": 38 }, "end": { "line": 11, "column": 40 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 402, 407 ], "loc": { "start": { "line": 11, "column": 35 }, "end": { "line": 11, "column": 40 } } }, { "type": "Property", "key": { "type": "Identifier", "name": "d", "range": [ 409, 410 ], "loc": { "start": { "line": 11, "column": 42 }, "end": { "line": 11, "column": 43 } } }, "value": { "type": "Literal", "value": 20, "raw": "20", "range": [ 412, 414 ], "loc": { "start": { "line": 11, "column": 45 }, "end": { "line": 11, "column": 47 } } }, "kind": "init", "method": false, "shorthand": false, "computed": false, "range": [ 409, 414 ], "loc": { "start": { "line": 11, "column": 42 }, "end": { "line": 11, "column": 47 } } } ], "range": [ 388, 416 ], "loc": { "start": { "line": 11, "column": 21 }, "end": { "line": 11, "column": 49 } } }, "range": [ 379, 416 ], "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 49 } } } ], "kind": "var", "range": [ 375, 417 ], "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 50 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "source", "range": [ 430, 436 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "hot", "range": [ 439, 442 ], "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 24 } } }, "arguments": [ { "type": "Literal", "value": "---a--b--c--d---|", "raw": "'---a--b--c--d---|'", "range": [ 443, 462 ], "loc": { "start": { "line": 12, "column": 25 }, "end": { "line": 12, "column": 44 } } }, { "type": "Identifier", "name": "values", "range": [ 464, 470 ], "loc": { "start": { "line": 12, "column": 46 }, "end": { "line": 12, "column": 52 } } } ], "range": [ 439, 471 ], "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 53 } } }, "range": [ 430, 471 ], "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 53 } } } ], "kind": "var", "range": [ 426, 472 ], "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 54 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "subs", "range": [ 485, 489 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 16 } } }, "init": { "type": "Literal", "value": "^ ! ", "raw": "'^ ! '", "range": [ 492, 511 ], "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 38 } } }, "range": [ 485, 511 ], "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 38 } } } ], "kind": "var", "range": [ 481, 512 ], "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 39 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "expected", "range": [ 525, 533 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 20 } } }, "init": { "type": "Literal", "value": "---------(c|) ", "raw": "'---------(c|) '", "range": [ 536, 555 ], "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 42 } } }, "range": [ 525, 555 ], "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 42 } } } ], "kind": "var", "range": [ 521, 556 ], "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 43 } } }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "predicate", "range": [ 569, 578 ], "loc": { "start": { "line": 15, "column": 12 }, "end": { "line": 15, "column": 21 } } }, "init": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "x", "range": [ 591, 592 ], "loc": { "start": { "line": 15, "column": 34 }, "end": { "line": 15, "column": 35 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "BinaryExpression", "operator": "===", "left": { "type": "BinaryExpression", "operator": "%", "left": { "type": "Identifier", "name": "x", "range": [ 603, 604 ], "loc": { "start": { "line": 15, "column": 46 }, "end": { "line": 15, "column": 47 } } }, "right": { "type": "Literal", "value": 5, "raw": "5", "range": [ 607, 608 ], "loc": { "start": { "line": 15, "column": 50 }, "end": { "line": 15, "column": 51 } } }, "range": [ 603, 608 ], "loc": { "start": { "line": 15, "column": 46 }, "end": { "line": 15, "column": 51 } } }, "right": { "type": "Literal", "value": 0, "raw": "0", "range": [