File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed 
packages/optimizely-sdk/lib 
utils/user_profile_service_validator Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import { buildConversionEvent, buildImpressionEvent } from '../core/event_builde
2525import  eventTagsValidator  from  '../utils/event_tags_validator' ; 
2626import  notificationCenter  from  '../core/notification_center' ; 
2727import  projectConfig  from  '../core/project_config' ; 
28- import  userProfileServiceValidator  from  '../utils/user_profile_service_validator' ; 
28+ import  *   as   userProfileServiceValidator  from  '../utils/user_profile_service_validator' ; 
2929import  *  as  stringValidator  from  '../utils/string_value_validator' ; 
3030import  projectConfigManager  from  '../core/project_config/project_config_manager' ; 
3131
Original file line number Diff line number Diff line change 2121import  {  sprintf  }  from  '@optimizely/js-sdk-utils' ; 
2222
2323import  {  ERROR_MESSAGES  }  from  '../enums' ; 
24- var  MODULE_NAME  =  'USER_PROFILE_SERVICE_VALIDATOR' ; 
24+ 
25+ const  MODULE_NAME  =  'USER_PROFILE_SERVICE_VALIDATOR' ; 
2526
2627/** 
2728 * Validates user's provided user profile service instance 
28-  * @param   {Object }  userProfileServiceInstance 
29-  * @return  {boolean } True  if the instance is valid 
29+  * @param   {object }  userProfileServiceInstance 
30+  * @return  {boolean } true  if the instance is valid 
3031 * @throws  If the instance is not valid 
3132 */ 
32- export  var  validate   =   function ( userProfileServiceInstance )  { 
33+ export  function  validate ( userProfileServiceInstance :  Record < string ,   unknown > ) :  boolean  { 
3334  if  ( typeof  userProfileServiceInstance . lookup  !==  'function' )  { 
3435    throw  new  Error ( sprintf ( ERROR_MESSAGES . INVALID_USER_PROFILE_SERVICE ,  MODULE_NAME ,  "Missing function 'lookup'" ) ) ; 
3536  }  else  if  ( typeof  userProfileServiceInstance . save  !==  'function' )  { 
3637    throw  new  Error ( sprintf ( ERROR_MESSAGES . INVALID_USER_PROFILE_SERVICE ,  MODULE_NAME ,  "Missing function 'save'" ) ) ; 
3738  } 
3839  return  true ; 
39- } ; 
40- 
41- export  default  { 
42-   validate : validate , 
43- } ; 
40+ } 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments