File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed
packages/optimizely-sdk/lib/utils/event_processor_config_validator Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -17,23 +17,29 @@ import { isSafeInteger } from '../fns';
17
17
18
18
/**
19
19
* Return true if the argument is a valid event batch size, false otherwise
20
- * @param {* } eventBatchSize
21
- * @returns boolean
20
+ * @param {unknown } eventBatchSize
21
+ * @returns { boolean }
22
22
*/
23
- export var validateEventBatchSize = function ( eventBatchSize ) {
24
- return isSafeInteger ( eventBatchSize ) && eventBatchSize >= 1 ;
25
- } ;
23
+ const validateEventBatchSize = function ( eventBatchSize : unknown ) : boolean {
24
+ if ( typeof eventBatchSize === 'number' && isSafeInteger ( eventBatchSize ) ) {
25
+ return eventBatchSize >= 1 ;
26
+ }
27
+ return false ;
28
+ }
26
29
27
30
/**
28
31
* Return true if the argument is a valid event flush interval, false otherwise
29
- * @param {* } eventFlushInterval
30
- * @returns boolean
32
+ * @param {unknown } eventFlushInterval
33
+ * @returns { boolean }
31
34
*/
32
- export var validateEventFlushInterval = function ( eventFlushInterval ) {
33
- return isSafeInteger ( eventFlushInterval ) && eventFlushInterval > 0 ;
34
- } ;
35
+ const validateEventFlushInterval = function ( eventFlushInterval : unknown ) : boolean {
36
+ if ( typeof eventFlushInterval === 'number' && isSafeInteger ( eventFlushInterval ) ) {
37
+ return eventFlushInterval > 0 ;
38
+ }
39
+ return false ;
40
+ }
35
41
36
42
export default {
37
43
validateEventBatchSize : validateEventBatchSize ,
38
44
validateEventFlushInterval : validateEventFlushInterval ,
39
- } ;
45
+ }
You can’t perform that action at this time.
0 commit comments