import { UMB_CURRENT_USER_CONTEXT } from '../current-user.context.token.js';
import { UmbContextConsumerController } from '../../../../libs/context-api/index.js';
/**
 * Check if the current user is the user with the given unique id
 * @param host
 * @param userUnique
 */
export const isCurrentUser = async (host, userUnique) => {
    const ctrl = new UmbContextConsumerController(host, UMB_CURRENT_USER_CONTEXT);
    const currentUserContext = await ctrl.asPromise().catch(() => undefined);
    ctrl.destroy();
    return await currentUserContext.isUserCurrentUser(userUnique);
};
