mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-13 11:17:26 +02:00
We're migrating to ESM, which will allow us to import the latest versions of our dependencies. Co-Authored-By: Christopher Kolstad <chriswk@getunleash.io>
12 lines
286 B
TypeScript
12 lines
286 B
TypeScript
import { useOptionalPathParam } from './useOptionalPathParam.js';
|
|
|
|
export const useRequiredPathParam = (key: string): string => {
|
|
const value = useOptionalPathParam(key);
|
|
|
|
if (!value) {
|
|
throw new Error(`Missing required path param: ${key}`);
|
|
}
|
|
|
|
return value;
|
|
};
|