2025-04-02 17:07:30 +03:00

15 lines
349 B
TypeScript

import { constructMetadata } from '../shared';
import { ArgsWithMetadata } from './types';
export const withMetadata = <TArgs extends unknown[]>(
args: TArgs,
accessId?: string | null
): ArgsWithMetadata<TArgs> => {
if (accessId) {
args.push(constructMetadata({ accessId }));
}
return args as unknown as ArgsWithMetadata<TArgs>;
};