UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,468 lines (1,467 loc) 225 kB
{ "type": "Program", "body": [ { "type": "ImportDeclaration", "specifiers": [ { "type": "ImportSpecifier", "local": { "type": "Identifier", "name": "Subscriber", "range": [ 9, 19 ], "loc": { "start": { "line": 1, "column": 9 }, "end": { "line": 1, "column": 19 } } }, "imported": { "type": "Identifier", "name": "Subscriber", "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": "../Subscriber", "raw": "'../Subscriber'", "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": "EmptyError", "range": [ 53, 63 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 19 } } }, "imported": { "type": "Identifier", "name": "EmptyError", "range": [ 53, 63 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 19 } } }, "range": [ 53, 63 ], "loc": { "start": { "line": 2, "column": 9 }, "end": { "line": 2, "column": 19 } } } ], "source": { "type": "Literal", "value": "../util/EmptyError", "raw": "'../util/EmptyError'", "range": [ 71, 91 ], "loc": { "start": { "line": 2, "column": 27 }, "end": { "line": 2, "column": 47 } } }, "range": [ 44, 92 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 48 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Returns an Observable that emits the single item emitted by the source Observable that matches a specified\n * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no\n * such items, notify of an IllegalArgumentException or NoSuchElementException respectively.\n *\n * <img src=\"./img/single.png\" width=\"100%\">\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n * @param {Function} a predicate function to evaluate items emitted by the source Observable.\n * @return {Observable<T>} an Observable that emits the single item emitted by the source Observable that matches\n * the predicate.\n .\n * @method single\n * @owner Observable\n ", "range": [ 93, 891 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 18, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "single", "range": [ 908, 914 ], "loc": { "start": { "line": 19, "column": 16 }, "end": { "line": 19, "column": 22 } } }, "params": [ { "type": "Identifier", "name": "predicate", "range": [ 915, 924 ], "loc": { "start": { "line": 19, "column": 23 }, "end": { "line": 19, "column": 32 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 939, 943 ], "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 15 } } }, "property": { "type": "Identifier", "name": "lift", "range": [ 944, 948 ], "loc": { "start": { "line": 20, "column": 16 }, "end": { "line": 20, "column": 20 } } }, "range": [ 939, 948 ], "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 20 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "SingleOperator", "range": [ 953, 967 ], "loc": { "start": { "line": 20, "column": 25 }, "end": { "line": 20, "column": 39 } } }, "arguments": [ { "type": "Identifier", "name": "predicate", "range": [ 968, 977 ], "loc": { "start": { "line": 20, "column": 40 }, "end": { "line": 20, "column": 49 } } }, { "type": "ThisExpression", "range": [ 979, 983 ], "loc": { "start": { "line": 20, "column": 51 }, "end": { "line": 20, "column": 55 } } } ], "range": [ 949, 984 ], "loc": { "start": { "line": 20, "column": 21 }, "end": { "line": 20, "column": 56 } } } ], "range": [ 939, 985 ], "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 57 } } }, "range": [ 932, 986 ], "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 58 } } } ], "range": [ 926, 988 ], "loc": { "start": { "line": 19, "column": 34 }, "end": { "line": 21, "column": 1 } } }, "generator": false, "expression": false, "range": [ 899, 988 ], "loc": { "start": { "line": 19, "column": 7 }, "end": { "line": 21, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Returns an Observable that emits the single item emitted by the source Observable that matches a specified\n * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no\n * such items, notify of an IllegalArgumentException or NoSuchElementException respectively.\n *\n * <img src=\"./img/single.png\" width=\"100%\">\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n * @param {Function} a predicate function to evaluate items emitted by the source Observable.\n * @return {Observable<T>} an Observable that emits the single item emitted by the source Observable that matches\n * the predicate.\n .\n * @method single\n * @owner Observable\n ", "range": [ 93, 891 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 18, "column": 3 } } } ], "trailingComments": [] }, "specifiers": [], "source": null, "range": [ 892, 988 ], "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 21, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Returns an Observable that emits the single item emitted by the source Observable that matches a specified\n * predicate, if that Observable emits one such item. If the source Observable emits more than one such item or no\n * such items, notify of an IllegalArgumentException or NoSuchElementException respectively.\n *\n * <img src=\"./img/single.png\" width=\"100%\">\n *\n * @throws {EmptyError} Delivers an EmptyError to the Observer's `error`\n * callback if the Observable completes before any `next` notification was sent.\n * @param {Function} a predicate function to evaluate items emitted by the source Observable.\n * @return {Observable<T>} an Observable that emits the single item emitted by the source Observable that matches\n * the predicate.\n .\n * @method single\n * @owner Observable\n ", "range": [ 93, 891 ], "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 18, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "SingleOperator", "range": [ 993, 1007 ], "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 18 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "SingleOperator", "range": [ 1038, 1052 ], "loc": { "start": { "line": 23, "column": 13 }, "end": { "line": 23, "column": 27 } } }, "params": [ { "type": "Identifier", "name": "predicate", "range": [ 1053, 1062 ], "loc": { "start": { "line": 23, "column": 28 }, "end": { "line": 23, "column": 37 } } }, { "type": "Identifier", "name": "source", "range": [ 1064, 1070 ], "loc": { "start": { "line": 23, "column": 39 }, "end": { "line": 23, "column": 45 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1082, 1086 ], "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 12 } } }, "property": { "type": "Identifier", "name": "predicate", "range": [ 1087, 1096 ], "loc": { "start": { "line": 24, "column": 13 }, "end": { "line": 24, "column": 22 } } }, "range": [ 1082, 1096 ], "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 22 } } }, "right": { "type": "Identifier", "name": "predicate", "range": [ 1099, 1108 ], "loc": { "start": { "line": 24, "column": 25 }, "end": { "line": 24, "column": 34 } } }, "range": [ 1082, 1108 ], "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 34 } } }, "range": [ 1082, 1109 ], "loc": { "start": { "line": 24, "column": 8 }, "end": { "line": 24, "column": 35 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1118, 1122 ], "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 12 } } }, "property": { "type": "Identifier", "name": "source", "range": [ 1123, 1129 ], "loc": { "start": { "line": 25, "column": 13 }, "end": { "line": 25, "column": 19 } } }, "range": [ 1118, 1129 ], "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 19 } } }, "right": { "type": "Identifier", "name": "source", "range": [ 1132, 1138 ], "loc": { "start": { "line": 25, "column": 22 }, "end": { "line": 25, "column": 28 } } }, "range": [ 1118, 1138 ], "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 28 } } }, "range": [ 1118, 1139 ], "loc": { "start": { "line": 25, "column": 8 }, "end": { "line": 25, "column": 29 } } } ], "range": [ 1072, 1145 ], "loc": { "start": { "line": 23, "column": 47 }, "end": { "line": 26, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1029, 1145 ], "loc": { "start": { "line": 23, "column": 4 }, "end": { "line": 26, "column": 5 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "SingleOperator", "range": [ 1150, 1164 ], "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 18 } } }, "property": { "type": "Identifier", "name": "prototype", "range": [ 1165, 1174 ], "loc": { "start": { "line": 27, "column": 19 }, "end": { "line": 27, "column": 28 } } }, "range": [ 1150, 1174 ], "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 28 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 1175, 1179 ], "loc": { "start": { "line": 27, "column": 29 }, "end": { "line": 27, "column": 33 } } }, "range": [ 1150, 1179 ], "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 27, "column": 33 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "subscriber", "range": [ 1192, 1202 ], "loc": { "start": { "line": 27, "column": 46 }, "end": { "line": 27, "column": 56 } } }, { "type": "Identifier", "name": "source", "range": [ 1204, 1210 ], "loc": { "start": { "line": 27, "column": 58 }, "end": { "line": 27, "column": 64 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "source", "range": [ 1229, 1235 ], "loc": { "start": { "line": 28, "column": 15 }, "end": { "line": 28, "column": 21 } } }, "property": { "type": "Identifier", "name": "_subscribe", "range": [ 1236, 1246 ], "loc": { "start": { "line": 28, "column": 22 }, "end": { "line": 28, "column": 32 } } }, "range": [ 1229, 1246 ], "loc": { "start": { "line": 28, "column": 15 }, "end": { "line": 28, "column": 32 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "SingleSubscriber", "range": [ 1251, 1267 ], "loc": { "start": { "line": 28, "column": 37 }, "end": { "line": 28, "column": 53 } } }, "arguments": [ { "type": "Identifier", "name": "subscriber", "range": [ 1268, 1278 ], "loc": { "start": { "line": 28, "column": 54 }, "end": { "line": 28, "column": 64 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1280, 1284 ], "loc": { "start": { "line": 28, "column": 66 }, "end": { "line": 28, "column": 70 } } }, "property": { "type": "Identifier", "name": "predicate", "range": [ 1285, 1294 ], "loc": { "start": { "line": 28, "column": 71 }, "end": { "line": 28, "column": 80 } } }, "range": [ 1280, 1294 ], "loc": { "start": { "line": 28, "column": 66 }, "end": { "line": 28, "column": 80 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1296, 1300 ], "loc": { "start": { "line": 28, "column": 82 }, "end": { "line": 28, "column": 86 } } }, "property": { "type": "Identifier", "name": "source", "range": [ 1301, 1307 ], "loc": { "start": { "line": 28, "column": 87 }, "end": { "line": 28, "column": 93 } } }, "range": [ 1296, 1307 ], "loc": { "start": { "line": 28, "column": 82 }, "end": { "line": 28, "column": 93 } } } ], "range": [ 1247, 1308 ], "loc": { "start": { "line": 28, "column": 33 }, "end": { "line": 28, "column": 94 } } } ], "range": [ 1229, 1309 ], "loc": { "start": { "line": 28, "column": 15 }, "end": { "line": 28, "column": 95 } } }, "range": [ 1222, 1310 ], "loc": { "start": { "line": 28, "column": 8 }, "end": { "line": 28, "column": 96 } } } ], "range": [ 1212, 1316 ], "loc": { "start": { "line": 27, "column": 66 }, "end": { "line": 29, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1182, 1316 ], "loc": { "start": { "line": 27, "column": 36 }, "end": { "line": 29, "column": 5 } } }, "range": [ 1150, 1316 ], "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 29, "column": 5 } } }, "range": [ 1150, 1317 ], "loc": { "start": { "line": 27, "column": 4 }, "end": { "line": 29, "column": 6 } } }, { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "SingleOperator", "range": [ 1329, 1343 ], "loc": { "start": { "line": 30, "column": 11 }, "end": { "line": 30, "column": 25 } } }, "range": [ 1322, 1344 ], "loc": { "start": { "line": 30, "column": 4 }, "end": { "line": 30, "column": 26 } } } ], "range": [ 1023, 1346 ], "loc": { "start": { "line": 22, "column": 34 }, "end": { "line": 31, "column": 1 } } }, "generator": false, "expression": false, "range": [ 1011, 1346 ], "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 31, "column": 1 } } }, "arguments": [], "range": [ 1011, 1348 ], "loc": { "start": { "line": 22, "column": 22 }, "end": { "line": 31, "column": 3 } } }, "range": [ 993, 1349 ], "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 31, "column": 4 } } } ], "kind": "var", "range": [ 989, 1350 ], "loc": { "start": { "line": 22, "column": 0 }, "end": { "line": 31, "column": 5 } }, "trailingComments": [ { "type": "Block", "value": "*\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n ", "range": [ 1351, 1442 ], "loc": { "start": { "line": 32, "column": 0 }, "end": { "line": 36, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "SingleSubscriber", "range": [ 1447, 1463 ], "loc": { "start": { "line": 37, "column": 4 }, "end": { "line": 37, "column": 20 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "_super", "range": [ 1477, 1483 ], "loc": { "start": {