Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 6e8ccf9

Browse files
Merge pull request #878 from timotei/master
Fix the .ts regex matcher + rebuild .ts files
2 parents 5a37fa2 + 618ea49 commit 6e8ccf9

9 files changed

Lines changed: 139 additions & 15 deletions

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2545,7 +2545,7 @@ module.exports = function (grunt) {
25452545
var source = grunt.file.read(tsFile);
25462546

25472547
// source with tests
2548-
var s = source.match(/module Rx \{([\s\S]*)\}[\s\S]*\(function/);
2548+
var s = source.match(/module Rx \{([\s\S]*)\}[\s\S]*\(function\s*\(\)\s*\{[\s\S]*\}\)/);
25492549
if (s && s[1]) {
25502550
c = cache[tsFile] = s[1];
25512551
}

ts/rx.all.d.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,7 +2188,18 @@ declare module Rx {
21882188
*
21892189
* @example
21902190
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
2191-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never();
2191+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
2192+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
2193+
* @param {Function} keySelector A function to extract the key for each element.
2194+
* @param {Function} durationSelector A function to signal the expiration of a group.
2195+
* @returns {Observable}
2196+
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
2197+
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
2198+
*
2199+
*/
2200+
groupByUntil<TKey, TElement, TDuration>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable<TKey, TElement>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
2201+
}
2202+
21922203
export interface Observable<T> {
21932204
/**
21942205
* Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
@@ -2207,7 +2218,15 @@ declare module Rx {
22072218
*
22082219
* @example
22092220
* var res = observable.groupBy(function (x) { return x.id; });
2210-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name;
2221+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
2222+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
2223+
* @param {Function} keySelector A function to extract the key for each element.
2224+
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
2225+
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
2226+
*/
2227+
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
2228+
}
2229+
22112230
export interface Observable<T> {
22122231
/**
22132232
* Projects each element of an observable sequence into a new form by incorporating the element's index.
@@ -2509,7 +2528,15 @@ declare module Rx {
25092528
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
25102529
* The element's index is used in the logic of the predicate function.
25112530
*
2512-
* var res = source.skipWhile(function (value) { return value < 10;
2531+
* var res = source.skipWhile(function (value) { return value < 10; });
2532+
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
2533+
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
2534+
* @param {Any} [thisArg] Object to use as this when executing callback.
2535+
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
2536+
*/
2537+
skipWhile(predicate: ((value: T, index: number, observable: Observable<T>) => boolean), thisArg?: any): Observable<T>;
2538+
}
2539+
25132540
export interface Observable<T> {
25142541
/**
25152542
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).

ts/rx.all.es6.d.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,7 +2185,18 @@ declare module Rx {
21852185
*
21862186
* @example
21872187
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
2188-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never();
2188+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
2189+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
2190+
* @param {Function} keySelector A function to extract the key for each element.
2191+
* @param {Function} durationSelector A function to signal the expiration of a group.
2192+
* @returns {Observable}
2193+
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
2194+
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
2195+
*
2196+
*/
2197+
groupByUntil<TKey, TElement, TDuration>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable<TKey, TElement>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
2198+
}
2199+
21892200
export interface Observable<T> {
21902201
/**
21912202
* Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
@@ -2204,7 +2215,15 @@ declare module Rx {
22042215
*
22052216
* @example
22062217
* var res = observable.groupBy(function (x) { return x.id; });
2207-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name;
2218+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
2219+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
2220+
* @param {Function} keySelector A function to extract the key for each element.
2221+
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
2222+
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
2223+
*/
2224+
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
2225+
}
2226+
22082227
export interface Observable<T> {
22092228
/**
22102229
* Projects each element of an observable sequence into a new form by incorporating the element's index.
@@ -2506,7 +2525,15 @@ declare module Rx {
25062525
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
25072526
* The element's index is used in the logic of the predicate function.
25082527
*
2509-
* var res = source.skipWhile(function (value) { return value < 10;
2528+
* var res = source.skipWhile(function (value) { return value < 10; });
2529+
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
2530+
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
2531+
* @param {Any} [thisArg] Object to use as this when executing callback.
2532+
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
2533+
*/
2534+
skipWhile(predicate: ((value: T, index: number, observable: Observable<T>) => boolean), thisArg?: any): Observable<T>;
2535+
}
2536+
25102537
export interface Observable<T> {
25112538
/**
25122539
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).

ts/rx.coincidence.d.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,18 @@ declare module Rx {
4343
*
4444
* @example
4545
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
46-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never();
46+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
47+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
48+
* @param {Function} keySelector A function to extract the key for each element.
49+
* @param {Function} durationSelector A function to signal the expiration of a group.
50+
* @returns {Observable}
51+
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
52+
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
53+
*
54+
*/
55+
groupByUntil<TKey, TElement, TDuration>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable<TKey, TElement>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
56+
}
57+
4758
export interface Observable<T> {
4859
/**
4960
* Correlates the elements of two sequences based on overlapping durations, and groups the results.
@@ -157,7 +168,15 @@ declare module Rx {
157168
*
158169
* @example
159170
* var res = observable.groupBy(function (x) { return x.id; });
160-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name;
171+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
172+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
173+
* @param {Function} keySelector A function to extract the key for each element.
174+
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
175+
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
176+
*/
177+
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
178+
}
179+
161180
export interface GroupedObservable<TKey, TElement> extends Observable<TElement> {
162181
key: TKey;
163182
underlyingObservable: Observable<TElement>;

ts/rx.coincidence.es6.d.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,18 @@ declare module Rx {
4343
*
4444
* @example
4545
* var res = observable.groupByUntil(function (x) { return x.id; }, null, function () { return Rx.Observable.never(); });
46-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never();
46+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); });
47+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function () { return Rx.Observable.never(); }, function (x) { return x.toString(); });
48+
* @param {Function} keySelector A function to extract the key for each element.
49+
* @param {Function} durationSelector A function to signal the expiration of a group.
50+
* @returns {Observable}
51+
* A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
52+
* If a group's lifetime expires, a new group with the same key value can be created once an element with such a key value is encoutered.
53+
*
54+
*/
55+
groupByUntil<TKey, TElement, TDuration>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, durationSelector: (group: GroupedObservable<TKey, TElement>) => Observable<TDuration>, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
56+
}
57+
4758
export interface Observable<T> {
4859
/**
4960
* Correlates the elements of two sequences based on overlapping durations, and groups the results.
@@ -157,7 +168,15 @@ declare module Rx {
157168
*
158169
* @example
159170
* var res = observable.groupBy(function (x) { return x.id; });
160-
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name;
171+
* 2 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; });
172+
* 3 - observable.groupBy(function (x) { return x.id; }), function (x) { return x.name; }, function (x) { return x.toString(); });
173+
* @param {Function} keySelector A function to extract the key for each element.
174+
* @param {Function} [elementSelector] A function to map each source element to an element in an observable group.
175+
* @returns {Observable} A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value.
176+
*/
177+
groupBy<TKey, TElement>(keySelector: (value: T) => TKey, elementSelector: (value: T) => TElement, keySerializer?: (key: TKey) => string): Observable<GroupedObservable<TKey, TElement>>;
178+
}
179+
161180
export interface GroupedObservable<TKey, TElement> extends Observable<TElement> {
162181
key: TKey;
163182
underlyingObservable: Observable<TElement>;

ts/rx.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2405,7 +2405,15 @@ declare module Rx {
24052405
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
24062406
* The element's index is used in the logic of the predicate function.
24072407
*
2408-
* var res = source.skipWhile(function (value) { return value < 10;
2408+
* var res = source.skipWhile(function (value) { return value < 10; });
2409+
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
2410+
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
2411+
* @param {Any} [thisArg] Object to use as this when executing callback.
2412+
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
2413+
*/
2414+
skipWhile(predicate: ((value: T, index: number, observable: Observable<T>) => boolean), thisArg?: any): Observable<T>;
2415+
}
2416+
24092417
export interface Observable<T> {
24102418
/**
24112419
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).

ts/rx.es6.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2402,7 +2402,15 @@ declare module Rx {
24022402
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
24032403
* The element's index is used in the logic of the predicate function.
24042404
*
2405-
* var res = source.skipWhile(function (value) { return value < 10;
2405+
* var res = source.skipWhile(function (value) { return value < 10; });
2406+
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
2407+
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
2408+
* @param {Any} [thisArg] Object to use as this when executing callback.
2409+
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
2410+
*/
2411+
skipWhile(predicate: ((value: T, index: number, observable: Observable<T>) => boolean), thisArg?: any): Observable<T>;
2412+
}
2413+
24062414
export interface Observable<T> {
24072415
/**
24082416
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).

ts/rx.lite.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2131,7 +2131,15 @@ declare module Rx {
21312131
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
21322132
* The element's index is used in the logic of the predicate function.
21332133
*
2134-
* var res = source.skipWhile(function (value) { return value < 10;
2134+
* var res = source.skipWhile(function (value) { return value < 10; });
2135+
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
2136+
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
2137+
* @param {Any} [thisArg] Object to use as this when executing callback.
2138+
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
2139+
*/
2140+
skipWhile(predicate: ((value: T, index: number, observable: Observable<T>) => boolean), thisArg?: any): Observable<T>;
2141+
}
2142+
21352143
export interface Observable<T> {
21362144
/**
21372145
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).

ts/rx.lite.es6.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,15 @@ declare module Rx {
21282128
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
21292129
* The element's index is used in the logic of the predicate function.
21302130
*
2131-
* var res = source.skipWhile(function (value) { return value < 10;
2131+
* var res = source.skipWhile(function (value) { return value < 10; });
2132+
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
2133+
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
2134+
* @param {Any} [thisArg] Object to use as this when executing callback.
2135+
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
2136+
*/
2137+
skipWhile(predicate: ((value: T, index: number, observable: Observable<T>) => boolean), thisArg?: any): Observable<T>;
2138+
}
2139+
21322140
export interface Observable<T> {
21332141
/**
21342142
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).

0 commit comments

Comments
 (0)