mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 04:34:15 -04:00

the #shared alias used by Nuxt cannot be easily disabled and to prevent breackage with jiti, we make use of it
9 lines
309 B
TypeScript
9 lines
309 B
TypeScript
import type { WithKey } from '#shared/utils/entriesWithKeys.ts';
|
|
|
|
export default <T>(record: Record<string, T> | undefined, key: string | undefined): WithKey<T> | undefined => {
|
|
if (key === undefined || record?.[key] === undefined) {
|
|
return undefined;
|
|
}
|
|
return { ...record[key], key };
|
|
};
|