import { isNilOrEmpty } from "./assertions" ; export enum Keys { arrowDown = "ArrowDown" , arrowLeft = "ArrowLeft" , arrowRight = "ArrowRight" , arrowUp = "ArrowUp" , backspace = "Backspace" , delete = "Delete" , enter = "Enter" , end = "End" , esc = "Escape" , home = "Home" , tab = "Tab" , space = " " } export function appendEventKey ( str , key ) { switch ( key ) { case Keys . backspace : return str ; case Keys . delete : return ! isNilOrEmpty ( str ) ? str . slice ( 0 , - 1 ) : str ; default : return `${ str }${ key }` ; } }