Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

resolve-runtime-suffix.ts

13 lines511 Bytes

1/**
2 * Resolves the runtime suffix based on the provided input or the environment variable `VITE_APP_HISTORY`.
3 *
4 * @param {string} [input] - Optional input to override the environment variable.
5 * @returns {string} Returns 'hash' if the input or `VITE_APP_HISTORY` is set to 'hash', otherwise returns 'browser'.
6 */
7export function resolveRuntimeSuffix(input?: string): string {
8 const value =
9 input === 'hash' || process.env.VITE_APP_HISTORY === 'hash'
10 ? 'hash'
11 : 'browser'
12 return value