@reactivex/rxjs
Version:
Reactive Extensions for modern JavaScript
1,492 lines (1,491 loc) • 218 kB
JSON
{
"type": "Program",
"body": [
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "tryCatch",
"range": [
9,
17
],
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 17
}
}
},
"imported": {
"type": "Identifier",
"name": "tryCatch",
"range": [
9,
17
],
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 17
}
}
},
"range": [
9,
17
],
"loc": {
"start": {
"line": 1,
"column": 9
},
"end": {
"line": 1,
"column": 17
}
}
}
],
"source": {
"type": "Literal",
"value": "../util/tryCatch",
"raw": "'../util/tryCatch'",
"range": [
25,
43
],
"loc": {
"start": {
"line": 1,
"column": 25
},
"end": {
"line": 1,
"column": 43
}
}
},
"range": [
0,
44
],
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 44
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "errorObject",
"range": [
54,
65
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 20
}
}
},
"imported": {
"type": "Identifier",
"name": "errorObject",
"range": [
54,
65
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 20
}
}
},
"range": [
54,
65
],
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 20
}
}
}
],
"source": {
"type": "Literal",
"value": "../util/errorObject",
"raw": "'../util/errorObject'",
"range": [
73,
94
],
"loc": {
"start": {
"line": 2,
"column": 28
},
"end": {
"line": 2,
"column": 49
}
}
},
"range": [
45,
95
],
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 50
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "OuterSubscriber",
"range": [
105,
120
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 24
}
}
},
"imported": {
"type": "Identifier",
"name": "OuterSubscriber",
"range": [
105,
120
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 24
}
}
},
"range": [
105,
120
],
"loc": {
"start": {
"line": 3,
"column": 9
},
"end": {
"line": 3,
"column": 24
}
}
}
],
"source": {
"type": "Literal",
"value": "../OuterSubscriber",
"raw": "'../OuterSubscriber'",
"range": [
128,
148
],
"loc": {
"start": {
"line": 3,
"column": 32
},
"end": {
"line": 3,
"column": 52
}
}
},
"range": [
96,
149
],
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 53
}
}
},
{
"type": "ImportDeclaration",
"specifiers": [
{
"type": "ImportSpecifier",
"local": {
"type": "Identifier",
"name": "subscribeToResult",
"range": [
159,
176
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 26
}
}
},
"imported": {
"type": "Identifier",
"name": "subscribeToResult",
"range": [
159,
176
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 26
}
}
},
"range": [
159,
176
],
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 26
}
}
}
],
"source": {
"type": "Literal",
"value": "../util/subscribeToResult",
"raw": "'../util/subscribeToResult'",
"range": [
184,
211
],
"loc": {
"start": {
"line": 4,
"column": 34
},
"end": {
"line": 4,
"column": 61
}
}
},
"range": [
150,
212
],
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 62
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * Ignores source values for a duration determined by another Observable, then\n * emits the most recent value from the source Observable, then repeats this\n * process.\n *\n * <span class=\"informal\">It's like {@link auditTime}, but the silencing\n * duration is determined by a second Observable.</span>\n *\n * <img src=\"./img/audit.png\" width=\"100%\">\n *\n * `audit` is similar to `throttle`, but emits the last value from the silenced\n * time window, instead of the first value. `audit` emits the most recent value\n * from the source Observable on the output Observable as soon as its internal\n * timer becomes disabled, and ignores source values while the timer is enabled.\n * Initially, the timer is disabled. As soon as the first source value arrives,\n * the timer is enabled by calling the `durationSelector` function with the\n * source value, which returns the \"duration\" Observable. When the duration\n * Observable emits a value or completes, the timer is disabled, then the most\n * recent source value is emitted on the output Observable, and this process\n * repeats for the next source value.\n *\n * @example <caption>Emit clicks at a rate of at most one click per second</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.audit(ev => Rx.Observable.interval(1000));\n * result.subscribe(x => console.log(x));\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttle}\n *\n * @param {function(value: T): Observable|Promise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration, returned as an Observable or a Promise.\n * @return {Observable<T>} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method audit\n * @owner Observable\n ",
"range": [
213,
2068
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 44,
"column": 3
}
}
}
]
},
{
"type": "ExportNamedDeclaration",
"declaration": {
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "audit",
"range": [
2085,
2090
],
"loc": {
"start": {
"line": 45,
"column": 16
},
"end": {
"line": 45,
"column": 21
}
}
},
"params": [
{
"type": "Identifier",
"name": "durationSelector",
"range": [
2091,
2107
],
"loc": {
"start": {
"line": 45,
"column": 22
},
"end": {
"line": 45,
"column": 38
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
2122,
2126
],
"loc": {
"start": {
"line": 46,
"column": 11
},
"end": {
"line": 46,
"column": 15
}
}
},
"property": {
"type": "Identifier",
"name": "lift",
"range": [
2127,
2131
],
"loc": {
"start": {
"line": 46,
"column": 16
},
"end": {
"line": 46,
"column": 20
}
}
},
"range": [
2122,
2131
],
"loc": {
"start": {
"line": 46,
"column": 11
},
"end": {
"line": 46,
"column": 20
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "AuditOperator",
"range": [
2136,
2149
],
"loc": {
"start": {
"line": 46,
"column": 25
},
"end": {
"line": 46,
"column": 38
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "durationSelector",
"range": [
2150,
2166
],
"loc": {
"start": {
"line": 46,
"column": 39
},
"end": {
"line": 46,
"column": 55
}
}
}
],
"range": [
2132,
2167
],
"loc": {
"start": {
"line": 46,
"column": 21
},
"end": {
"line": 46,
"column": 56
}
}
}
],
"range": [
2122,
2168
],
"loc": {
"start": {
"line": 46,
"column": 11
},
"end": {
"line": 46,
"column": 57
}
}
},
"range": [
2115,
2169
],
"loc": {
"start": {
"line": 46,
"column": 4
},
"end": {
"line": 46,
"column": 58
}
}
}
],
"range": [
2109,
2171
],
"loc": {
"start": {
"line": 45,
"column": 40
},
"end": {
"line": 47,
"column": 1
}
}
},
"generator": false,
"expression": false,
"range": [
2076,
2171
],
"loc": {
"start": {
"line": 45,
"column": 7
},
"end": {
"line": 47,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Ignores source values for a duration determined by another Observable, then\n * emits the most recent value from the source Observable, then repeats this\n * process.\n *\n * <span class=\"informal\">It's like {@link auditTime}, but the silencing\n * duration is determined by a second Observable.</span>\n *\n * <img src=\"./img/audit.png\" width=\"100%\">\n *\n * `audit` is similar to `throttle`, but emits the last value from the silenced\n * time window, instead of the first value. `audit` emits the most recent value\n * from the source Observable on the output Observable as soon as its internal\n * timer becomes disabled, and ignores source values while the timer is enabled.\n * Initially, the timer is disabled. As soon as the first source value arrives,\n * the timer is enabled by calling the `durationSelector` function with the\n * source value, which returns the \"duration\" Observable. When the duration\n * Observable emits a value or completes, the timer is disabled, then the most\n * recent source value is emitted on the output Observable, and this process\n * repeats for the next source value.\n *\n * @example <caption>Emit clicks at a rate of at most one click per second</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.audit(ev => Rx.Observable.interval(1000));\n * result.subscribe(x => console.log(x));\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttle}\n *\n * @param {function(value: T): Observable|Promise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration, returned as an Observable or a Promise.\n * @return {Observable<T>} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method audit\n * @owner Observable\n ",
"range": [
213,
2068
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 44,
"column": 3
}
}
}
],
"trailingComments": []
},
"specifiers": [],
"source": null,
"range": [
2069,
2171
],
"loc": {
"start": {
"line": 45,
"column": 0
},
"end": {
"line": 47,
"column": 1
}
},
"leadingComments": [
{
"type": "Block",
"value": "*\n * Ignores source values for a duration determined by another Observable, then\n * emits the most recent value from the source Observable, then repeats this\n * process.\n *\n * <span class=\"informal\">It's like {@link auditTime}, but the silencing\n * duration is determined by a second Observable.</span>\n *\n * <img src=\"./img/audit.png\" width=\"100%\">\n *\n * `audit` is similar to `throttle`, but emits the last value from the silenced\n * time window, instead of the first value. `audit` emits the most recent value\n * from the source Observable on the output Observable as soon as its internal\n * timer becomes disabled, and ignores source values while the timer is enabled.\n * Initially, the timer is disabled. As soon as the first source value arrives,\n * the timer is enabled by calling the `durationSelector` function with the\n * source value, which returns the \"duration\" Observable. When the duration\n * Observable emits a value or completes, the timer is disabled, then the most\n * recent source value is emitted on the output Observable, and this process\n * repeats for the next source value.\n *\n * @example <caption>Emit clicks at a rate of at most one click per second</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var result = clicks.audit(ev => Rx.Observable.interval(1000));\n * result.subscribe(x => console.log(x));\n *\n * @see {@link auditTime}\n * @see {@link debounce}\n * @see {@link delayWhen}\n * @see {@link sample}\n * @see {@link throttle}\n *\n * @param {function(value: T): Observable|Promise} durationSelector A function\n * that receives a value from the source Observable, for computing the silencing\n * duration, returned as an Observable or a Promise.\n * @return {Observable<T>} An Observable that performs rate-limiting of\n * emissions from the source Observable.\n * @method audit\n * @owner Observable\n ",
"range": [
213,
2068
],
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 44,
"column": 3
}
}
}
]
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "AuditOperator",
"range": [
2176,
2189
],
"loc": {
"start": {
"line": 48,
"column": 4
},
"end": {
"line": 48,
"column": 17
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "FunctionExpression",
"id": null,
"params": [],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "FunctionDeclaration",
"id": {
"type": "Identifier",
"name": "AuditOperator",
"range": [
2220,
2233
],
"loc": {
"start": {
"line": 49,
"column": 13
},
"end": {
"line": 49,
"column": 26
}
}
},
"params": [
{
"type": "Identifier",
"name": "durationSelector",
"range": [
2234,
2250
],
"loc": {
"start": {
"line": 49,
"column": 27
},
"end": {
"line": 49,
"column": 43
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
2262,
2266
],
"loc": {
"start": {
"line": 50,
"column": 8
},
"end": {
"line": 50,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"name": "durationSelector",
"range": [
2267,
2283
],
"loc": {
"start": {
"line": 50,
"column": 13
},
"end": {
"line": 50,
"column": 29
}
}
},
"range": [
2262,
2283
],
"loc": {
"start": {
"line": 50,
"column": 8
},
"end": {
"line": 50,
"column": 29
}
}
},
"right": {
"type": "Identifier",
"name": "durationSelector",
"range": [
2286,
2302
],
"loc": {
"start": {
"line": 50,
"column": 32
},
"end": {
"line": 50,
"column": 48
}
}
},
"range": [
2262,
2302
],
"loc": {
"start": {
"line": 50,
"column": 8
},
"end": {
"line": 50,
"column": 48
}
}
},
"range": [
2262,
2303
],
"loc": {
"start": {
"line": 50,
"column": 8
},
"end": {
"line": 50,
"column": 49
}
}
}
],
"range": [
2252,
2309
],
"loc": {
"start": {
"line": 49,
"column": 45
},
"end": {
"line": 51,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
2211,
2309
],
"loc": {
"start": {
"line": 49,
"column": 4
},
"end": {
"line": 51,
"column": 5
}
}
},
{
"type": "ExpressionStatement",
"expression": {
"type": "AssignmentExpression",
"operator": "=",
"left": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "AuditOperator",
"range": [
2314,
2327
],
"loc": {
"start": {
"line": 52,
"column": 4
},
"end": {
"line": 52,
"column": 17
}
}
},
"property": {
"type": "Identifier",
"name": "prototype",
"range": [
2328,
2337
],
"loc": {
"start": {
"line": 52,
"column": 18
},
"end": {
"line": 52,
"column": 27
}
}
},
"range": [
2314,
2337
],
"loc": {
"start": {
"line": 52,
"column": 4
},
"end": {
"line": 52,
"column": 27
}
}
},
"property": {
"type": "Identifier",
"name": "call",
"range": [
2338,
2342
],
"loc": {
"start": {
"line": 52,
"column": 28
},
"end": {
"line": 52,
"column": 32
}
}
},
"range": [
2314,
2342
],
"loc": {
"start": {
"line": 52,
"column": 4
},
"end": {
"line": 52,
"column": 32
}
}
},
"right": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "subscriber",
"range": [
2355,
2365
],
"loc": {
"start": {
"line": 52,
"column": 45
},
"end": {
"line": 52,
"column": 55
}
}
},
{
"type": "Identifier",
"name": "source",
"range": [
2367,
2373
],
"loc": {
"start": {
"line": 52,
"column": 57
},
"end": {
"line": 52,
"column": 63
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ReturnStatement",
"argument": {
"type": "CallExpression",
"callee": {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "source",
"range": [
2392,
2398
],
"loc": {
"start": {
"line": 53,
"column": 15
},
"end": {
"line": 53,
"column": 21
}
}
},
"property": {
"type": "Identifier",
"name": "_subscribe",
"range": [
2399,
2409
],
"loc": {
"start": {
"line": 53,
"column": 22
},
"end": {
"line": 53,
"column": 32
}
}
},
"range": [
2392,
2409
],
"loc": {
"start": {
"line": 53,
"column": 15
},
"end": {
"line": 53,
"column": 32
}
}
},
"arguments": [
{
"type": "NewExpression",
"callee": {
"type": "Identifier",
"name": "AuditSubscriber",
"range": [
2414,
2429
],
"loc": {
"start": {
"line": 53,
"column": 37
},
"end": {
"line": 53,
"column": 52
}
}
},
"arguments": [
{
"type": "Identifier",
"name": "subscriber",
"range": [
2430,
2440
],
"loc": {
"start": {
"line": 53,
"column": 53
},
"end": {
"line": 53,
"column": 63
}
}
},
{
"type": "MemberExpression",
"computed": false,
"object": {
"type": "ThisExpression",
"range": [
2442,
2446
],
"loc": {
"start": {
"line": 53,
"column": 65
},
"end": {
"line": 53,
"column": 69
}
}
},
"property": {
"type": "Identifier",
"name": "durationSelector",
"range": [
2447,
2463
],
"loc": {
"start": {
"line": 53,
"column": 70
},
"end": {
"line": 53,
"column": 86
}
}
},
"range": [
2442,
2463
],
"loc": {
"start": {
"line": 53,
"column": 65
},
"end": {
"line": 53,
"column": 86
}
}
}
],
"range": [
2410,
2464
],
"loc": {
"start": {
"line": 53,
"column": 33
},
"end": {
"line": 53,
"column": 87
}
}
}
],
"range": [
2392,
2465
],
"loc": {
"start": {
"line": 53,
"column": 15
},
"end": {
"line": 53,
"column": 88
}
}
},
"range": [
2385,
2466
],
"loc": {
"start": {
"line": 53,
"column": 8
},
"end": {
"line": 53,
"column": 89
}
}
}
],
"range": [
2375,
2472
],
"loc": {
"start": {
"line": 52,
"column": 65
},
"end": {
"line": 54,
"column": 5
}
}
},
"generator": false,
"expression": false,
"range": [
2345,
2472
],
"loc": {
"start": {
"line": 52,
"column": 35
},
"end": {
"line": 54,
"column": 5
}
}
},
"range": [
2314,
2472
],
"loc": {
"start": {
"line": 52,
"column": 4
},
"end": {
"line": 54,
"column": 5
}
}
},
"range": [
2314,
2473
],
"loc": {
"start": {
"line": 52,
"column": 4
},
"end": {
"line": 54,
"column": 6
}
}
},
{
"type": "ReturnStatement",
"argument": {
"type": "Identifier",
"name": "AuditOperator",
"range": [
2485,
2498
],
"loc": {
"start": {
"line": 55,
"column": 11
},
"end": {
"line": 55,
"column": 24
}
}
},
"range": [
2478,
2499
],
"loc": {
"start": {
"line": 55,
"column": 4
},
"end": {
"line": 55,
"column": 25
}
}
}
],
"range": [
2205,
2501
],
"loc": {
"start": {
"line": 48,
"column": 33
},
"end": {
"line": 56,
"column": 1
}
}
},
"generator": false,
"expression": false,
"range": [
2193,
2501
],
"loc": {
"start": {
"line": 48,
"column": 21
},
"end": {
"line": 56,
"column": 1
}
}
},
"arguments": [],
"range": [
2193,
2503
],
"loc": {
"start": {
"line": 48,
"column": 21
},
"end": {
"line": 56,
"column": 3
}
}
},
"range": [
2176,
2504
],
"loc": {
"start": {
"line": 48,
"column": 4
},
"end": {
"line": 56,
"column": 4
}
}
}
],
"kind": "var",
"range": [
2172,
2505
],
"loc": {
"start": {
"line": 48,
"column": 0
},
"end": {
"line": 56,
"column": 5
}
},
"trailingComments": [
{
"type": "Block",
"value": "*\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n ",
"range": [
2506,
2597
],
"loc": {
"start": {
"line": 57,
"column": 0
},
"end": {
"line": 61,
"column": 3
}
}
}
]
},
{
"type": "VariableDeclaration",
"declarations": [
{
"type": "VariableDeclarator",
"id": {
"type": "Identifier",
"name": "AuditSubscriber",
"range": [
2602,
2617
],
"loc": {
"start": {
"line": 62,
"column": 4
},
"end": {
"line": 62,
"column": 19
}
}
},
"init": {
"type": "CallExpression",
"callee": {
"type": "FunctionExpression",
"id": null,
"params": [
{
"type": "Identifier",
"name": "_super",
"range": [
2631,
2637
],
"loc": {
"start": {
"line": 62,
"column": 33
},
"end": {
"line": 62,
"column": 39
}
}
}
],
"body": {
"type": "BlockStatement",
"body": [
{
"type": "ExpressionStatement",
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "__extends",
"range": [
2645,
2654
],
"loc": {
"start": {
"line": 63,
"column": 4
},
"end": {
"line": 63,
"column": 13
}
}
},
"arguments": [