Skip to content

Conversation

@Tobi-mmt
Copy link
Contributor

@Tobi-mmt Tobi-mmt commented Dec 9, 2021

This resolves #69

This type is not useful because it says something like:

The key has to be a string, but can also be "All"

But All is a string!

But All can be undefined

So not all strings can be undefined, only All why?

But a key with a string as type can only be boolean, not undefined

That means :

// allowed
{ }
{ All: undefined }
{ All: true }
{ All: false }
{ hotjar: true }
{ hotjar: false }

// NOT allowed
{ hotjar: undefined }

Since this does not make sense and TS is also saying this 2 rules can not match each other we have to change the Type.

With this PR I introduce the new types by removing the All rule. So now we can pass in all strings, also the string All but the values can only be true or false. If you don't want to pass the All key, just do not pass it in the integrations object.
So now the following is the case:

// allowed
{ }
{ All: true }
{ All: false }
{ hotjar: true }
{ hotjar: false }

// NOT allowed
{ All: undefined } // this one changed in this PR
{ hotjar: undefined }

@Tobi-mmt
Copy link
Contributor Author

Tobi-mmt commented Dec 13, 2021

@dk1027 @danieljackins @juliofarah can you have a look on that?

@silesky silesky merged commit a9fb6a3 into segmentio:master Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Types failing in 4.14.2

2 participants