@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,235 lines (1,234 loc) • 883 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 {pluck} ",
"range": [
115,
135
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 20
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
136,
144
],
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.pluck",
"raw": "'Observable.prototype.pluck'",
"range": [
145,
173
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"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": [
193,
202
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "pluck('v')",
"raw": "'pluck(\\'v\\')'",
"range": [
203,
217
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 28
}
}
}
],
"range": [
193,
218
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 29
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should dematerialize an Observable",
"raw": "'should dematerialize an Observable'",
"range": [
219,
255
],
"loc": {
"start": {
"line": 7,
"column": 30
},
"end": {
"line": 7,
"column": 66
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "values",
"range": [
283,
289
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 18
}
}
},
"init": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "a",
"range": [
306,
307
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 13
}
}
},
"value": {
"type": "Literal",
"value": "{v:1}",
"raw": "'{v:1}'",
"range": [
309,
316
],
"loc": {
"start": {
"line": 9,
"column": 15
},
"end": {
"line": 9,
"column": 22
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
306,
316
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 22
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "b",
"range": [
330,
331
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 13
}
}
},
"value": {
"type": "Literal",
"value": "{v:2}",
"raw": "'{v:2}'",
"range": [
333,
340
],
"loc": {
"start": {
"line": 10,
"column": 15
},
"end": {
"line": 10,
"column": 22
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
330,
340
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 22
}
}
},
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "c",
"range": [
354,
355
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 13
}
}
},
"value": {
"type": "Literal",
"value": "{v:3}",
"raw": "'{v:3}'",
"range": [
357,
364
],
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 22
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
354,
364
],
"loc": {
"start": {
"line": 11,
"column": 12
},
"end": {
"line": 11,
"column": 22
}
}
}
],
"range": [
292,
374
],
"loc": {
"start": {
"line": 8,
"column": 21
},
"end": {
"line": 12,
"column": 9
}
}
},
"range": [
283,
374
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 12,
"column": 9
}
}
}
],
"kind": "var",
"range": [
279,
375
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 12,
"column": 10
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
388,
390
],
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
393,
397
],
"loc": {
"start": {
"line": 13,
"column": 17
},
"end": {
"line": 13,
"column": 21
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--a--b--c--|",
"raw": "'--a--b--c--|'",
"range": [
398,
412
],
"loc": {
"start": {
"line": 13,
"column": 22
},
"end": {
"line": 13,
"column": 36
}
}
},
{
"type": "Identifier",
"name": "values",
"range": [
414,
420
],
"loc": {
"start": {
"line": 13,
"column": 38
},
"end": {
"line": 13,
"column": 44
}
}
}
],
"range": [
393,
421
],
"loc": {
"start": {
"line": 13,
"column": 17
},
"end": {
"line": 13,
"column": 45
}
}
},
"range": [
388,
421
],
"loc": {
"start": {
"line": 13,
"column": 12
},
"end": {
"line": 13,
"column": 45
}
}
}
],
"kind": "var",
"range": [
384,
422
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 46
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
435,
443
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "--x--y--z--|",
"raw": "'--x--y--z--|'",
"range": [
446,
460
],
"loc": {
"start": {
"line": 14,
"column": 23
},
"end": {
"line": 14,
"column": 37
}
}
},
"range": [
435,
460
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 37
}
}
}
],
"kind": "var",
"range": [
431,
461
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 38
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "result",
"range": [
474,
480
],
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 18
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
483,
485
],
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"name": "map",
"range": [
486,
489
],
"loc": {
"start": {
"line": 15,
"column": 24
},
"end": {
"line": 15,
"column": 27
}
}
},
"range": [
483,
489
],
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 27
}
}
},
"arguments": [
{
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "x",
"range": [
500,
501
],
"loc": {
"start": {
"line": 15,
"column": 38
},
"end": {
"line": 15,
"column": 39
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "ObjectExpression",
"properties": [
{
"type": "Property",
"key": {
"type": "Identifier",
"name": "v",
"range": [
515,
516
],
"loc": {
"start": {
"line": 15,
"column": 53
},
"end": {
"line": 15,
"column": 54
}
}
},
"value": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "x",
"range": [
518,
519
],
"loc": {
"start": {
"line": 15,
"column": 56
},
"end": {
"line": 15,
"column": 57
}
}
},
"property": {
"type": "Identifier",
"name": "charAt",
"range": [
520,
526
],
"loc": {
"start": {
"line": 15,
"column": 58
},
"end": {
"line": 15,
"column": 64
}
}
},
"range": [
518,
526
],
"loc": {
"start": {
"line": 15,
"column": 56
},
"end": {
"line": 15,
"column": 64
}
}
},
"arguments": [
{
"type": "Literal",
"value": 3,
"raw": "3",
"range": [
527,
528
],
"loc": {
"start": {
"line": 15,
"column": 65
},
"end": {
"line": 15,
"column": 66
}
}
}
],
"range": [
518,
529
],
"loc": {
"start": {
"line": 15,
"column": 56
},
"end": {
"line": 15,
"column": 67
}
}
},
"kind": "init",
"method": false,
"shorthand": false,
"computed": false,
"range": [
515,
529
],
"loc": {
"start": {
"line": 15,
"column": 53
},
"end": {
"line": 15,
"column": 67
}
}
}
],
"range": [
513,
531
],
"loc": {
"start": {
"line": 15,
"column": 51
},