Skip to content

fix(Optimizely): Use any type for return value of setTimeout #623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/optimizely-sdk/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Bug fixes

- In `Optimizely` class, use `any` type when assigning the return value of `setTimeout`. This is to allow it to type check regardless of whether it uses the browser or Node version of `setTimeout` ([PR #623](https://github.com/optimizely/javascript-sdk/pull/623)), ([Issue #622](https://github.com/optimizely/javascript-sdk/issues/622))

## [4.4.1] - November 5, 2020

Expand Down
4 changes: 3 additions & 1 deletion packages/optimizely-sdk/lib/optimizely/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export default class Optimizely {
private isOptimizelyConfigValid: boolean;
private disposeOnUpdate: (() => void ) | null;
private readyPromise: Promise<{ success: boolean; reason?: string }>;
private readyTimeouts: { [key: string]: {readyTimeout: number; onClose:() => void} };
// readyTimeout is specified as any to make this work in both browser & Node
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private readyTimeouts: { [key: string]: {readyTimeout: any; onClose:() => void} };
private nextReadyTimeoutId: number;
private clientEngine: string;
private clientVersion: string;
Expand Down