This commit is contained in:
2026-01-28 00:55:06 +03:00
parent fc033be6a5
commit 25fc82c14a
1642 changed files with 101122 additions and 0 deletions

View File

@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformArguments = void 0;
function transformArguments(mode, options) {
const args = [
'CLIENT',
'TRACKING',
mode ? 'ON' : 'OFF'
];
if (mode) {
if (options?.REDIRECT) {
args.push('REDIRECT', options.REDIRECT.toString());
}
if (isBroadcast(options)) {
args.push('BCAST');
if (options?.PREFIX) {
if (Array.isArray(options.PREFIX)) {
for (const prefix of options.PREFIX) {
args.push('PREFIX', prefix);
}
}
else {
args.push('PREFIX', options.PREFIX);
}
}
}
else if (isOptIn(options)) {
args.push('OPTIN');
}
else if (isOptOut(options)) {
args.push('OPTOUT');
}
if (options?.NOLOOP) {
args.push('NOLOOP');
}
}
return args;
}
exports.transformArguments = transformArguments;
function isBroadcast(options) {
return options?.BCAST === true;
}
function isOptIn(options) {
return options?.OPTIN === true;
}
function isOptOut(options) {
return options?.OPTOUT === true;
}