Skip to content
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

[Typing Issue] EventAttributes interface should require value to be string not any #734

Closed
gnomishperson opened this issue Apr 25, 2018 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@gnomishperson
Copy link

https://github.com/aws/aws-amplify/blob/d5d27d622f1643251d42274333bbf1c6427404ec/packages/aws-amplify/lib/Analytics/types/Analytics.d.ts#L12-L14

https://github.com/aws/aws-amplify/blob/d5d27d622f1643251d42274333bbf1c6427404ec/packages/aws-amplify/lib/Analytics/Analytics.d.ts#L56

let attributes = { 'stringKey': { another: customObject } }
Analytics.record('customEventName', attributes)

attributes matches the [key: string]: any;

However, this fails to record the event with an error stating that the value of 'stringKey' is not a string, but the typing would lead you to believe it did not have to be.

Should probably be:

export interface EventAttributes { 
     [key: string]: string; 
}
@elorzafe
Copy link
Contributor

Hi @gnomishperson I will take a look on your pr.

Thank you!

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants