import { WebSocketUtils } from '@src/utils/WebSocketUtils' ; param to param from param props example export function attach ( to , from , props ) { props . forEach ( property => { if ( typeof property === 'string' && WebSocketUtils . exists ( from [ property ] ) ) { to [ property ] = from [ property ] ; } else if ( Array . isArray ( property ) ) { if ( from [ property [ 0 ] ] !== undefined ) { if ( from [ property [ 0 ] ] === null ) { delete to [ property [ 0 ] ] ; } else { to [ property [ 0 ] ] = from [ property [ 0 ] ] ; } } else if ( from [ property [ 1 ] ] !== undefined ) { if ( from [ property [ 1 ] ] === null ) { delete to [ property [ 0 ] ] ; } else { to [ property [ 0 ] ] = from [ property [ 1 ] ] ; } } else if ( property [ 2 ] !== undefined && to [ property [ 0 ] ] === undefined ) { to [ property [ 0 ] ] = property [ 2 ] ; } } } ) ; }