@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,308 lines (1,307 loc) • 1.78 MB
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 {switchMap} ",
"range": [
115,
139
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 24
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
140,
148
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.switchMap",
"raw": "'Observable.prototype.switchMap'",
"range": [
149,
181
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"column": 41
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
201,
210
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "switchMap(i => 10*i——10*i——10*i—| )",
"raw": "'switchMap(i => 10*i\\u2014\\u201410*i\\u2014\\u201410*i\\u2014| )'",
"range": [
211,
273
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 76
}
}
}
],
"range": [
201,
274
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 77
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should map-and-flatten each item to an Observable",
"raw": "'should map-and-flatten each item to an Observable'",
"range": [
275,
326
],
"loc": {
"start": {
"line": 7,
"column": 78
},
"end": {
"line": 7,
"column": 129
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
354,
356
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "hot",
"range": [
359,
362
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--1-----3--5-------|",
"raw": "'--1-----3--5-------|'",
"range": [
363,
385
],
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 8,
"column": 43
}
}
}
],
"range": [
359,
386
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 44
}
}
},
"range": [
354,
386
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 44
}
}
}
],
"kind": "var",
"range": [
350,
387
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 45
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1subs",
"range": [
400,
406
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 18
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
409,
431
],
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 43
}
}
},
"range": [
400,
431
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 43
}
}
}
],
"kind": "var",
"range": [
396,
432
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 44
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e2",
"range": [
445,
447
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
450,
454
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 21
}
}
},
"arguments": [
{
"type": "Literal",
"value": "x-x-x| ",
"raw": "'x-x-x| '",
"range": [
455,
477
],
"loc": {
"start": {
"line": 10,
"column": 22
},
"end": {
"line": 10,
"column": 44
}
}
},
{
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "x",
"range": [
481,
482
],
"loc": {
"start": {
"line": 10,
"column": 48
},
"end": {
"line": 10,
"column": 49
}
}
},
"value": {
"type": "Literal",
"value": 10,
"raw": "10",
"range": [
484,
486
],
"loc": {
"start": {
"line": 10,
"column": 51
},
"end": {
"line": 10,
"column": 53
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
481,
486
],
"loc": {
"start": {
"line": 10,
"column": 48
},
"end": {
"line": 10,
"column": 53
}
}
}
],
"range": [
479,
488
],
"loc": {
"start": {
"line": 10,
"column": 46
},
"end": {
"line": 10,
"column": 55
}
}
}
],
"range": [
450,
489
],
"loc": {
"start": {
"line": 10,
"column": 17
},
"end": {
"line": 10,
"column": 56
}
}
},
"range": [
445,
489
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 56
}
}
}
],
"kind": "var",
"range": [
441,
490
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 57
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
503,
511
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "--x-x-x-y-yz-z-z---|",
"raw": "'--x-x-x-y-yz-z-z---|'",
"range": [
514,
536
],
"loc": {
"start": {
"line": 11,
"column": 23
},
"end": {
"line": 11,
"column": 45
}
}
},
"range": [
503,
536
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 45
}
}
}
],
"kind": "var",
"range": [
499,
537
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 46
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "values",
"range": [
550,
556
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 18
}
}
},
"init": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "x",
"range": [
561,
562
],
"loc": {
"start": {
"line": 12,
"column": 23
},
"end": {
"line": 12,
"column": 24
}
}
},
"value": {
"type": "Literal",
"value": 10,
"raw": "10",
"range": [
564,
566
],
"loc": {
"start": {
"line": 12,
"column": 26
},
"end": {
"line": 12,
"column": 28
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
561,
566
],
"loc": {
"start": {
"line": 12,
"column": 23
},
"end": {
"line": 12,
"column": 28
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "y",
"range": [
568,
569
],
"loc": {
"start": {
"line": 12,
"column": 30
},
"end": {
"line": 12,
"column": 31
}
}
},
"value": {
"type": "Literal",
"value": 30,
"raw": "30",
"range": [
571,
573
],
"loc": {
"start": {
"line": 12,
"column": 33
},
"end": {
"line": 12,
"column": 35
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
568,
573
],
"loc": {
"start": {
"line": 12,
"column": 30
},
"end": {
"line": 12,
"column": 35
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "z",
"range": [
575,
576
],
"loc": {
"start": {
"line": 12,
"column": 37
},
"end": {
"line": 12,
"column": 38
}
}
},
"value": {
"type": "Literal",
"value": 50,
"raw": "50",
"range": [
578,
580
],
"loc": {
"start": {
"line": 12,
"column": 40
},
"end": {
"line": 12,
"column": 42
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
575,
580
],
"loc": {
"start": {
"line": 12,
"column": 37
},
"end": {
"line": 12,
"column": 42
}
}
}
],
"range": [
559,
582
],
"loc": {
"start": {
"line": 12,
"column": 21
},
"end": {
"line": 12,
"column": 44
}
}
},
"range": [
550,
582
],
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 44
}
}
}
],
"kind": "var",
"range": [
546,
583
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 45
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "result",
"range": [
596,
602
],
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
605,
607
],
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "switchMap",
"range": [
608,
617
],
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 33
}
}
},
"range": [
605,
617
],
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 33
}
}
},
"arguments": [
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",