diff options
| author | Oskar <oskar@mullvad.net> | 2024-09-26 16:38:25 +0200 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-09-30 09:14:13 +0200 |
| commit | a8ffb06d9868870a69305d6bad181d3e0b98e3f4 (patch) | |
| tree | 67f6c2db4e2dbb81c32ef7a471423b1b015915c4 /gui/src | |
| parent | 4749221bb3c4984b75e1bd42bf67c9d4ac362d01 (diff) | |
| download | mullvadvpn-a8ffb06d9868870a69305d6bad181d3e0b98e3f4.tar.xz mullvadvpn-a8ffb06d9868870a69305d6bad181d3e0b98e3f4.zip | |
Rename liftConstraint to unwrapConstraint
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/main/grpc-type-convertions.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gui/src/main/grpc-type-convertions.ts b/gui/src/main/grpc-type-convertions.ts index 31aff75623..caa4e8f160 100644 --- a/gui/src/main/grpc-type-convertions.ts +++ b/gui/src/main/grpc-type-convertions.ts @@ -69,7 +69,7 @@ export class ResponseParseError extends Error { } } -function liftConstraint<T>(constraint: Constraint<T> | undefined): T | undefined { +function unwrapConstraint<T>(constraint: Constraint<T> | undefined): T | undefined { if (constraint !== undefined && constraint !== 'any') { return constraint.only; } @@ -857,7 +857,7 @@ export function convertToRelayConstraints( if (constraints.tunnelProtocol !== 'any') { relayConstraints.setTunnelType(convertToTunnelType(constraints.tunnelProtocol.only)); } - relayConstraints.setLocation(convertToLocation(liftConstraint(constraints.location))); + relayConstraints.setLocation(convertToLocation(unwrapConstraint(constraints.location))); relayConstraints.setWireguardConstraints( convertToWireguardConstraints(constraints.wireguardConstraints), ); @@ -874,7 +874,7 @@ export function convertToNormalBridgeSettings( constraints: IBridgeConstraints, ): grpcTypes.BridgeSettings.BridgeConstraints { const normalBridgeSettings = new grpcTypes.BridgeSettings.BridgeConstraints(); - normalBridgeSettings.setLocation(convertToLocation(liftConstraint(constraints.location))); + normalBridgeSettings.setLocation(convertToLocation(unwrapConstraint(constraints.location))); normalBridgeSettings.setProvidersList(constraints.providers); return normalBridgeSettings; @@ -926,10 +926,10 @@ function convertToOpenVpnConstraints( ): grpcTypes.OpenvpnConstraints | undefined { const openvpnConstraints = new grpcTypes.OpenvpnConstraints(); if (constraints) { - const protocol = liftConstraint(constraints.protocol); + const protocol = unwrapConstraint(constraints.protocol); if (protocol) { const portConstraints = new grpcTypes.TransportPort(); - const port = liftConstraint(constraints.port); + const port = unwrapConstraint(constraints.port); if (port) { portConstraints.setPort(port); } @@ -948,12 +948,12 @@ function convertToWireguardConstraints( if (constraint) { const wireguardConstraints = new grpcTypes.WireguardConstraints(); - const port = liftConstraint(constraint.port); + const port = unwrapConstraint(constraint.port); if (port) { wireguardConstraints.setPort(port); } - const ipVersion = liftConstraint(constraint.ipVersion); + const ipVersion = unwrapConstraint(constraint.ipVersion); if (ipVersion) { const ipVersionProtocol = ipVersion === 'ipv4' ? grpcTypes.IpVersion.V4 : grpcTypes.IpVersion.V6; @@ -964,7 +964,7 @@ function convertToWireguardConstraints( wireguardConstraints.setUseMultihop(constraint.useMultihop); } - const entryLocation = liftConstraint(constraint.entryLocation); + const entryLocation = unwrapConstraint(constraint.entryLocation); if (entryLocation) { const entryLocationConstraint = convertToLocation(entryLocation); wireguardConstraints.setEntryLocation(entryLocationConstraint); |
