Could we maybe just do `if( ('' + attr).indexOf('.') ) {`?