@@ -48,7 +48,7 @@ export interface FilterCriterion<T> {
4848
4949/**
5050 * Checks if an object is a string
51- * @param str The object to check
51+ * @param str - The object to check
5252 */
5353export function isString ( str : Object ) : str is string {
5454 if ( str && typeof str . valueOf ( ) === 'string' ) {
@@ -59,7 +59,7 @@ export function isString(str: Object): str is string {
5959
6060/**
6161 * Checks if an object is an integer
62- * @param int The object to check
62+ * @param int - The object to check
6363 */
6464export function isInteger ( int : Object ) : int is number {
6565 return (
@@ -69,7 +69,7 @@ export function isInteger(int: Object): int is number {
6969
7070/**
7171 * Checks if the input parameter is a function
72- * @param func The object to check
72+ * @param func - The object to check
7373 */
7474export function isFunction ( func : unknown ) {
7575 if ( func && typeof func === 'function' ) {
@@ -127,7 +127,7 @@ export function fixupDomain(domain: string) {
127127 * in the old URL. It will be returned unless overriden
128128 * by a "refer(r)er" parameter in the querystring.
129129 *
130- * @param string oldLocation Optional.
130+ * @param string - oldLocation Optional.
131131 * @return string The referrer
132132 */
133133export function getReferrer ( oldLocation ?: string ) {
@@ -198,9 +198,9 @@ export function fromQuerystring(field: string, url: string) {
198198/**
199199 * Add a name-value pair to the querystring of a URL
200200 *
201- * @param string url URL to decorate
202- * @param string name Name of the querystring pair
203- * @param string value Value of the querystring pair
201+ * @param string - url URL to decorate
202+ * @param string - name Name of the querystring pair
203+ * @param string - value Value of the querystring pair
204204 */
205205export function decorateQuerystring ( url : string , name : string , value : string ) {
206206 var initialQsParams = name + '=' + value ;
@@ -234,7 +234,7 @@ export function decorateQuerystring(url: string, name: string, value: string) {
234234/**
235235 * Attempt to get a value from localStorage
236236 *
237- * @param string key
237+ * @param string - key
238238 * @return string The value obtained from localStorage, or
239239 * undefined if localStorage is inaccessible
240240 */
@@ -257,9 +257,9 @@ export function attemptGetLocalStorage(key: string) {
257257/**
258258 * Attempt to write a value to localStorage
259259 *
260- * @param string key
261- * @param string value
262- * @param number ttl Time to live in seconds, defaults to 2 years from Date.now()
260+ * @param string - key
261+ * @param string - value
262+ * @param number - ttl Time to live in seconds, defaults to 2 years from Date.now()
263263 * @return boolean Whether the operation succeeded
264264 */
265265export function attemptWriteLocalStorage ( key : string , value : string , ttl = 63072000 ) {
@@ -277,7 +277,7 @@ export function attemptWriteLocalStorage(key: string, value: string, ttl = 63072
277277/**
278278 * Attempt to delete a value from localStorage
279279 *
280- * @param string key
280+ * @param string - key
281281 * @return boolean Whether the operation succeeded
282282 */
283283export function attemptDeleteLocalStorage ( key : string ) {
@@ -294,7 +294,7 @@ export function attemptDeleteLocalStorage(key: string) {
294294/**
295295 * Attempt to get a value from sessionStorage
296296 *
297- * @param string key
297+ * @param string - key
298298 * @return string The value obtained from sessionStorage, or
299299 * undefined if sessionStorage is inaccessible
300300 */
@@ -309,8 +309,8 @@ export function attemptGetSessionStorage(key: string) {
309309/**
310310 * Attempt to write a value to sessionStorage
311311 *
312- * @param string key
313- * @param string value
312+ * @param string - key
313+ * @param string - value
314314 * @return boolean Whether the operation succeeded
315315 */
316316export function attemptWriteSessionStorage ( key : string , value : string ) {
@@ -356,8 +356,8 @@ export function findRootDomain(sameSite: string, secure: boolean) {
356356/**
357357 * Checks whether a value is present within an array
358358 *
359- * @param val The value to check for
360- * @param array The array to check within
359+ * @param val - The value to check for
360+ * @param array - The array to check within
361361 * @return boolean Whether it exists
362362 */
363363export function isValueInArray < T > ( val : T , array : T [ ] ) {
@@ -372,8 +372,8 @@ export function isValueInArray<T>(val: T, array: T[]) {
372372/**
373373 * Deletes an arbitrary cookie by setting the expiration date to the past
374374 *
375- * @param cookieName The name of the cookie to delete
376- * @param domainName The domain the cookie is in
375+ * @param cookieName - The name of the cookie to delete
376+ * @param domainName - The domain the cookie is in
377377 */
378378export function deleteCookie ( cookieName : string , domainName ?: string , sameSite ?: string , secure ?: boolean ) {
379379 cookie ( cookieName , '' , - 1 , '/' , domainName , sameSite , secure ) ;
@@ -382,7 +382,7 @@ export function deleteCookie(cookieName: string, domainName?: string, sameSite?:
382382/**
383383 * Fetches the name of all cookies beginning with a certain prefix
384384 *
385- * @param cookiePrefix The prefix to check for
385+ * @param cookiePrefix - The prefix to check for
386386 * @return array The cookies that begin with the prefix
387387 */
388388export function getCookiesWithPrefix ( cookiePrefix : string ) {
@@ -400,13 +400,13 @@ export function getCookiesWithPrefix(cookiePrefix: string) {
400400 * Get and set the cookies associated with the current document in browser
401401 * This implementation always returns a string, returns the cookie value if only name is specified
402402 *
403- * @param name The cookie name (required)
404- * @param value The cookie value
405- * @param ttl The cookie Time To Live (seconds)
406- * @param path The cookies path
407- * @param domain The cookies domain
408- * @param samesite The cookies samesite attribute
409- * @param secure Boolean to specify if cookie should be secure
403+ * @param name - The cookie name (required)
404+ * @param value - The cookie value
405+ * @param ttl - The cookie Time To Live (seconds)
406+ * @param path - The cookies path
407+ * @param domain - The cookies domain
408+ * @param samesite - The cookies samesite attribute
409+ * @param secure - Boolean to specify if cookie should be secure
410410 * @return string The cookies value
411411 */
412412export function cookie (
@@ -437,7 +437,7 @@ export function cookie(
437437 * Parses an object and returns either the
438438 * integer or undefined.
439439 *
440- * @param obj The object to parse
440+ * @param obj - The object to parse
441441 * @return the result of the parse operation
442442 */
443443export function parseAndValidateInt ( obj : unknown ) {
@@ -449,7 +449,7 @@ export function parseAndValidateInt(obj: unknown) {
449449 * Parses an object and returns either the
450450 * number or undefined.
451451 *
452- * @param obj The object to parse
452+ * @param obj - The object to parse
453453 * @return the result of the parse operation
454454 */
455455export function parseAndValidateFloat ( obj : unknown ) {
@@ -460,10 +460,10 @@ export function parseAndValidateFloat(obj: unknown) {
460460/**
461461 * Convert a criterion object to a filter function
462462 *
463- * @param object criterion Either {allowlist: [array of allowable strings]}
463+ * @param object - criterion Either {allowlist: [array of allowable strings]}
464464 * or {denylist: [array of allowable strings]}
465465 * or {filter: function (elt) {return whether to track the element}
466- * @param boolean byClass Whether to allowlist/denylist based on an element's classes (for forms)
466+ * @param boolean - byClass Whether to allowlist/denylist based on an element's classes (for forms)
467467 * or name attribute (for fields)
468468 */
469469export function getFilterByClass ( criterion ?: FilterCriterion < HTMLElement > | null ) : ( elt : HTMLElement ) => boolean {
@@ -485,7 +485,7 @@ export function getFilterByClass(criterion?: FilterCriterion<HTMLElement> | null
485485/**
486486 * Convert a criterion object to a filter function
487487 *
488- * @param object criterion Either {allowlist: [array of allowable strings]}
488+ * @param object - criterion Either {allowlist: [array of allowable strings]}
489489 * or {denylist: [array of allowable strings]}
490490 * or {filter: function (elt) {return whether to track the element}
491491 */
0 commit comments