Closed
Description
What I wanted to do
Use createInstance in typescript
What I expected to happen
For the types to support LogLevel | string
What actually happened
The createInstance Config logLevel property type is incorrect. It type hints just the LogLevel enum, but it also supports a string representation of the log level which will be coerced at runtime.
Reference to types that need changing:
Steps to reproduce
Set up a typescript project with the optimizely sdk and attempt to use createInstance with a string logLevel.
If you cast it and run the code it will work as expect. But the type does not support the string logLevel if not casted.
Metadata
Metadata
Assignees
Labels
No labels