UNPKG

@reactivex/rxjs

Version:

Reactive Extensions for modern JavaScript

1,440 lines (1,439 loc) 77.6 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 } }, "trailingComments": [ { "type": "Block", "value": "*\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * <img src=\"./img/mapTo.png\" width=\"100%\">\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * @example <caption>Map every every click to the string 'Hi'</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var greetings = clicks.mapTo('Hi');\n * greetings.subscribe(x => console.log(x));\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n ", "range": [ 44, 1033 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 27, "column": 3 } } } ] }, { "type": "ExportNamedDeclaration", "declaration": { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "mapTo", "range": [ 1050, 1055 ], "loc": { "start": { "line": 28, "column": 16 }, "end": { "line": 28, "column": 21 } } }, "params": [ { "type": "Identifier", "name": "value", "range": [ 1056, 1061 ], "loc": { "start": { "line": 28, "column": 22 }, "end": { "line": 28, "column": 27 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1076, 1080 ], "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 29, "column": 15 } } }, "property": { "type": "Identifier", "name": "lift", "range": [ 1081, 1085 ], "loc": { "start": { "line": 29, "column": 16 }, "end": { "line": 29, "column": 20 } } }, "range": [ 1076, 1085 ], "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 29, "column": 20 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "MapToOperator", "range": [ 1090, 1103 ], "loc": { "start": { "line": 29, "column": 25 }, "end": { "line": 29, "column": 38 } } }, "arguments": [ { "type": "Identifier", "name": "value", "range": [ 1104, 1109 ], "loc": { "start": { "line": 29, "column": 39 }, "end": { "line": 29, "column": 44 } } } ], "range": [ 1086, 1110 ], "loc": { "start": { "line": 29, "column": 21 }, "end": { "line": 29, "column": 45 } } } ], "range": [ 1076, 1111 ], "loc": { "start": { "line": 29, "column": 11 }, "end": { "line": 29, "column": 46 } } }, "range": [ 1069, 1112 ], "loc": { "start": { "line": 29, "column": 4 }, "end": { "line": 29, "column": 47 } } } ], "range": [ 1063, 1114 ], "loc": { "start": { "line": 28, "column": 29 }, "end": { "line": 30, "column": 1 } } }, "generator": false, "expression": false, "range": [ 1041, 1114 ], "loc": { "start": { "line": 28, "column": 7 }, "end": { "line": 30, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * <img src=\"./img/mapTo.png\" width=\"100%\">\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * @example <caption>Map every every click to the string 'Hi'</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var greetings = clicks.mapTo('Hi');\n * greetings.subscribe(x => console.log(x));\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n ", "range": [ 44, 1033 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 27, "column": 3 } } } ], "trailingComments": [] }, "specifiers": [], "source": null, "range": [ 1034, 1114 ], "loc": { "start": { "line": 28, "column": 0 }, "end": { "line": 30, "column": 1 } }, "leadingComments": [ { "type": "Block", "value": "*\n * Emits the given constant value on the output Observable every time the source\n * Observable emits a value.\n *\n * <span class=\"informal\">Like {@link map}, but it maps every source value to\n * the same output value every time.</span>\n *\n * <img src=\"./img/mapTo.png\" width=\"100%\">\n *\n * Takes a constant `value` as argument, and emits that whenever the source\n * Observable emits a value. In other words, ignores the actual source value,\n * and simply uses the emission moment to know when to emit the given `value`.\n *\n * @example <caption>Map every every click to the string 'Hi'</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var greetings = clicks.mapTo('Hi');\n * greetings.subscribe(x => console.log(x));\n *\n * @see {@link map}\n *\n * @param {any} value The value to map each source value to.\n * @return {Observable} An Observable that emits the given `value` every time\n * the source Observable emits something.\n * @method mapTo\n * @owner Observable\n ", "range": [ 44, 1033 ], "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 27, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "MapToOperator", "range": [ 1119, 1132 ], "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 31, "column": 17 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [], "body": { "type": "BlockStatement", "body": [ { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "MapToOperator", "range": [ 1163, 1176 ], "loc": { "start": { "line": 32, "column": 13 }, "end": { "line": 32, "column": 26 } } }, "params": [ { "type": "Identifier", "name": "value", "range": [ 1177, 1182 ], "loc": { "start": { "line": 32, "column": 27 }, "end": { "line": 32, "column": 32 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1194, 1198 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 12 } } }, "property": { "type": "Identifier", "name": "value", "range": [ 1199, 1204 ], "loc": { "start": { "line": 33, "column": 13 }, "end": { "line": 33, "column": 18 } } }, "range": [ 1194, 1204 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 18 } } }, "right": { "type": "Identifier", "name": "value", "range": [ 1207, 1212 ], "loc": { "start": { "line": 33, "column": 21 }, "end": { "line": 33, "column": 26 } } }, "range": [ 1194, 1212 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 26 } } }, "range": [ 1194, 1213 ], "loc": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 27 } } } ], "range": [ 1184, 1219 ], "loc": { "start": { "line": 32, "column": 34 }, "end": { "line": 34, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1154, 1219 ], "loc": { "start": { "line": 32, "column": 4 }, "end": { "line": 34, "column": 5 } } }, { "type": "ExpressionStatement", "expression": { "type": "AssignmentExpression", "operator": "=", "left": { "type": "MemberExpression", "computed": false, "object": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "MapToOperator", "range": [ 1224, 1237 ], "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 17 } } }, "property": { "type": "Identifier", "name": "prototype", "range": [ 1238, 1247 ], "loc": { "start": { "line": 35, "column": 18 }, "end": { "line": 35, "column": 27 } } }, "range": [ 1224, 1247 ], "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 27 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 1248, 1252 ], "loc": { "start": { "line": 35, "column": 28 }, "end": { "line": 35, "column": 32 } } }, "range": [ 1224, 1252 ], "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 35, "column": 32 } } }, "right": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "subscriber", "range": [ 1265, 1275 ], "loc": { "start": { "line": 35, "column": 45 }, "end": { "line": 35, "column": 55 } } }, { "type": "Identifier", "name": "source", "range": [ 1277, 1283 ], "loc": { "start": { "line": 35, "column": 57 }, "end": { "line": 35, "column": 63 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ReturnStatement", "argument": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "source", "range": [ 1302, 1308 ], "loc": { "start": { "line": 36, "column": 15 }, "end": { "line": 36, "column": 21 } } }, "property": { "type": "Identifier", "name": "_subscribe", "range": [ 1309, 1319 ], "loc": { "start": { "line": 36, "column": 22 }, "end": { "line": 36, "column": 32 } } }, "range": [ 1302, 1319 ], "loc": { "start": { "line": 36, "column": 15 }, "end": { "line": 36, "column": 32 } } }, "arguments": [ { "type": "NewExpression", "callee": { "type": "Identifier", "name": "MapToSubscriber", "range": [ 1324, 1339 ], "loc": { "start": { "line": 36, "column": 37 }, "end": { "line": 36, "column": 52 } } }, "arguments": [ { "type": "Identifier", "name": "subscriber", "range": [ 1340, 1350 ], "loc": { "start": { "line": 36, "column": 53 }, "end": { "line": 36, "column": 63 } } }, { "type": "MemberExpression", "computed": false, "object": { "type": "ThisExpression", "range": [ 1352, 1356 ], "loc": { "start": { "line": 36, "column": 65 }, "end": { "line": 36, "column": 69 } } }, "property": { "type": "Identifier", "name": "value", "range": [ 1357, 1362 ], "loc": { "start": { "line": 36, "column": 70 }, "end": { "line": 36, "column": 75 } } }, "range": [ 1352, 1362 ], "loc": { "start": { "line": 36, "column": 65 }, "end": { "line": 36, "column": 75 } } } ], "range": [ 1320, 1363 ], "loc": { "start": { "line": 36, "column": 33 }, "end": { "line": 36, "column": 76 } } } ], "range": [ 1302, 1364 ], "loc": { "start": { "line": 36, "column": 15 }, "end": { "line": 36, "column": 77 } } }, "range": [ 1295, 1365 ], "loc": { "start": { "line": 36, "column": 8 }, "end": { "line": 36, "column": 78 } } } ], "range": [ 1285, 1371 ], "loc": { "start": { "line": 35, "column": 65 }, "end": { "line": 37, "column": 5 } } }, "generator": false, "expression": false, "range": [ 1255, 1371 ], "loc": { "start": { "line": 35, "column": 35 }, "end": { "line": 37, "column": 5 } } }, "range": [ 1224, 1371 ], "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 37, "column": 5 } } }, "range": [ 1224, 1372 ], "loc": { "start": { "line": 35, "column": 4 }, "end": { "line": 37, "column": 6 } } }, { "type": "ReturnStatement", "argument": { "type": "Identifier", "name": "MapToOperator", "range": [ 1384, 1397 ], "loc": { "start": { "line": 38, "column": 11 }, "end": { "line": 38, "column": 24 } } }, "range": [ 1377, 1398 ], "loc": { "start": { "line": 38, "column": 4 }, "end": { "line": 38, "column": 25 } } } ], "range": [ 1148, 1400 ], "loc": { "start": { "line": 31, "column": 33 }, "end": { "line": 39, "column": 1 } } }, "generator": false, "expression": false, "range": [ 1136, 1400 ], "loc": { "start": { "line": 31, "column": 21 }, "end": { "line": 39, "column": 1 } } }, "arguments": [], "range": [ 1136, 1402 ], "loc": { "start": { "line": 31, "column": 21 }, "end": { "line": 39, "column": 3 } } }, "range": [ 1119, 1403 ], "loc": { "start": { "line": 31, "column": 4 }, "end": { "line": 39, "column": 4 } } } ], "kind": "var", "range": [ 1115, 1404 ], "loc": { "start": { "line": 31, "column": 0 }, "end": { "line": 39, "column": 5 } }, "trailingComments": [ { "type": "Block", "value": "*\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n ", "range": [ 1405, 1496 ], "loc": { "start": { "line": 40, "column": 0 }, "end": { "line": 44, "column": 3 } } } ] }, { "type": "VariableDeclaration", "declarations": [ { "type": "VariableDeclarator", "id": { "type": "Identifier", "name": "MapToSubscriber", "range": [ 1501, 1516 ], "loc": { "start": { "line": 45, "column": 4 }, "end": { "line": 45, "column": 19 } } }, "init": { "type": "CallExpression", "callee": { "type": "FunctionExpression", "id": null, "params": [ { "type": "Identifier", "name": "_super", "range": [ 1530, 1536 ], "loc": { "start": { "line": 45, "column": 33 }, "end": { "line": 45, "column": 39 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "Identifier", "name": "__extends", "range": [ 1544, 1553 ], "loc": { "start": { "line": 46, "column": 4 }, "end": { "line": 46, "column": 13 } } }, "arguments": [ { "type": "Identifier", "name": "MapToSubscriber", "range": [ 1554, 1569 ], "loc": { "start": { "line": 46, "column": 14 }, "end": { "line": 46, "column": 29 } } }, { "type": "Identifier", "name": "_super", "range": [ 1571, 1577 ], "loc": { "start": { "line": 46, "column": 31 }, "end": { "line": 46, "column": 37 } } } ], "range": [ 1544, 1578 ], "loc": { "start": { "line": 46, "column": 4 }, "end": { "line": 46, "column": 38 } } }, "range": [ 1544, 1579 ], "loc": { "start": { "line": 46, "column": 4 }, "end": { "line": 46, "column": 39 } } }, { "type": "FunctionDeclaration", "id": { "type": "Identifier", "name": "MapToSubscriber", "range": [ 1593, 1608 ], "loc": { "start": { "line": 47, "column": 13 }, "end": { "line": 47, "column": 28 } } }, "params": [ { "type": "Identifier", "name": "destination", "range": [ 1609, 1620 ], "loc": { "start": { "line": 47, "column": 29 }, "end": { "line": 47, "column": 40 } } }, { "type": "Identifier", "name": "value", "range": [ 1622, 1627 ], "loc": { "start": { "line": 47, "column": 42 }, "end": { "line": 47, "column": 47 } } } ], "body": { "type": "BlockStatement", "body": [ { "type": "ExpressionStatement", "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", "computed": false, "object": { "type": "Identifier", "name": "_super", "range": [ 1639, 1645 ], "loc": { "start": { "line": 48, "column": 8 }, "end": { "line": 48, "column": 14 } } }, "property": { "type": "Identifier", "name": "call", "range": [ 1646, 1650 ], "loc": { "start": { "line": 48, "column": 15 }, "end": { "line": 48, "column": 19 } } }, "range": [ 1639, 1650 ], "loc": { "start": { "line": 48, "column": 8 }, "end": { "line": 48, "column": 19 } } }, "arguments": [ { "type": "ThisExpression", "range": [ 1651, 1655 ], "loc": { "start": { "line": 48, "column": 20 }, "end": { "line": 48, "column": 24 } } }, { "type": "Identifier", "name": "destination", "range": [ 1657, 1668 ], "loc": { "start": { "line": 48, "column": 26 }, "end": { "line": 48, "column": 37 } }