@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,396 lines (1,395 loc) • 569 kB
JSON
{
"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": "sinon",
"range": [
48,
53
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 9
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
56,
63
],
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 19
}
}
},
"arguments": [
{
"type": "Literal",
"value": "sinon",
"raw": "'sinon'",
"range": [
64,
71
],
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 27
}
}
}
],
"range": [
56,
72
],
"loc": {
"start": {
"line": 3,
"column": 12
},
"end": {
"line": 3,
"column": 28
}
}
},
"range": [
48,
72
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 28
}
}
}
],
"kind": "var",
"range": [
44,
73
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 29
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Rx",
"range": [
78,
80
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 6
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
83,
90
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 16
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../../dist/cjs/Rx",
"raw": "'../../dist/cjs/Rx'",
"range": [
91,
110
],
"loc": {
"start": {
"line": 4,
"column": 17
},
"end": {
"line": 4,
"column": 36
}
}
}
],
"range": [
83,
111
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 37
}
}
},
"range": [
78,
111
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 37
}
}
}
],
"kind": "var",
"range": [
74,
112
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 38
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "RangeObservable_1",
"range": [
117,
134
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 21
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
137,
144
],
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 5,
"column": 31
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../../dist/cjs/observable/RangeObservable",
"raw": "'../../dist/cjs/observable/RangeObservable'",
"range": [
145,
188
],
"loc": {
"start": {
"line": 5,
"column": 32
},
"end": {
"line": 5,
"column": 75
}
}
}
],
"range": [
137,
189
],
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 5,
"column": 76
}
}
},
"range": [
117,
189
],
"loc": {
"start": {
"line": 5,
"column": 4
},
"end": {
"line": 5,
"column": 76
}
}
}
],
"kind": "var",
"range": [
113,
190
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 77
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Observable",
"range": [
195,
205
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 14
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Rx",
"range": [
208,
210
],
"loc": {
"start": {
"line": 6,
"column": 17
},
"end": {
"line": 6,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "Observable",
"range": [
211,
221
],
"loc": {
"start": {
"line": 6,
"column": 20
},
"end": {
"line": 6,
"column": 30
}
}
},
"range": [
208,
221
],
"loc": {
"start": {
"line": 6,
"column": 17
},
"end": {
"line": 6,
"column": 30
}
}
},
"range": [
195,
221
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 30
}
}
}
],
"kind": "var",
"range": [
191,
222
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 31
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "asap",
"range": [
227,
231
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 8
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Rx",
"range": [
234,
236
],
"loc": {
"start": {
"line": 7,
"column": 11
},
"end": {
"line": 7,
"column": 13
}
}
},
"property": {
"type": "Identifier",
"name": "Scheduler",
"range": [
237,
246
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 23
}
}
},
"range": [
234,
246
],
"loc": {
"start": {
"line": 7,
"column": 11
},
"end": {
"line": 7,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "asap",
"range": [
247,
251
],
"loc": {
"start": {
"line": 7,
"column": 24
},
"end": {
"line": 7,
"column": 28
}
}
},
"range": [
234,
251
],
"loc": {
"start": {
"line": 7,
"column": 11
},
"end": {
"line": 7,
"column": 28
}
}
},
"range": [
227,
251
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 28
}
}
}
],
"kind": "var",
"range": [
223,
252
],
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 29
}
},
"trailingComments": [
{
"type": "Block",
"value": "* @test {range} ",
"range": [
253,
273
],
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 20
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
274,
282
],
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.range",
"raw": "'Observable.range'",
"range": [
283,
301
],
"loc": {
"start": {
"line": 9,
"column": 9
},
"end": {
"line": 9,
"column": 27
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
321,
330
],
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "range(1, 10)",
"raw": "'range(1, 10)'",
"range": [
331,
345
],
"loc": {
"start": {
"line": 10,
"column": 14
},
"end": {
"line": 10,
"column": 28
}
}
}
],
"range": [
321,
346
],
"loc": {
"start": {
"line": 10,
"column": 4
},
"end": {
"line": 10,
"column": 29
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should create an observable with numbers 1 to 10",
"raw": "'should create an observable with numbers 1 to 10'",
"range": [
347,
397
],
"loc": {
"start": {
"line": 10,
"column": 30
},
"end": {
"line": 10,
"column": 80
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
425,
427
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Observable",
"range": [
430,
440
],
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 11,
"column": 27
}
}
},
"property": {
"type": "Identifier",
"name": "range",
"range": [
441,
446
],
"loc": {
"start": {
"line": 11,
"column": 28
},
"end": {
"line": 11,
"column": 33
}
}
},
"range": [
430,
446
],
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 11,
"column": 33
}
}
},
"arguments": [
{
"type": "Literal",
"value": 1,
"raw": "1",
"range": [
447,
448
],
"loc": {
"start": {
"line": 11,
"column": 34
},
"end": {
"line": 11,
"column": 35
}
}
},
{
"type": "Literal",
"value": 10,
"raw": "10",
"range": [
450,
452
],
"loc": {
"start": {
"line": 11,
"column": 37
},
"end": {
"line": 11,
"column": 39
}
}
}
],
"range": [
430,
453
],
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 11,
"column": 40
}
}
},
"property": {
"type": "Identifier",
"name": "concatMap",
"range": [
467,
476
],
"loc": {
"start": {
"line": 12,
"column": 13
},
"end": {
"line": 12,
"column": 22
}
}
},
"range": [
430,
476
],
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 12,
"column": 22
}
}
},
"arguments": [
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
487,
488
],
"loc": {
"start": {
"line": 12,
"column": 33
},
"end": {
"line": 12,
"column": 34
}
}
},
{
"type": "Identifier",
"name": "i",
"range": [
490,
491
],
"loc": {
"start": {
"line": 12,
"column": 36
},
"end": {
"line": 12,
"column": 37
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Observable",
"range": [
502,
512
],
"loc": {
"start": {
"line": 12,
"column": 48
},
"end": {
"line": 12,
"column": 58
}
}
},
"property": {
"type": "Identifier",
"name": "of",
"range": [
513,
515
],
"loc": {
"start": {
"line": 12,
"column": 59
},
"end": {
"line": 12,
"column": 61
}
}
},
"range": [
502,
515
],
"loc": {
"start": {
"line": 12,
"column": 48
},
"end": {
"line": 12,
"column": 61
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "x",
"range": [
516,
517
],
"loc": {
"start": {
"line": 12,
"column": 62
},
"end": {
"line": 12,
"column": 63
}
}
}
],
"range": [
502,
518
],
"loc": {
"start": {
"line": 12,
"column": 48
},
"end": {
"line": 12,
"column": 64
}
}
},
"property": {
"type": "Identifier",
"name": "delay",
"range": [
519,
524
],
"loc": {
"start": {
"line": 12,
"column": 65
},
"end": {
"line": 12,
"column": 70
}
}
},
"range": [
502,
524
],
"loc": {
"start": {
"line": 12,
"column": 48
},
"end": {
"line": 12,
"column": 70
}
}
},
"arguments": [
{
"type": "ConditionalExpression",
"test": {
"type": "BinaryExpression",
"operator": "===",
"left": {
"type": "Identifier",
"name": "i",
"range": [
525,
526
],
"loc": {
"start": {
"line": 12,
"column": 71
},
"end": {
"line": 12,
"column": 72
}
}
},
"right": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
531,
532
],
"loc": {
"start": {
"line": 12,
"column": 77
},
"end": {
"line": 12,
"column": 78
}
}
},
"range": [
525,
532
],
"loc": {
"start": {
"line": 12,
"column": 71
},
"end": {
"line": 12,
"column": 78
}
}
},
"consequent": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
535,
536
],
"loc": {
"start": {
"line": 12,
"column": 81
},
"end": {
"line": 12,
"column": 82
}
}
},
"alternate": {
"type": "Literal",
"value": 20,
"raw": "20",
"range": [
539,
541
],
"loc": {
"start": {
"line": 12,
"column": 85
},
"end": {
"line": 12,
"column": 87
}
}
},
"range": [
525,
541
],
"loc": {
"start": {
"line": 12,
"column": 71
},
"end": {
"line": 12,
"column": 87
}
}
},
{
"type": "Identifier",
"name": "rxTestScheduler",
"range": [
543,
558
],
"loc": {
"start": {
"line": 12,
"column": 89
},
"end": {
"line": 12,
"column": 104
}
}
}
],
"range": [
502,
559
],
"loc": {
"start": {
"line": 12,
"column": 48
},
"end": {
"line": 12,
"column": 105
}
}
},
"range": [
495,
560
],
"loc": {
"start": {
"line": 12,
"column": 41
},