{"size": 804, "ext": "js", "max_stars_repo_path": "resources/js/util.js", "max_stars_repo_name": "tuyenj/photoscolection", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/util.js", "max_issues_repo_name": "tuyenj/photoscolection", "max_issues_repo_issues_event_min_datetime": "2021-05-10T20:51:57.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T21:10:17.000Z", "max_forks_repo_path": "resources/js/util.js", "max_forks_repo_name": "tuyenj/photoscolection", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 6, "max_forks_count": null, "avg_line_length": 22.3333333333, "max_line_length": 104, "alphanum_fraction": 0.592039801}
/**
 * クッキーの値を取得する
 * @param {String} searchKey 検索するキー
 * @returns {String} キーに対応する値
 */
export function getCookieValue (searchKey) {
    if (typeof searchKey === 'undefined') {
        return '';
    }

    let val = '';

    document.cookie.split(';').forEach(cookie => {
        const [key, value] = cookie.split('=');
        if (key === searchKey) {
            return val = value;
        }
    });

    return val;
}
/**
 * パラメーターから指定の値を取得する
 * @param {Object} params
 * @param {string} paramName
 * @param {Object} defaultValue
 * @returns {Object}
 */
export function findParameter(params, paramName, defaultValue = '') {
    if (typeof params === 'object' && paramName in params && typeof params[paramName] !== 'undefined') {
        return params[paramName];
    }

    return defaultValue;
}
