diff options
| author | stonedDiscord <Tukz@gmx.de> | 2022-08-30 20:58:25 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2022-08-30 20:58:25 +0200 |
| commit | 325aa41d1216facbb7228743930a8ad21afec7aa (patch) | |
| tree | 63e454a9f7876f4839abad79482e2171aac04df4 /webAO/utils | |
| parent | 2838fbe91a270ed3d69ac708dac85b108b6f09dc (diff) | |
convert cookie stuff to ts
Diffstat (limited to 'webAO/utils')
| -rw-r--r-- | webAO/utils/getCookie.ts (renamed from webAO/utils/getCookie.js) | 2 | ||||
| -rw-r--r-- | webAO/utils/setCookie.ts (renamed from webAO/utils/setCookie.js) | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/webAO/utils/getCookie.js b/webAO/utils/getCookie.ts index 3be0733..f5b9679 100644 --- a/webAO/utils/getCookie.js +++ b/webAO/utils/getCookie.ts @@ -4,7 +4,7 @@ * https://www.w3schools.com/js/js_cookies.asp * @param {String} cname The name of the cookie to return */ -const getCookie = (cname) => { +const getCookie = (cname: String) => { try { const name = `${cname}=`; const decodedCookie = decodeURIComponent(document.cookie); diff --git a/webAO/utils/setCookie.js b/webAO/utils/setCookie.ts index 9734eae..084fa20 100644 --- a/webAO/utils/setCookie.js +++ b/webAO/utils/setCookie.ts @@ -2,9 +2,9 @@ * set a cookie * the version from w3schools expects these to expire * @param {String} cname The name of the cookie to return - * @param {String} value The value of that cookie option + * @param {any} value The value of that cookie option */ -const setCookie = (cname, value) => { +const setCookie = (cname: String, value: any) => { document.cookie = `${cname}=${value}`; }; export default setCookie; |
