export const noop = ( ) => { } ; export const arrayPut = < T > ( item , array ? , index ? ) : T [ ] => { if ( ! array ) { return [ item ] ; } const newArray = [ ... array ] ; index === undefined ? newArray . push ( item ) : newArray . splice ( index , 0 , item ) ; return newArray ; } ; export function arrayMove < T > ( arr , fromIndex , toIndex ) { if ( fromIndex < 0 || toIndex < 0 ) { return arr ; } fromIndex = fromIndex > arr . length - 1 ? arr . length - 1 : fromIndex ; const newArray = [ ... arr ] ; const element = newArray [ fromIndex ] ; newArray . splice ( fromIndex , 1 ) ; newArray . splice ( toIndex , 0 , element ) ; return newArray ; } export const isObjectLiteral = ( v ) : v is object => { return typeof v === 'object' && v !== null && ! Array . isArray ( v ) && typeof v !== 'function' ; } ; export const defaultNamespaced = ( actionType ) => `normalized/${ actionType }` ;