@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,326 lines (1,325 loc) • 608 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": "Rx",
"range": [
18,
20
],
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 6
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "require",
"range": [
23,
30
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 16
}
}
},
"arguments": [
{
"type": "Literal",
"value": "../../dist/cjs/Rx",
"raw": "'../../dist/cjs/Rx'",
"range": [
31,
50
],
"loc": {
"start": {
"line": 2,
"column": 17
},
"end": {
"line": 2,
"column": 36
}
}
}
],
"range": [
23,
51
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 37
}
}
},
"range": [
18,
51
],
"loc": {
"start": {
"line": 2,
"column": 4
},
"end": {
"line": 2,
"column": 37
}
}
}
],
"kind": "var",
"range": [
14,
52
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 38
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "Observable",
"range": [
57,
67
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 14
}
}
},
"init": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "Rx",
"range": [
70,
72
],
"loc": {
"start": {
"line": 3,
"column": 17
},
"end": {
"line": 3,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"name": "Observable",
"range": [
73,
83
],
"loc": {
"start": {
"line": 3,
"column": 20
},
"end": {
"line": 3,
"column": 30
}
}
},
"range": [
70,
83
],
"loc": {
"start": {
"line": 3,
"column": 17
},
"end": {
"line": 3,
"column": 30
}
}
},
"range": [
57,
83
],
"loc": {
"start": {
"line": 3,
"column": 4
},
"end": {
"line": 3,
"column": 30
}
}
}
],
"kind": "var",
"range": [
53,
84
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 31
}
},
"trailingComments": [
{
"type": "Block",
"value": "* @test {startWith} ",
"range": [
85,
109
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 24
}
}
}
]
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "describe",
"range": [
110,
118
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 8
}
}
},
"arguments": [
{
"type": "Literal",
"value": "Observable.prototype.startWith",
"raw": "'Observable.prototype.startWith'",
"range": [
119,
151
],
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 41
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "defaultStartValue",
"range": [
175,
192
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 25
}
}
},
"init": {
"type": "Literal",
"value": "x",
"raw": "'x'",
"range": [
195,
198
],
"loc": {
"start": {
"line": 6,
"column": 28
},
"end": {
"line": 6,
"column": 31
}
}
},
"range": [
175,
198
],
"loc": {
"start": {
"line": 6,
"column": 8
},
"end": {
"line": 6,
"column": 31
}
}
}
],
"kind": "var",
"range": [
171,
199
],
"loc": {
"start": {
"line": 6,
"column": 4
},
"end": {
"line": 6,
"column": 32
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "asDiagram",
"range": [
204,
213
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 13
}
}
},
"arguments": [
{
"type": "Literal",
"value": "startWith(s)",
"raw": "'startWith(s)'",
"range": [
214,
228
],
"loc": {
"start": {
"line": 7,
"column": 14
},
"end": {
"line": 7,
"column": 28
}
}
}
],
"range": [
204,
229
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 29
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should prepend to a cold Observable",
"raw": "'should prepend to a cold Observable'",
"range": [
230,
267
],
"loc": {
"start": {
"line": 7,
"column": 30
},
"end": {
"line": 7,
"column": 67
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
295,
297
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "cold",
"range": [
300,
304
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 21
}
}
},
"arguments": [
{
"type": "Literal",
"value": "---a--b--c--|",
"raw": "'---a--b--c--|'",
"range": [
305,
320
],
"loc": {
"start": {
"line": 8,
"column": 22
},
"end": {
"line": 8,
"column": 37
}
}
}
],
"range": [
300,
321
],
"loc": {
"start": {
"line": 8,
"column": 17
},
"end": {
"line": 8,
"column": 38
}
}
},
"range": [
295,
321
],
"loc": {
"start": {
"line": 8,
"column": 12
},
"end": {
"line": 8,
"column": 38
}
}
}
],
"kind": "var",
"range": [
291,
322
],
"loc": {
"start": {
"line": 8,
"column": 8
},
"end": {
"line": 8,
"column": 39
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1subs",
"range": [
335,
341
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 18
}
}
},
"init": {
"type": "Literal",
"value": "^ !",
"raw": "'^ !'",
"range": [
344,
359
],
"loc": {
"start": {
"line": 9,
"column": 21
},
"end": {
"line": 9,
"column": 36
}
}
},
"range": [
335,
359
],
"loc": {
"start": {
"line": 9,
"column": 12
},
"end": {
"line": 9,
"column": 36
}
}
}
],
"kind": "var",
"range": [
331,
360
],
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 37
}
}
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "expected",
"range": [
373,
381
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 20
}
}
},
"init": {
"type": "Literal",
"value": "s--a--b--c--|",
"raw": "'s--a--b--c--|'",
"range": [
384,
399
],
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 10,
"column": 38
}
}
},
"range": [
373,
399
],
"loc": {
"start": {
"line": 10,
"column": 12
},
"end": {
"line": 10,
"column": 38
}
}
}
],
"kind": "var",
"range": [
369,
400
],
"loc": {
"start": {
"line": 10,
"column": 8
},
"end": {
"line": 10,
"column": 39
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectObservable",
"range": [
409,
425
],
"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": [
426,
428
],
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 27
}
}
},
"property": {
"type": "Identifier",
"name": "startWith",
"range": [
429,
438
],
"loc": {
"start": {
"line": 11,
"column": 28
},
"end": {
"line": 11,
"column": 37
}
}
},
"range": [
426,
438
],
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 37
}
}
},
"arguments": [
{
"type": "Literal",
"value": "s",
"raw": "'s'",
"range": [
439,
442
],
"loc": {
"start": {
"line": 11,
"column": 38
},
"end": {
"line": 11,
"column": 41
}
}
}
],
"range": [
426,
443
],
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 42
}
}
}
],
"range": [
409,
444
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 43
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
445,
449
],
"loc": {
"start": {
"line": 11,
"column": 44
},
"end": {
"line": 11,
"column": 48
}
}
},
"range": [
409,
449
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 48
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "expected",
"range": [
450,
458
],
"loc": {
"start": {
"line": 11,
"column": 49
},
"end": {
"line": 11,
"column": 57
}
}
}
],
"range": [
409,
459
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 58
}
}
},
"range": [
409,
460
],
"loc": {
"start": {
"line": 11,
"column": 8
},
"end": {
"line": 11,
"column": 59
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "expectSubscriptions",
"range": [
469,
488
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 27
}
}
},
"arguments": [
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "e1",
"range": [
489,
491
],
"loc": {
"start": {
"line": 12,
"column": 28
},
"end": {
"line": 12,
"column": 30
}
}
},
"property": {
"type": "Identifier",
"name": "subscriptions",
"range": [
492,
505
],
"loc": {
"start": {
"line": 12,
"column": 31
},
"end": {
"line": 12,
"column": 44
}
}
},
"range": [
489,
505
],
"loc": {
"start": {
"line": 12,
"column": 28
},
"end": {
"line": 12,
"column": 44
}
}
}
],
"range": [
469,
506
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 45
}
}
},
"property": {
"type": "Identifier",
"name": "toBe",
"range": [
507,
511
],
"loc": {
"start": {
"line": 12,
"column": 46
},
"end": {
"line": 12,
"column": 50
}
}
},
"range": [
469,
511
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 50
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "e1subs",
"range": [
512,
518
],
"loc": {
"start": {
"line": 12,
"column": 51
},
"end": {
"line": 12,
"column": 57
}
}
}
],
"range": [
469,
519
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 58
}
}
},
"range": [
469,
520
],
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 59
}
}
}
],
"range": [
281,
526
],
"loc": {
"start": {
"line": 7,
"column": 81
},
"end": {
"line": 13,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
269,
526
],
"loc": {
"start": {
"line": 7,
"column": 69
},
"end": {
"line": 13,
"column": 5
}
}
}
],
"range": [
204,
527
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 13,
"column": 6
}
}
},
"range": [
204,
528
],
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 13,
"column": 7
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "it",
"range": [
533,
535
],
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 6
}
}
},
"arguments": [
{
"type": "Literal",
"value": "should start an observable with given value",
"raw": "'should start an observable with given value'",
"range": [
536,
581
],
"loc": {
"start": {
"line": 14,
"column": 7
},
"end": {
"line": 14,
"column": 52
}
}
},
{
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "e1",
"range": [
609,
611
],
"loc": {
"start": {
"line": 15,
"column": 12
},
"end": {
"line": 15,
"column": 14
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "hot",
"range": [
614,
617
],
"loc": {
"start": {
"line": 15,
"column": 17
},
"end": {
"line": 15,
"column": 20
}
}
},
"arguments": [
{
"type": "Literal",
"value": "--a--|",
"raw": "'--a--|'",
"range": [
618,
626
],
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 29
}
}
}
],