import { getCookie } from '@connect/cookies-lite';
import { ConfigStore } from './stores';

export default function isWithinExperimentPercentage(name) {
    const percentage = ConfigStore.get(['experiment', name, 'percentage']);

    return typeof percentage === 'number' && Number(getCookie('yandexuid').slice(-2)) < percentage;
}
