You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
838 B

import { isUndefined } from 'lodash';
import { SSH, SSL, Server } from '../interfaces';
import { Options } from './options';
export function unWrapArgs(
args: Options
): { ssh: SSH; server: Server; command?: string; forcessh?: boolean; ssl?: SSL } {
return {
ssh: {
user: args.sshuser,
host: args.sshhost,
auth: args.sshauth,
port: args.sshport,
pass: args.sshpass,
key: args.sshkey,
knownhosts: args.knownhosts,
},
server: {
base: args.base,
host: args.host,
port: args.port,
title: args.title,
bypasshelmet: args.bypasshelmet || false,
},
command: args.command,
forcessh: args.forcessh,
ssl:
isUndefined(args.sslkey) || isUndefined(args.sslcert)
? undefined
: { key: args.sslkey, cert: args.sslcert },
};
}