@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,539 lines (1,538 loc) • 173 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": "EmptyObservable",
"range": [
53,
68
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 24
}
}
},
"imported": {
"type": "Identifier",
"name": "EmptyObservable",
"range": [
53,
68
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 24
}
}
},
"range": [
53,
68
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 24
}
}
}
],
"source": {
"type": "Literal",
"value": "../observable/EmptyObservable",
"raw": "'../observable/EmptyObservable'",
"range": [
76,
107
],
"loc": {
"start": {
"line": 2,
"column": 32
},
"end": {
"line": 2,
"column": 63
}
}
},
"range": [
44,
108
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 64
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times,\n * on a particular Scheduler.\n *\n * <img src=\"./img/repeat.png\" width=\"100%\">\n *\n * @param {Scheduler} [scheduler] the Scheduler to emit the items on.\n * @param {number} [count] the number of times the source Observable items are repeated, a count of 0 will yield\n * an empty Observable.\n * @return {Observable} an Observable that repeats the stream of items emitted by the source Observable at most\n * count times.\n * @method repeat\n * @owner Observable\n ",
"range": [
109,
683
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 16,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"declaration": {
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "repeat",
"range": [
700,
706
],
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 17,
"column": 22
}
}
},
"params": [
{
"type": "Identifier",
"name": "count",
"range": [
707,
712
],
"loc": {
"start": {
"line": 17,
"column": 23
},
"end": {
"line": 17,
"column": 28
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "===",
"left": {
"type": "Identifier",
"name": "count",
"range": [
724,
729
],
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 13
}
}
},
"right": {
"type": "UnaryExpression",
"operator": "void",
"argument": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
739,
740
],
"loc": {
"start": {
"line": 18,
"column": 23
},
"end": {
"line": 18,
"column": 24
}
}
},
"prefix": true,
"range": [
734,
740
],
"loc": {
"start": {
"line": 18,
"column": 18
},
"end": {
"line": 18,
"column": 24
}
}
},
"range": [
724,
740
],
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 18,
"column": 24
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "Identifier",
"name": "count",
"range": [
744,
749
],
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 33
}
}
},
"right": {
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
753,
754
],
"loc": {
"start": {
"line": 18,
"column": 37
},
"end": {
"line": 18,
"column": 38
}
}
},
"prefix": true,
"range": [
752,
754
],
"loc": {
"start": {
"line": 18,
"column": 36
},
"end": {
"line": 18,
"column": 38
}
}
},
"range": [
744,
754
],
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 38
}
}
},
"range": [
744,
755
],
"loc": {
"start": {
"line": 18,
"column": 28
},
"end": {
"line": 18,
"column": 39
}
}
}
],
"range": [
742,
757
],
"loc": {
"start": {
"line": 18,
"column": 26
},
"end": {
"line": 18,
"column": 41
}
}
},
"alternate": null,
"range": [
720,
757
],
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 41
}
}
},
{
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "===",
"left": {
"type": "Identifier",
"name": "count",
"range": [
766,
771
],
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 13
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
776,
777
],
"loc": {
"start": {
"line": 19,
"column": 18
},
"end": {
"line": 19,
"column": 19
}
}
},
"range": [
766,
777
],
"loc": {
"start": {
"line": 19,
"column": 8
},
"end": {
"line": 19,
"column": 19
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "EmptyObservable",
"range": [
800,
815
],
"loc": {
"start": {
"line": 20,
"column": 19
},
"end": {
"line": 20,
"column": 34
}
}
},
"arguments": [],
"range": [
796,
817
],
"loc": {
"start": {
"line": 20,
"column": 15
},
"end": {
"line": 20,
"column": 36
}
}
},
"range": [
789,
818
],
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 37
}
}
}
],
"range": [
779,
824
],
"loc": {
"start": {
"line": 19,
"column": 21
},
"end": {
"line": 21,
"column": 5
}
}
},
"alternate": {
"type": "IfStatement",
"test": {
"type": "BinaryExpression",
"operator": "<",
"left": {
"type": "Identifier",
"name": "count",
"range": [
838,
843
],
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 18
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
846,
847
],
"loc": {
"start": {
"line": 22,
"column": 21
},
"end": {
"line": 22,
"column": 22
}
}
},
"range": [
838,
847
],
"loc": {
"start": {
"line": 22,
"column": 13
},
"end": {
"line": 22,
"column": 22
}
}
},
"consequent": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
866,
870
],
"loc": {
"start": {
"line": 23,
"column": 15
},
"end": {
"line": 23,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "lift",
"range": [
871,
875
],
"loc": {
"start": {
"line": 23,
"column": 20
},
"end": {
"line": 23,
"column": 24
}
}
},
"range": [
866,
875
],
"loc": {
"start": {
"line": 23,
"column": 15
},
"end": {
"line": 23,
"column": 24
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "RepeatOperator",
"range": [
880,
894
],
"loc": {
"start": {
"line": 23,
"column": 29
},
"end": {
"line": 23,
"column": 43
}
}
},
"arguments": [
{
"type": "UnaryExpression",
"operator": "-",
"argument": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
896,
897
],
"loc": {
"start": {
"line": 23,
"column": 45
},
"end": {
"line": 23,
"column": 46
}
}
},
"prefix": true,
"range": [
895,
897
],
"loc": {
"start": {
"line": 23,
"column": 44
},
"end": {
"line": 23,
"column": 46
}
}
},
{
"type": "ThisExpression",
"range": [
899,
903
],
"loc": {
"start": {
"line": 23,
"column": 48
},
"end": {
"line": 23,
"column": 52
}
}
}
],
"range": [
876,
904
],
"loc": {
"start": {
"line": 23,
"column": 25
},
"end": {
"line": 23,
"column": 53
}
}
}
],
"range": [
866,
905
],
"loc": {
"start": {
"line": 23,
"column": 15
},
"end": {
"line": 23,
"column": 54
}
}
},
"range": [
859,
906
],
"loc": {
"start": {
"line": 23,
"column": 8
},
"end": {
"line": 23,
"column": 55
}
}
}
],
"range": [
849,
912
],
"loc": {
"start": {
"line": 22,
"column": 24
},
"end": {
"line": 24,
"column": 5
}
}
},
"alternate": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
939,
943
],
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 26,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "lift",
"range": [
944,
948
],
"loc": {
"start": {
"line": 26,
"column": 20
},
"end": {
"line": 26,
"column": 24
}
}
},
"range": [
939,
948
],
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 26,
"column": 24
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "RepeatOperator",
"range": [
953,
967
],
"loc": {
"start": {
"line": 26,
"column": 29
},
"end": {
"line": 26,
"column": 43
}
}
},
"arguments": [
{
"type": "BinaryExpression",
"operator": "-",
"left": {
"type": "Identifier",
"name": "count",
"range": [
968,
973
],
"loc": {
"start": {
"line": 26,
"column": 44
},
"end": {
"line": 26,
"column": 49
}
}
},
"right": {
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
976,
977
],
"loc": {
"start": {
"line": 26,
"column": 52
},
"end": {
"line": 26,
"column": 53
}
}
},
"range": [
968,
977
],
"loc": {
"start": {
"line": 26,
"column": 44
},
"end": {
"line": 26,
"column": 53
}
}
},
{
"type": "ThisExpression",
"range": [
979,
983
],
"loc": {
"start": {
"line": 26,
"column": 55
},
"end": {
"line": 26,
"column": 59
}
}
}
],
"range": [
949,
984
],
"loc": {
"start": {
"line": 26,
"column": 25
},
"end": {
"line": 26,
"column": 60
}
}
}
],
"range": [
939,
985
],
"loc": {
"start": {
"line": 26,
"column": 15
},
"end": {
"line": 26,
"column": 61
}
}
},
"range": [
932,
986
],
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 62
}
}
}
],
"range": [
922,
992
],
"loc": {
"start": {
"line": 25,
"column": 9
},
"end": {
"line": 27,
"column": 5
}
}
},
"range": [
834,
992
],
"loc": {
"start": {
"line": 22,
"column": 9
},
"end": {
"line": 27,
"column": 5
}
}
},
"range": [
762,
992
],
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 27,
"column": 5
}
}
}
],
"range": [
714,
994
],
"loc": {
"start": {
"line": 17,
"column": 30
},
"end": {
"line": 28,
"column": 1
}
}
},
"generator": false,
"expression": false,
"range": [
691,
994
],
"loc": {
"start": {
"line": 17,
"column": 7
},
"end": {
"line": 28,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times,\n * on a particular Scheduler.\n *\n * <img src=\"./img/repeat.png\" width=\"100%\">\n *\n * @param {Scheduler} [scheduler] the Scheduler to emit the items on.\n * @param {number} [count] the number of times the source Observable items are repeated, a count of 0 will yield\n * an empty Observable.\n * @return {Observable} an Observable that repeats the stream of items emitted by the source Observable at most\n * count times.\n * @method repeat\n * @owner Observable\n ",
"range": [
109,
683
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 16,
"column": 3
}
}
}
],
"trailingComments": []
},
"specifiers": [],
"source": null,
"range": [
684,
994
],
"loc": {
"start": {
"line": 17,
"column": 0
},
"end": {
"line": 28,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Returns an Observable that repeats the stream of items emitted by the source Observable at most count times,\n * on a particular Scheduler.\n *\n * <img src=\"./img/repeat.png\" width=\"100%\">\n *\n * @param {Scheduler} [scheduler] the Scheduler to emit the items on.\n * @param {number} [count] the number of times the source Observable items are repeated, a count of 0 will yield\n * an empty Observable.\n * @return {Observable} an Observable that repeats the stream of items emitted by the source Observable at most\n * count times.\n * @method repeat\n * @owner Observable\n ",
"range": [
109,
683
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 16,
"column": 3
}
}
}
]
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "RepeatOperator",
"range": [
999,
1013
],
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "RepeatOperator",
"range": [
1044,
1058
],
"loc": {
"start": {
"line": 30,
"column": 13
},
"end": {
"line": 30,
"column": 27
}
}
},
"params": [
{
"type": "Identifier",
"name": "count",
"range": [
1059,
1064
],
"loc": {
"start": {
"line": 30,
"column": 28
},
"end": {
"line": 30,
"column": 33
}
}
},
{
"type": "Identifier",
"name": "source",
"range": [
1066,
1072
],
"loc": {
"start": {
"line": 30,
"column": 35
},
"end": {
"line": 30,
"column": 41
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1084,
1088
],
"loc": {
"start": {
"line": 31,
"column": 8
},
"end": {
"line": 31,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "count",
"range": [
1089,
1094
],
"loc": {
"start": {
"line": 31,
"column": 13
},
"end": {
"line": 31,
"column": 18
}
}
},
"range": [
1084,
1094
],
"loc": {
"start": {
"line": 31,
"column": 8
},
"end": {
"line": 31,
"column": 18
}
}
},
"right": {
"type": "Identifier",
"name": "count",
"range": [
1097,
1102
],
"loc": {
"start": {
"line": 31,
"column": 21
},
"end": {
"line": 31,
"column": 26
}
}
},
"range": [
1084,
1102
],
"loc": {
"start": {
"line": 31,
"column": 8
},
"end": {
"line": 31,
"column": 26
}
}
},
"range": [
1084,
1103
],
"loc": {
"start": {
"line": 31,
"column": 8
},
"end": {
"line": 31,
"column": 27
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
1112,
1116
],
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 32,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "source",
"range": [
1117,
1123
],
"loc": {
"start": {
"line": 32,
"column": 13
},
"end": {
"line": 32,
"column": 19
}
}
},
"range": [
1112,
1123
],
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 32,
"column": 19
}
}
},
"right": {
"type": "Identifier",
"name": "source",
"range": [
1126,
1132
],
"loc": {
"start": {
"line": 32,
"column": 22
},
"end": {
"line": 32,
"column": 28
}
}
},
"range": [
1112,
1132
],
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 32,
"column": 28
}
}
},
"range": [
1112,
1133
],
"loc": {
"start": {
"line": 32,
"column": 8
},
"end": {
"line": 32,
"column": 29
}
}
}
],
"range": [
1074,
1139
],
"loc": {
"start": {
"line": 30,
"column": 43
},
"end": {
"line": 33,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
1035,
1139
],
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 33,
"column": 5
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "RepeatOperator",
"range": [
1144,
1158
],
"loc": {
"start": {
"line": 34,
"column": 4
},
"end": {