@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,452 lines (1,451 loc) • 384 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": "Line",
"value": " function shortcuts",
"range": [
115,
136
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 21
}
}
}
]
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "throwError",
"range": [
141,
151
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 14
}
}
},
"init": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ThrowStatement",
"argument": {
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "Error",
"range": [
178,
183
],
"loc": {
"start": {
"line": 6,
"column": 41
},
"end": {
"line": 6,
"column": 46
}
}
},
"arguments": [],
"range": [
174,
185
],
"loc": {
"start": {
"line": 6,
"column": 37
},
"end": {
"line": 6,
"column": 48
}
}
},
"range": [
168,
186
],
"loc": {
"start": {
"line": 6,
"column": 31
},
"end": {
"line": 6,
"column": 49
}
}
}
],
"range": [
166,
188
],
"loc": {
"start": {
"line": 6,
"column": 29
},
"end": {
"line": 6,
"column": 51
}
}
},
"generator": false,
"expression": false,
"range": [
154,
188
],
"loc": {
"start": {
"line": 6,
"column": 17
},
"end": {
"line": 6,
"column": 51
}
}
},
"range": [
141,
188
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 51
}
}
}
],
"kind": "var",
"range": [
137,
189
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 52
}
},
"leadingComments": [
{
"type": "Line",
"value": " function shortcuts",
"range": [
115,
136
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 21
}
}
}
],
"trailingComments": [
{
"type": "Block",
"value": "* @test {mapTo} ",
"range": [
190,
210
],
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 20
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
211,
219
],
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.mapTo",
"raw": "'Observable.prototype.mapTo'",
"range": [
220,
248
],
"loc": {
"start": {
"line": 8,
"column": 9
},
"end": {
"line": 8,
"column": 37
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
268,
277
],
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "mapTo('a')",
"raw": "'mapTo(\\'a\\')'",
"range": [
278,
292
],
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 28
}
}
}
],
"range": [
268,
293
],
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 29
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should map multiple values",
"raw": "'should map multiple values'",
"range": [
294,
322
],
"loc": {
"start": {
"line": 9,
"column": 30
},
"end": {
"line": 9,
"column": 58
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "a",
"range": [
350,
351
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 13
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
354,
358
],
"loc": {
"start": {
"line": 10,
"column": 16
},
"end": {
"line": 10,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--1--2--3--|",
"raw": "'--1--2--3--|'",
"range": [
359,
373
],
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 35
}
}
}
],
"range": [
354,
374
],
"loc": {
"start": {
"line": 10,
"column": 16
},
"end": {
"line": 10,
"column": 36
}
}
},
"range": [
350,
374
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 36
}
}
}
],
"kind": "var",
"range": [
346,
375
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 37
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "asubs",
"range": [
388,
393
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 17
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
396,
410
],
"loc": {
"start": {
"line": 11,
"column": 20
},
"end": {
"line": 11,
"column": 34
}
}
},
"range": [
388,
410
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 34
}
}
}
],
"kind": "var",
"range": [
384,
411
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 35
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
424,
432
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "--a--a--a--|",
"raw": "'--a--a--a--|'",
"range": [
435,
449
],
"loc": {
"start": {
"line": 12,
"column": 23
},
"end": {
"line": 12,
"column": 37
}
}
},
"range": [
424,
449
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 37
}
}
}
],
"kind": "var",
"range": [
420,
450
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 38
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
459,
475
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 24
}
}
},
"arguments": [
{
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "a",
"range": [
476,
477
],
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 13,
"column": 26
}
}
},
"property": {
"type": "Identifier",
"name": "mapTo",
"range": [
478,
483
],
"loc": {
"start": {
"line": 13,
"column": 27
},
"end": {
"line": 13,
"column": 32
}
}
},
"range": [
476,
483
],
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 13,
"column": 32
}
}
},
"arguments": [
{
"type": "Literal",
"value": "a",
"raw": "'a'",
"range": [
484,
487
],
"loc": {
"start": {
"line": 13,
"column": 33
},
"end": {
"line": 13,
"column": 36
}
}
}
],
"range": [
476,
488
],
"loc": {
"start": {
"line": 13,
"column": 25
},
"end": {
"line": 13,
"column": 37
}
}
}
],
"range": [
459,
489
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 38
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
490,
494
],
"loc": {
"start": {
"line": 13,
"column": 39
},
"end": {
"line": 13,
"column": 43
}
}
},
"range": [
459,
494
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 43
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "expected",
"range": [
495,
503
],
"loc": {
"start": {
"line": 13,
"column": 44
},
"end": {
"line": 13,
"column": 52
}
}
}
],
"range": [
459,
504
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 53
}
}
},
"range": [
459,
505
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 54
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectSubscriptions",
"range": [
514,
533
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 27
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "a",
"range": [
534,
535
],
"loc": {
"start": {
"line": 14,
"column": 28
},
"end": {
"line": 14,
"column": 29
}
}
},
"property": {
"type": "Identifier",
"name": "subscriptions",
"range": [
536,
549
],
"loc": {
"start": {
"line": 14,
"column": 30
},
"end": {
"line": 14,
"column": 43
}
}
},
"range": [
534,
549
],
"loc": {
"start": {
"line": 14,
"column": 28
},
"end": {
"line": 14,
"column": 43
}
}
}
],
"range": [
514,
550
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 44
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
551,
555
],
"loc": {
"start": {
"line": 14,
"column": 45
},
"end": {
"line": 14,
"column": 49
}
}
},
"range": [
514,
555
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 49
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "asubs",
"range": [
556,
561
],
"loc": {
"start": {
"line": 14,
"column": 50
},
"end": {
"line": 14,
"column": 55
}
}
}
],
"range": [
514,
562
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 56
}
}
},
"range": [
514,
563
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 57
}
}
}
],
"range": [
336,
569
],
"loc": {
"start": {
"line": 9,
"column": 72
},
"end": {
"line": 15,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
324,
569
],
"loc": {
"start": {
"line": 9,
"column": 60
},
"end": {
"line": 15,
"column": 5
}
}
}
],
"range": [
268,
570
],
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 15,
"column": 6
}
}
},
"range": [
268,
571
],
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 15,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
576,
578
],
"loc": {
"start": {
"line": 16,