mirror of
https://github.com/xfarrow/blink
synced 2024-12-10 23:15:16 +01:00
15 lines
435 B
JavaScript
15 lines
435 B
JavaScript
function getCookie(name) {
|
|
const cookies = document.cookie.split(';');
|
|
for (let i = 0; i < cookies.length; i++) {
|
|
const cookie = cookies[i].trim();
|
|
const [cookieName, cookieValue] = cookie.split('=');
|
|
if (cookieName === name) {
|
|
return decodeURIComponent(cookieValue);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function callbackErrors(errors, func) {
|
|
errors.forEach(error => func(error.msg));
|
|
} |