| Current Path : /var/www/html/test/wetty/src/server/command/ |
| Current File : /var/www/html/test/wetty/src/server/command/login.ts |
import { isUndefined } from 'lodash';
const getRemoteAddress = (remoteAddress: string): string =>
isUndefined(remoteAddress.split(':')[3])
? 'localhost'
: remoteAddress.split(':')[3];
export default function loginOptions(
command: string,
remoteAddress: string
): string[] {
return command === 'login'
? [command, '-h', getRemoteAddress(remoteAddress)]
: [command];
}