import { User } from "@/src/types";

type Params = {
    user: User;
};

export default function grabConnectedWebsocketUserdataIndex({ user }: Params) {
    const user_index = global.WEBSOCKET_CONNECTED_USERS_DATA.findIndex(
        (u) => u.user.id == user.id,
    );

    if (typeof user_index == "number" && user_index >= 0) {
        return user_index;
    }

    return undefined;
}
