Skip to content

feat: Convert user_profile_service_validator module to TS #526

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

Conversation

yavorona
Copy link
Contributor

@yavorona yavorona commented Jul 18, 2020

Summary

Convert user_profile_service_validator module from JS to TS.

Test plan

  • Manual testing using local build and linked Node app
  • Existing unit tests

@yavorona yavorona requested a review from a team as a code owner July 18, 2020 01:25
@yavorona yavorona changed the title feat: Convert user_profile_service_validator to TS feat: Convert user_profile_service_validator module to TS Jul 18, 2020
@yavorona yavorona removed their assignment Jul 18, 2020
@yavorona yavorona force-pushed the pnguen/user-profile-service-validator-to-ts branch from 2c73ccf to 664fdb8 Compare July 18, 2020 01:30
@yavorona yavorona merged commit fd1c2dc into mcarroll/optimizely-sdk-typescript Jul 20, 2020
@yavorona yavorona deleted the pnguen/user-profile-service-validator-to-ts branch July 20, 2020 23:08
* @throws If the instance is not valid
*/
export var validate = function(userProfileServiceInstance) {
export function validate(userProfileServiceInstance: Record<string, unknown>): boolean {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be a Record! We should define an interface for UserProfileService instead

Copy link
Contributor Author

@yavorona yavorona Jul 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UserProfileService interface has been declared in index.d.ts, so I tried importing it with
{ UserProfileService } from '@optimizely/optimizely-sdk' and import { UserProfileService } from '../../index', which did not work. Any suggestions on how to import it would be much appreciated! @mjc1283 @mikeng13

@yavorona yavorona restored the pnguen/user-profile-service-validator-to-ts branch July 20, 2020 23:55
@yavorona yavorona deleted the pnguen/user-profile-service-validator-to-ts branch July 22, 2020 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants