@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,451 lines (1,450 loc) • 117 kB
JSON
{
"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": "Notification",
"range": [
53,
65
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 21
}
}
},
"imported": {
"type": "Identifier",
"name": "Notification",
"range": [
53,
65
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 21
}
}
},
"range": [
53,
65
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 21
}
}
}
],
"source": {
"type": "Literal",
"value": "../Notification",
"raw": "'../Notification'",
"range": [
73,
90
],
"loc": {
"start": {
"line": 2,
"column": 29
},
"end": {
"line": 2,
"column": 46
}
}
},
"range": [
44,
91
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 47
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * Represents all of the notifications from the source Observable as `next`\n * emissions marked with their original types within {@link Notification}\n * objects.\n *\n * <span class=\"informal\">Wraps `next`, `error` and `complete` emissions in\n * {@link Notification} objects, emitted as `next` on the output Observable.\n * </span>\n *\n * <img src=\"./img/materialize.png\" width=\"100%\">\n *\n * `materialize` returns an Observable that emits a `next` notification for each\n * `next`, `error`, or `complete` emission of the source Observable. When the\n * source Observable emits `complete`, the output Observable will emit `next` as\n * a Notification of type \"complete\", and then it will emit `complete` as well.\n * When the source Observable emits `error`, the output will emit `next` as a\n * Notification of type \"error\", and then `complete`.\n *\n * This operator is useful for producing metadata of the source Observable, to\n * be consumed as `next` emissions. Use it in conjunction with\n * {@link dematerialize}.\n *\n * @example <caption>Convert a faulty Observable to an Observable of Notifications</caption>\n * var letters = Rx.Observable.of('a', 'b', 13, 'd');\n * var upperCase = letters.map(x => x.toUpperCase());\n * var materialized = upperCase.materialize();\n * materialized.subscribe(x => console.log(x));\n *\n * @see {@link Notification}\n * @see {@link dematerialize}\n *\n * @return {Observable<Notification<T>>} An Observable that emits\n * {@link Notification} objects that wrap the original emissions from the source\n * Observable with metadata.\n * @method materialize\n * @owner Observable\n ",
"range": [
92,
1691
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 39,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"declaration": {
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "materialize",
"range": [
1708,
1719
],
"loc": {
"start": {
"line": 40,
"column": 16
},
"end": {
"line": 40,
"column": 27
}
}
},
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1735,
1739
],
"loc": {
"start": {
"line": 41,
"column": 11
},
"end": {
"line": 41,
"column": 15
}
}
},
"property": {
"type": "Identifier",
"name": "lift",
"range": [
1740,
1744
],
"loc": {
"start": {
"line": 41,
"column": 16
},
"end": {
"line": 41,
"column": 20
}
}
},
"range": [
1735,
1744
],
"loc": {
"start": {
"line": 41,
"column": 11
},
"end": {
"line": 41,
"column": 20
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "MaterializeOperator",
"range": [
1749,
1768
],
"loc": {
"start": {
"line": 41,
"column": 25
},
"end": {
"line": 41,
"column": 44
}
}
},
"arguments": [],
"range": [
1745,
1770
],
"loc": {
"start": {
"line": 41,
"column": 21
},
"end": {
"line": 41,
"column": 46
}
}
}
],
"range": [
1735,
1771
],
"loc": {
"start": {
"line": 41,
"column": 11
},
"end": {
"line": 41,
"column": 47
}
}
},
"range": [
1728,
1772
],
"loc": {
"start": {
"line": 41,
"column": 4
},
"end": {
"line": 41,
"column": 48
}
}
}
],
"range": [
1722,
1774
],
"loc": {
"start": {
"line": 40,
"column": 30
},
"end": {
"line": 42,
"column": 1
}
}
},
"generator": false,
"expression": false,
"range": [
1699,
1774
],
"loc": {
"start": {
"line": 40,
"column": 7
},
"end": {
"line": 42,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Represents all of the notifications from the source Observable as `next`\n * emissions marked with their original types within {@link Notification}\n * objects.\n *\n * <span class=\"informal\">Wraps `next`, `error` and `complete` emissions in\n * {@link Notification} objects, emitted as `next` on the output Observable.\n * </span>\n *\n * <img src=\"./img/materialize.png\" width=\"100%\">\n *\n * `materialize` returns an Observable that emits a `next` notification for each\n * `next`, `error`, or `complete` emission of the source Observable. When the\n * source Observable emits `complete`, the output Observable will emit `next` as\n * a Notification of type \"complete\", and then it will emit `complete` as well.\n * When the source Observable emits `error`, the output will emit `next` as a\n * Notification of type \"error\", and then `complete`.\n *\n * This operator is useful for producing metadata of the source Observable, to\n * be consumed as `next` emissions. Use it in conjunction with\n * {@link dematerialize}.\n *\n * @example <caption>Convert a faulty Observable to an Observable of Notifications</caption>\n * var letters = Rx.Observable.of('a', 'b', 13, 'd');\n * var upperCase = letters.map(x => x.toUpperCase());\n * var materialized = upperCase.materialize();\n * materialized.subscribe(x => console.log(x));\n *\n * @see {@link Notification}\n * @see {@link dematerialize}\n *\n * @return {Observable<Notification<T>>} An Observable that emits\n * {@link Notification} objects that wrap the original emissions from the source\n * Observable with metadata.\n * @method materialize\n * @owner Observable\n ",
"range": [
92,
1691
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 39,
"column": 3
}
}
}
],
"trailingComments": []
},
"specifiers": [],
"source": null,
"range": [
1692,
1774
],
"loc": {
"start": {
"line": 40,
"column": 0
},
"end": {
"line": 42,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Represents all of the notifications from the source Observable as `next`\n * emissions marked with their original types within {@link Notification}\n * objects.\n *\n * <span class=\"informal\">Wraps `next`, `error` and `complete` emissions in\n * {@link Notification} objects, emitted as `next` on the output Observable.\n * </span>\n *\n * <img src=\"./img/materialize.png\" width=\"100%\">\n *\n * `materialize` returns an Observable that emits a `next` notification for each\n * `next`, `error`, or `complete` emission of the source Observable. When the\n * source Observable emits `complete`, the output Observable will emit `next` as\n * a Notification of type \"complete\", and then it will emit `complete` as well.\n * When the source Observable emits `error`, the output will emit `next` as a\n * Notification of type \"error\", and then `complete`.\n *\n * This operator is useful for producing metadata of the source Observable, to\n * be consumed as `next` emissions. Use it in conjunction with\n * {@link dematerialize}.\n *\n * @example <caption>Convert a faulty Observable to an Observable of Notifications</caption>\n * var letters = Rx.Observable.of('a', 'b', 13, 'd');\n * var upperCase = letters.map(x => x.toUpperCase());\n * var materialized = upperCase.materialize();\n * materialized.subscribe(x => console.log(x));\n *\n * @see {@link Notification}\n * @see {@link dematerialize}\n *\n * @return {Observable<Notification<T>>} An Observable that emits\n * {@link Notification} objects that wrap the original emissions from the source\n * Observable with metadata.\n * @method materialize\n * @owner Observable\n ",
"range": [
92,
1691
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 39,
"column": 3
}
}
}
]
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "MaterializeOperator",
"range": [
1779,
1798
],
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 43,
"column": 23
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "MaterializeOperator",
"range": [
1829,
1848
],
"loc": {
"start": {
"line": 44,
"column": 13
},
"end": {
"line": 44,
"column": 32
}
}
},
"params": [],
"body": {
"type": "BlockStatement",
"body": [],
"range": [
1851,
1858
],
"loc": {
"start": {
"line": 44,
"column": 35
},
"end": {
"line": 45,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
1820,
1858
],
"loc": {
"start": {
"line": 44,
"column": 4
},
"end": {
"line": 45,
"column": 5
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "MaterializeOperator",
"range": [
1863,
1882
],
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 46,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "prototype",
"range": [
1883,
1892
],
"loc": {
"start": {
"line": 46,
"column": 24
},
"end": {
"line": 46,
"column": 33
}
}
},
"range": [
1863,
1892
],
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 46,
"column": 33
}
}
},
"property": {
"type": "Identifier",
"name": "call",
"range": [
1893,
1897
],
"loc": {
"start": {
"line": 46,
"column": 34
},
"end": {
"line": 46,
"column": 38
}
}
},
"range": [
1863,
1897
],
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 46,
"column": 38
}
}
},
"right": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "subscriber",
"range": [
1910,
1920
],
"loc": {
"start": {
"line": 46,
"column": 51
},
"end": {
"line": 46,
"column": 61
}
}
},
{
"type": "Identifier",
"name": "source",
"range": [
1922,
1928
],
"loc": {
"start": {
"line": 46,
"column": 63
},
"end": {
"line": 46,
"column": 69
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "source",
"range": [
1947,
1953
],
"loc": {
"start": {
"line": 47,
"column": 15
},
"end": {
"line": 47,
"column": 21
}
}
},
"property": {
"type": "Identifier",
"name": "_subscribe",
"range": [
1954,
1964
],
"loc": {
"start": {
"line": 47,
"column": 22
},
"end": {
"line": 47,
"column": 32
}
}
},
"range": [
1947,
1964
],
"loc": {
"start": {
"line": 47,
"column": 15
},
"end": {
"line": 47,
"column": 32
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "MaterializeSubscriber",
"range": [
1969,
1990
],
"loc": {
"start": {
"line": 47,
"column": 37
},
"end": {
"line": 47,
"column": 58
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "subscriber",
"range": [
1991,
2001
],
"loc": {
"start": {
"line": 47,
"column": 59
},
"end": {
"line": 47,
"column": 69
}
}
}
],
"range": [
1965,
2002
],
"loc": {
"start": {
"line": 47,
"column": 33
},
"end": {
"line": 47,
"column": 70
}
}
}
],
"range": [
1947,
2003
],
"loc": {
"start": {
"line": 47,
"column": 15
},
"end": {
"line": 47,
"column": 71
}
}
},
"range": [
1940,
2004
],
"loc": {
"start": {
"line": 47,
"column": 8
},
"end": {
"line": 47,
"column": 72
}
}
}
],
"range": [
1930,
2010
],
"loc": {
"start": {
"line": 46,
"column": 71
},
"end": {
"line": 48,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
1900,
2010
],
"loc": {
"start": {
"line": 46,
"column": 41
},
"end": {
"line": 48,
"column": 5
}
}
},
"range": [
1863,
2010
],
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 48,
"column": 5
}
}
},
"range": [
1863,
2011
],
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 48,
"column": 6
}
}
},
{
"type": "ReturnStatement",
"argument": {
"type": "Identifier",
"name": "MaterializeOperator",
"range": [
2023,
2042
],
"loc": {
"start": {
"line": 49,
"column": 11
},
"end": {
"line": 49,
"column": 30
}
}
},
"range": [
2016,
2043
],
"loc": {
"start": {
"line": 49,
"column": 4
},
"end": {
"line": 49,
"column": 31
}
}
}
],
"range": [
1814,
2045
],
"loc": {
"start": {
"line": 43,
"column": 39
},
"end": {
"line": 50,
"column": 1
}
}
},
"generator": false,
"expression": false,
"range": [
1802,
2045
],
"loc": {
"start": {
"line": 43,
"column": 27
},
"end": {
"line": 50,
"column": 1
}
}
},
"arguments": [],
"range": [
1802,
2047
],
"loc": {
"start": {
"line": 43,
"column": 27
},
"end": {
"line": 50,
"column": 3
}
}
},
"range": [
1779,
2048
],
"loc": {
"start": {
"line": 43,
"column": 4
},
"end": {
"line": 50,
"column": 4
}
}
}
],
"kind": "var",
"range": [
1775,
2049
],
"loc": {
"start": {
"line": 43,
"column": 0
},
"end": {
"line": 50,
"column": 5
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n ",
"range": [
2050,
2141
],
"loc": {
"start": {
"line": 51,
"column": 0
},
"end": {
"line": 55,
"column": 3
}
}
}
]
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "MaterializeSubscriber",
"range": [
2146,
2167
],
"loc": {
"start": {
"line": 56,
"column": 4
},
"end": {
"line": 56,
"column": 25
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "_super",
"range": [
2181,
2187
],
"loc": {
"start": {
"line": 56,
"column": 39
},
"end": {
"line": 56,
"column": 45
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "__extends",
"range": [
2195,
2204
],
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 13
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "MaterializeSubscriber",
"range": [
2205,
2226
],
"loc": {
"start": {
"line": 57,
"column": 14
},
"end": {
"line": 57,
"column": 35
}
}
},
{
"type": "Identifier",
"name": "_super",
"range": [
2228,
2234
],
"loc": {
"start": {
"line": 57,
"column": 37
},
"end": {
"line": 57,
"column": 43
}
}
}
],
"range": [
2195,
2235
],
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 44
}
}
},
"range": [
2195,
2236
],
"loc": {
"start": {
"line": 57,
"column": 4
},
"end": {
"line": 57,
"column": 45
}
}
},
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "MaterializeSubscriber",
"range": [
2250,
2271
],
"loc": {
"start": {
"line": 58,
"column": 13
},
"end": {
"line": 58,
"column": 34
}
}
},
"params": [
{
"type": "Identifier",
"name": "destination",
"range": [
2272,
2283
],
"loc": {
"start": {
"line": 58,
"column": 35
},
"end": {
"line": 58,
"column": 46
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "_super",
"range": [
2295,
2301
],
"loc": {
"start": {
"line": 59,
"column": 8
},
"end": {
"line": 59,
"column": 14
}
}
},
"property": {
"type": "Identifier",
"name": "call",
"range": [
2302,
2306
],
"loc": {
"start": {
"line": 59,
"column": 15
},
"end": {
"line": 59,
"column": 19
}
}
},
"range": [
2295,
2306
],
"loc": {
"start": {
"line": 59,
"column": 8
},
"end": {
"line": 59,
"column": 19
}
}
},
"arguments": [
{
"type": "ThisExpression",
"range": [
2307,
2311
],
"loc": {
"start": {
"line": 59,
"column": 20
},
"end": {
"line": 59,
"column": 24
}
}
},
{
"type": "Identifier",
"name": "destination",
"range": [
2313,
2324
],
"loc": {
"start": {
"line": 59,
"column": 26
},
"end": {
"line": 59,
"column": 37
}
}
}
],
"range": [
2295,
2325
],
"loc": {
"start": {
"line": 59,
"column": 8
},
"end": {
"line": 59,
"column": 38
}
}
},
"range": [
2295,
2326
],
"loc": {
"start": {
"line": 59,
"column": 8
},
"end": {
"line": 59,
"column": 39
}
}
}
],
"range": [
2285,
2332
],
"loc": {
"start": {
"line": 58,
"column": 48
},
"end": {
"line": 60,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
2241,
2332
],
"loc": {
"start": {
"line": 58,
"column": 4
},
"end": {
"line": 60,
"column": 5
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "MaterializeSubscriber",
"range": [
2337,
2358
],
"loc": {
"start": {
"line": 61,
"column": 4
},
"end": {
"line": 61,
"column": 25
}
}
},
"property": {
"type": "Identifier",
"name": "prototype",
"range": [
2359,
2368
],
"loc": {
"start": {
"line": 61,
"column": 26
},
"end": {
"line": 61,
"column": 35
}
}
},
"range": [
2337,
2368
],
"loc": {
"start": {
"line": 61,
"column": 4
},
"end": {
"line": 61,
"column": 35
}
}
},
"property": {
"type": "Identifier",
"name": "_next",
"range": [
2369,
2374
],
"loc": {
"start": {
"line": 61,
"column": 36
},
"end": {
"line": 61,
"column": 41
}
}
},
"range": [
2337,
2374
],
"loc": {
"start": {
"line": 61,
"column": 4
},
"end": {