@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,415 lines (1,414 loc) • 762 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 {partition} ",
"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.partition",
"raw": "'Observable.prototype.partition'",
"range": [
149,
181
],
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"column": 41
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "expectObservableArray",
"range": [
210,
231
],
"loc": {
"start": {
"line": 7,
"column": 13
},
"end": {
"line": 7,
"column": 34
}
}
},
"params": [
{
"type": "Identifier",
"name": "result",
"range": [
232,
238
],
"loc": {
"start": {
"line": 7,
"column": 35
},
"end": {
"line": 7,
"column": 41
}
}
},
{
"type": "Identifier",
"name": "expected",
"range": [
240,
248
],
"loc": {
"start": {
"line": 7,
"column": 43
},
"end": {
"line": 7,
"column": 51
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ForStatement",
"init": {
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "idx",
"range": [
269,
272
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": 0,
"raw": "0",
"range": [
275,
276
],
"loc": {
"start": {
"line": 8,
"column": 23
},
"end": {
"line": 8,
"column": 24
}
}
},
"range": [
269,
276
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 24
}
}
}
],
"kind": "var",
"range": [
265,
276
],
"loc": {
"start": {
"line": 8,
"column": 13
},
"end": {
"line": 8,
"column": 24
}
}
},
"test": {
"type": "BinaryExpression",
"operator": "<",
"left": {
"type": "Identifier",
"name": "idx",
"range": [
278,
281
],
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 29
}
}
},
"right": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "result",
"range": [
284,
290
],
"loc": {
"start": {
"line": 8,
"column": 32
},
"end": {
"line": 8,
"column": 38
}
}
},
"property": {
"type": "Identifier",
"name": "length",
"range": [
291,
297
],
"loc": {
"start": {
"line": 8,
"column": 39
},
"end": {
"line": 8,
"column": 45
}
}
},
"range": [
284,
297
],
"loc": {
"start": {
"line": 8,
"column": 32
},
"end": {
"line": 8,
"column": 45
}
}
},
"range": [
278,
297
],
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 45
}
}
},
"update": {
"type": "UpdateExpression",
"operator": "++",
"argument": {
"type": "Identifier",
"name": "idx",
"range": [
299,
302
],
"loc": {
"start": {
"line": 8,
"column": 47
},
"end": {
"line": 8,
"column": 50
}
}
},
"prefix": false,
"range": [
299,
304
],
"loc": {
"start": {
"line": 8,
"column": 47
},
"end": {
"line": 8,
"column": 52
}
}
},
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
320,
336
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 28
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": true,
"object": {
"type": "Identifier",
"name": "result",
"range": [
337,
343
],
"loc": {
"start": {
"line": 9,
"column": 29
},
"end": {
"line": 9,
"column": 35
}
}
},
"property": {
"type": "Identifier",
"name": "idx",
"range": [
344,
347
],
"loc": {
"start": {
"line": 9,
"column": 36
},
"end": {
"line": 9,
"column": 39
}
}
},
"range": [
337,
348
],
"loc": {
"start": {
"line": 9,
"column": 29
},
"end": {
"line": 9,
"column": 40
}
}
}
],
"range": [
320,
349
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 41
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
350,
354
],
"loc": {
"start": {
"line": 9,
"column": 42
},
"end": {
"line": 9,
"column": 46
}
}
},
"range": [
320,
354
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 46
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": true,
"object": {
"type": "Identifier",
"name": "expected",
"range": [
355,
363
],
"loc": {
"start": {
"line": 9,
"column": 47
},
"end": {
"line": 9,
"column": 55
}
}
},
"property": {
"type": "Identifier",
"name": "idx",
"range": [
364,
367
],
"loc": {
"start": {
"line": 9,
"column": 56
},
"end": {
"line": 9,
"column": 59
}
}
},
"range": [
355,
368
],
"loc": {
"start": {
"line": 9,
"column": 47
},
"end": {
"line": 9,
"column": 60
}
}
}
],
"range": [
320,
369
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 61
}
}
},
"range": [
320,
370
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 62
}
}
}
],
"range": [
306,
380
],
"loc": {
"start": {
"line": 8,
"column": 54
},
"end": {
"line": 10,
"column": 9
}
}
},
"range": [
260,
380
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 10,
"column": 9
}
}
}
],
"range": [
250,
386
],
"loc": {
"start": {
"line": 7,
"column": 53
},
"end": {
"line": 11,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
201,
386
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 11,
"column": 5
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
391,
400
],
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "partition(x => x % 2 === 1)",
"raw": "'partition(x => x % 2 === 1)'",
"range": [
401,
430
],
"loc": {
"start": {
"line": 12,
"column": 14
},
"end": {
"line": 12,
"column": 43
}
}
}
],
"range": [
391,
431
],
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 44
}
}
},
"arguments": [
{
"type": "BinaryExpression",
"operator": "+",
"left": {
"type": "Literal",
"value": "should partition an observable of ",
"raw": "'should partition an observable of '",
"range": [
432,
468
],
"loc": {
"start": {
"line": 12,
"column": 45
},
"end": {
"line": 12,
"column": 81
}
}
},
"right": {
"type": "Literal",
"value": "integers into even and odd",
"raw": "'integers into even and odd'",
"range": [
479,
507
],
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 36
}
}
},
"range": [
432,
507
],
"loc": {
"start": {
"line": 12,
"column": 45
},
"end": {
"line": 13,
"column": 36
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
535,
537
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "hot",
"range": [
540,
543
],
"loc": {
"start": {
"line": 14,
"column": 17
},
"end": {
"line": 14,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--1-2---3------4--5---6--|",
"raw": "'--1-2---3------4--5---6--|'",
"range": [
544,
572
],
"loc": {
"start": {
"line": 14,
"column": 21
},
"end": {
"line": 14,
"column": 49
}
}
}
],
"range": [
540,
573
],
"loc": {
"start": {
"line": 14,
"column": 17
},
"end": {
"line": 14,
"column": 50
}
}
},
"range": [
535,
573
],
"loc": {
"start": {
"line": 14,
"column": 12
},
"end": {
"line": 14,
"column": 50
}
}
}
],
"kind": "var",
"range": [
531,
574
],
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 14,
"column": 51
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1subs",
"range": [
587,
593
],
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 18
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
596,
624
],
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 49
}
}
},
"range": [
587,
624
],
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 49
}
}
}
],
"kind": "var",
"range": [
583,
625
],
"loc": {
"start": {
"line": 15,
"column": 8
},
"end": {
"line": 15,
"column": 50
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
638,
646
],
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 16,
"column": 20
}
}
},
"init": {
"type": "ArrayExpression",
"elements": [
{
"type": "Literal",
"value": "--1-----3---------5------|",
"raw": "'--1-----3---------5------|'",
"range": [
650,
678
],
"loc": {
"start": {
"line": 16,
"column": 24
},
"end": {
"line": 16,
"column": 52
}
}
},
{
"type": "Literal",
"value": "----2----------4------6--|",
"raw": "'----2----------4------6--|'",
"range": [
692,
720
],
"loc": {
"start": {
"line": 17,
"column": 12
},
"end": {
"line": 17,
"column": 40
}
}
}
],
"range": [
649,
721
],
"loc": {
"start": {
"line": 16,
"column": 23
},
"end": {
"line": 17,
"column": 41
}
}
},
"range": [
638,
721
],
"loc": {
"start": {
"line": 16,
"column": 12
},
"end": {
"line": 17,
"column": 41
}
}
}
],
"kind": "var",
"range": [
634,
722
],
"loc": {
"start": {
"line": 16,
"column": 8
},
"end": {
"line": 17,
"column": 42
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {