Core / locale: consumeChoiceHandoff
Functions, types, and exports for Core / locale: consumeChoiceHandoff.
Page outline
Remove and validate a locale choice handoff from a search string. The caller remains responsible for persisting the accepted choice and updating the URL.
import { consumeChoiceHandoff } from "@palamedes/core/locale"
consumeChoiceHandoff<TLocale extends string>(options: {
search?: string | null;
currentLocale: TLocale;
locales: readonly TLocale[];
parameterName?: string;
}): {
choice: TLocale | null;
search: string;
}
Parameters
| Name | Type | Required |
|---|---|---|
options | { search?: string | null; currentLocale: TLocale; locales: readonly TLocale[]; parameterName?: string } | Yes |
Returns
{ choice: TLocale | null; search: string }
Last updated: November 1, 2026