Your IP : 216.73.216.40


Current Path : /var/www/html/test/wetty/src/server/command/
Upload File :
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];
}