I removed the if statement for the case where selectionStart > minuteMarker and !hideSeconds, and moved the assignment of cursorSelection to 'seconds' to the else block. This is because the if statement is not needed - if hideSeconds is true, the function will not enter the else block. If hideSeconds is false, the function will enter the else block and cursorSelection will be assigned to 'seconds'.
I destructured the event parameter to avoid having to use event.target multiple times. This reduces the amount of code and may also improve readability.
I removed the if statement for the case where selectionStart > minuteMarker and !hideSeconds, and moved the assignment of cursorSelection to 'seconds' to the else block. This is because the if statement is not needed - if hideSeconds is true, the function will not enter the else block. If hideSeconds is false, the function will enter the else block and cursorSelection will be assigned to 'seconds'.
I destructured the event parameter to avoid having to use event.target multiple times. This reduces the amount of code and may also improve readability.