@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,360 lines (1,359 loc) • 632 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": "Rx",
"range": [
48,
50
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 6
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
53,
60
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 16
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../../dist/cjs/Rx",
"raw": "'../../dist/cjs/Rx'",
"range": [
61,
80
],
"loc": {
"start": {
"line": 3,
"column": 17
},
"end": {
"line": 3,
"column": 36
}
}
}
],
"range": [
53,
81
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 37
}
}
},
"range": [
48,
81
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 37
}
}
}
],
"kind": "var",
"range": [
44,
82
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 38
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Observable",
"range": [
87,
97
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 14
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Rx",
"range": [
100,
102
],
"loc": {
"start": {
"line": 4,
"column": 17
},
"end": {
"line": 4,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "Observable",
"range": [
103,
113
],
"loc": {
"start": {
"line": 4,
"column": 20
},
"end": {
"line": 4,
"column": 30
}
}
},
"range": [
100,
113
],
"loc": {
"start": {
"line": 4,
"column": 17
},
"end": {
"line": 4,
"column": 30
}
}
},
"range": [
87,
113
],
"loc": {
"start": {
"line": 4,
"column": 4
},
"end": {
"line": 4,
"column": 30
}
}
}
],
"kind": "var",
"range": [
83,
114
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 31
}
},
"trailingComments": [
{
"type": "Block",
"value": "* @test {takeLast} ",
"range": [
115,
138
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 23
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
139,
147
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.takeLast",
"raw": "'Observable.prototype.takeLast'",
"range": [
148,
179
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"column": 40
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
199,
208
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "takeLast(2)",
"raw": "'takeLast(2)'",
"range": [
209,
222
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 27
}
}
}
],
"range": [
199,
223
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 28
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should take two values of an observable with many values",
"raw": "'should take two values of an observable with many values'",
"range": [
224,
282
],
"loc": {
"start": {
"line": 7,
"column": 29
},
"end": {
"line": 7,
"column": 87
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
310,
312
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
315,
319
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 21
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--a-----b----c---d--| ",
"raw": "'--a-----b----c---d--| '",
"range": [
320,
347
],
"loc": {
"start": {
"line": 8,
"column": 22
},
"end": {
"line": 8,
"column": 49
}
}
}
],
"range": [
315,
348
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 50
}
}
},
"range": [
310,
348
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 50
}
}
}
],
"kind": "var",
"range": [
306,
349
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 51
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1subs",
"range": [
362,
368
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 18
}
}
},
"init": {
"type": "Literal",
"value": "^ ! ",
"raw": "'^ ! '",
"range": [
371,
398
],
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 48
}
}
},
"range": [
362,
398
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 48
}
}
}
],
"kind": "var",
"range": [
358,
399
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 49
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
412,
420
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "--------------------(cd|)",
"raw": "'--------------------(cd|)'",
"range": [
423,
450
],
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 50
}
}
},
"range": [
412,
450
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 50
}
}
}
],
"kind": "var",
"range": [
408,
451
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 51
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
460,
476
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 24
}
}
},
"arguments": [
{
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
477,
479
],
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 27
}
}
},
"property": {
"type": "Identifier",
"name": "takeLast",
"range": [
480,
488
],
"loc": {
"start": {
"line": 11,
"column": 28
},
"end": {
"line": 11,
"column": 36
}
}
},
"range": [
477,
488
],
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 36
}
}
},
"arguments": [
{
"type": "Literal",
"value": 2,
"raw": "2",
"range": [
489,
490
],
"loc": {
"start": {
"line": 11,
"column": 37
},
"end": {
"line": 11,
"column": 38
}
}
}
],
"range": [
477,
491
],
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 39
}
}
}
],
"range": [
460,
492
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 40
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
493,
497
],
"loc": {
"start": {
"line": 11,
"column": 41
},
"end": {
"line": 11,
"column": 45
}
}
},
"range": [
460,
497
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 45
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "expected",
"range": [
498,
506
],
"loc": {
"start": {
"line": 11,
"column": 46
},
"end": {
"line": 11,
"column": 54
}
}
}
],
"range": [
460,
507
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 55
}
}
},
"range": [
460,
508
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 56
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectSubscriptions",
"range": [
517,
536
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 27
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
537,
539
],
"loc": {
"start": {
"line": 12,
"column": 28
},
"end": {
"line": 12,
"column": 30
}
}
},
"property": {
"type": "Identifier",
"name": "subscriptions",
"range": [
540,
553
],
"loc": {
"start": {
"line": 12,
"column": 31
},
"end": {
"line": 12,
"column": 44
}
}
},
"range": [
537,
553
],
"loc": {
"start": {
"line": 12,
"column": 28
},
"end": {
"line": 12,
"column": 44
}
}
}
],
"range": [
517,
554
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 45
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
555,
559
],
"loc": {
"start": {
"line": 12,
"column": 46
},
"end": {
"line": 12,
"column": 50
}
}
},
"range": [
517,
559
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 50
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "e1subs",
"range": [
560,
566
],
"loc": {
"start": {
"line": 12,
"column": 51
},
"end": {
"line": 12,
"column": 57
}
}
}
],
"range": [
517,
567
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 58
}
}
},
"range": [
517,
568
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 59
}
}
}
],
"range": [
296,
574
],
"loc": {
"start": {
"line": 7,
"column": 101
},
"end": {
"line": 13,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
284,
574
],
"loc": {
"start": {
"line": 7,
"column": 89
},
"end": {
"line": 13,
"column": 5
}
}
}
],
"range": [
199,
575
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 13,
"column": 6
}
}
},
"range": [
199,
576
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 13,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
581,
583
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should take last three values",
"raw": "'should take last three values'",
"range": [
584,
615
],
"loc": {
"start": {
"line": 14,
"column": 7
},
"end": {
"line": 14,
"column": 38
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
643,
645
],
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
648,
652
],
"loc": {
"start": {
"line": 15,
"column": 17
},
"end": {
"line": 15,
"column": 21
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--a-----b----c---d--| ",
"raw": "'--a-----b----c---d--| '",
"range": [
653,
680
],
"loc": {
"start": {
"line": 15,
"column": 22
},
"end": {
"line": 15,
"column": 49
}