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';
1717
1818/**
1919 * 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 }
2222 */
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+ }
2629
2730/**
2831 * 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 }
3134 */
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+ }
3541
3642export default {
3743 validateEventBatchSize : validateEventBatchSize ,
3844 validateEventFlushInterval : validateEventFlushInterval ,
39- } ;
45+ }
You can’t perform that action at this time.
0 commit comments