Skip to content

Commit f97d8a2

Browse files
committed
ref(core): Rename withPathBelowBasePath to stripBasePathFromTunnelPath
1 parent baf80cd commit f97d8a2

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/core/src/utils/managedTunnelDefaults.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
resolveAllowedDsns,
88
resolveTunnelPaths,
99
setServedTunnel,
10-
withPathBelowBasePath,
10+
stripBasePathFromTunnelPath,
1111
} from './tunnel';
1212

1313
/**
@@ -50,7 +50,7 @@ export function applyManagedTunnelDefaults(client: Client | undefined): void {
5050
}
5151

5252
const basePath = normalizeTunnelBasePath(managedTunnelDefaults?.basePath);
53-
const resolved = withPathBelowBasePath(
53+
const resolved = stripBasePathFromTunnelPath(
5454
tunnelOptions.basePath === undefined && basePath ? { ...tunnelOptions, basePath } : tunnelOptions,
5555
);
5656
options._managedTunnel = resolved;

‎packages/core/src/utils/tunnel.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ export function applyTunnelDefaults(
7676
}
7777

7878
if (typeof tunnel === 'string') {
79-
return tunnel.startsWith('/') ? withPathBelowBasePath({ ...defaults, path: tunnel }) : tunnel;
79+
return tunnel.startsWith('/') ? stripBasePathFromTunnelPath({ ...defaults, path: tunnel }) : tunnel;
8080
}
8181

82-
return withPathBelowBasePath({ ...defaults, ...(tunnel === true ? {} : tunnel) });
82+
return stripBasePathFromTunnelPath({ ...defaults, ...(tunnel === true ? {} : tunnel) });
8383
}
8484

8585
/**
@@ -395,7 +395,7 @@ export function resolveAllowedDsns(
395395
/**
396396
* Makes a fixed `path` relative to `basePath`, so one written with the base path isn't served under it twice.
397397
*/
398-
export function withPathBelowBasePath(tunnelOptions: TunnelOptions): TunnelOptions {
398+
export function stripBasePathFromTunnelPath(tunnelOptions: TunnelOptions): TunnelOptions {
399399
const path = tunnelOptions.path && stripBasePath(tunnelOptions.path, tunnelOptions.basePath);
400400

401401
return path ? { ...tunnelOptions, path } : tunnelOptions;

0 commit comments

Comments
 (0)