mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
refactor(std/http): Rename validateCookieName param name & JSDoc (#8451)
This commit is contained in:
parent
ec7f1e399e
commit
692322cc28
1 changed files with 5 additions and 6 deletions
|
@ -83,13 +83,12 @@ function toString(cookie: Cookie): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate Cookie property.
|
* Validate Cookie Name.
|
||||||
* @param key Name of the cookie.
|
* @param name Cookie name.
|
||||||
* @param value Value of the cookie.
|
|
||||||
*/
|
*/
|
||||||
function validateCookieName(value: string | undefined | null): void {
|
function validateCookieName(name: string | undefined | null): void {
|
||||||
if (value && !FIELD_CONTENT_REGEXP.test(value)) {
|
if (name && !FIELD_CONTENT_REGEXP.test(name)) {
|
||||||
throw new TypeError(`Invalid cookie name: "${value}".`);
|
throw new TypeError(`Invalid cookie name: "${name}".`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue