-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix types in JSDoc #9
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ export default class Cookie | |
* Make a new Cookie instance. | ||
* | ||
* @param {string} namespace | ||
* @return {void} | ||
*/ | ||
constructor(namespace = '') | ||
{ | ||
|
@@ -15,7 +14,7 @@ export default class Cookie | |
* Set a cookie value for the given key. | ||
* | ||
* @param {string} key | ||
* @param {string} value | ||
* @param {string} value | ||
* @param {Date|string|null} expires | ||
* @param {string} path | ||
* @param {object} options | ||
|
@@ -34,17 +33,20 @@ export default class Cookie | |
...options, | ||
}; | ||
|
||
/** @type {string[]} */ | ||
const initialValue = []; | ||
Comment on lines
+36
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sets the type for the empty array. |
||
|
||
document.cookie = Object.entries(cookie) | ||
.reduce((stack, entry) => stack.concat(entry.join('=')), []) | ||
.reduce((stack, entry) => stack.concat(entry.join('=')), initialValue) | ||
.join('; '); | ||
} | ||
|
||
/** | ||
* Get the cookie with the given key. | ||
* | ||
* @param {string} key | ||
* @param {mixed} value | ||
* @return {mixed} | ||
* @param {*} value | ||
* @return {*} | ||
Comment on lines
-46
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PHP: mixed |
||
*/ | ||
get(key, value = null) | ||
{ | ||
|
@@ -59,7 +61,7 @@ export default class Cookie | |
* Determine if the given cookie exists. | ||
* | ||
* @param {string} key | ||
* @return {bool} | ||
* @return {boolean} | ||
*/ | ||
isset(key) | ||
{ | ||
|
@@ -78,7 +80,7 @@ export default class Cookie | |
{ | ||
key = this._qualify(key); | ||
|
||
this.set(key, null, 'Thu, 01 Jan 1970 00:00:01 GMT'); | ||
this.set(key, '', 'Thu, 01 Jan 1970 00:00:01 GMT'); | ||
Comment on lines
-81
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No return tag for constructor.