File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { SDKLoggerApi } from './sdkRuntimeModels' ;
2+ import { isBoolean } from './utils' ;
3+
24
35/**
46 * Privacy flags control SDK behavior based on user consent preferences for Rokt integration.
@@ -54,14 +56,18 @@ export default class PrivacyManager implements IPrivacyManager {
5456
5557 const { noFunctional, noTargeting } = flags ;
5658
57- if ( typeof noFunctional === 'boolean' ) {
59+ if ( isBoolean ( noFunctional ) ) {
5860 this . privacyFlags . noFunctional = noFunctional ;
5961 logger ?. verbose ( `PrivacyManager: noFunctional set to ${ noFunctional } ` ) ;
62+ } else if ( noFunctional !== undefined ) {
63+ logger ?. error ( 'PrivacyManager: noFunctional must be a boolean' ) ;
6064 }
61-
62- if ( typeof noTargeting === 'boolean' ) {
65+
66+ if ( isBoolean ( noTargeting ) ) {
6367 this . privacyFlags . noTargeting = noTargeting ;
6468 logger ?. verbose ( `PrivacyManager: noTargeting set to ${ noTargeting } ` ) ;
69+ } else if ( noTargeting !== undefined ) {
70+ logger ?. error ( 'PrivacyManager: noTargeting must be a boolean' ) ;
6571 }
6672 }
6773
Original file line number Diff line number Diff line change @@ -461,6 +461,7 @@ export {
461461 toDataPlanSlug ,
462462 isString ,
463463 isNumber ,
464+ isBoolean ,
464465 isFunction ,
465466 isDataPlanSlug ,
466467 isEmpty ,
You can’t perform that action at this time.
0 commit comments