class NumberUtil { getSanitizedValueWithBoundaries ( value , max , min ) { let sanitizedValue ; if ( value >= max ) { sanitizedValue = value % max ; } else if ( value <= min ) { sanitizedValue = Math . abs ( max - Math . abs ( value ) ) % max ; } else { return value ; } return sanitizedValue ; } } export default new NumberUtil ( ) ;