Skip to content

Commit

Permalink
Fix type check failures in typescript 4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sundbry committed Mar 15, 2022
1 parent ef416f0 commit 31bfd08
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/internal/Subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export class SafeSubscriber<T> extends Subscriber<T> {
// The first argument is a function, not an observer. The next
// two arguments *could* be observers, or they could be empty.
partialObserver = {
next: observerOrNext ?? undefined,
next: (observerOrNext ?? undefined) as (((value: T) => void) | undefined),
error: error ?? undefined,
complete: complete ?? undefined,
};
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/groupBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export function groupBy<T, K, R>(
return operate((source, subscriber) => {
let element: ((value: any) => any) | void;
if (!elementOrOptions || typeof elementOrOptions === 'function') {
element = elementOrOptions;
element = elementOrOptions as ((value: any) => any);
} else {
({ duration, element, connector } = elementOrOptions);
}
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function retry<T>(configOrCount: number | RetryConfig = Infinity): MonoTy
config = configOrCount;
} else {
config = {
count: configOrCount,
count: configOrCount as number,
};
}
const { count = Infinity, delay, resetOnSuccess: resetOnSuccess = false } = config;
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/shareReplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export function shareReplay<T>(
if (configOrBufferSize && typeof configOrBufferSize === 'object') {
({ bufferSize = Infinity, windowTime = Infinity, refCount = false, scheduler } = configOrBufferSize);
} else {
bufferSize = configOrBufferSize ?? Infinity;
bufferSize = (configOrBufferSize ?? Infinity) as number;
}
return share<T>({
connector: () => new ReplaySubject(bufferSize, windowTime, scheduler),
Expand Down
2 changes: 1 addition & 1 deletion src/internal/scheduler/intervalProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => number;
type SetIntervalFunction = (handler: () => void, timeout?: number, ...args: any[]) => unknown;
type ClearIntervalFunction = (handle: number) => void;

interface IntervalProvider {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/scheduler/timeoutProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => number;
type SetTimeoutFunction = (handler: () => void, timeout?: number, ...args: any[]) => unknown;
type ClearTimeoutFunction = (handle: number) => void;

interface TimeoutProvider {
Expand Down
2 changes: 2 additions & 0 deletions src/internal/util/workarounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
// Wherever possible, use a TypeScript issue number in the type - something
// like TS_18757 - or use a descriptive name and leave a detailed comment
// alongside the type alias.

export {}

0 comments on commit 31bfd08

Please sign in to comment.