Class: CookieStore
@sapphire/plugin-api.CookieStore
Hierarchy
Map
<string
,string
>↳
CookieStore
Constructors
constructor
• new CookieStore(request
, response
, secure
, domainOverwrite?
)
Parameters
Name | Type |
---|---|
request | ApiRequest |
response | ApiResponse <IncomingMessage > |
secure | boolean |
domainOverwrite? | null | string |
Overrides
Map<string, string\>.constructor
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:14
Properties
[toStringTag]
• Readonly
[toStringTag]: string
Inherited from
Map.[toStringTag]
Defined in
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137
domain
• Private
domain: string
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:11
request
• Protected
request: ApiRequest
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:9
response
• Protected
response: ApiResponse
<IncomingMessage
>
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:10
secure
• Private
secure: boolean
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:12
size
• Readonly
size: number
Inherited from
Map.size
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:46
[species]
▪ Static
Readonly
[species]: MapConstructor
Inherited from
Map.[species]
Defined in
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:319
octetRegExp
▪ Private
Static
Readonly
octetRegExp: RegExp
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:125
Methods
[iterator]
▸ [iterator](): IterableIterator
<[string
, string
]>
Returns an iterable of entries in the map.
Returns
IterableIterator
<[string
, string
]>
Inherited from
Map.[iterator]
Defined in
node_modules/typescript/lib/lib.es2015.iterable.d.ts:119
add
▸ add(name
, value
, options?
): void
Parameters
Name | Type |
---|---|
name | string |
value | string |
options? | SecureCookieStoreSetOptions |
Returns
void
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:45
clear
▸ clear(): void
Returns
void
Inherited from
Map.clear
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:21
delete
▸ delete(key
): boolean
Parameters
Name | Type |
---|---|
key | string |
Returns
boolean
true if an element in the Map existed and has been removed, or false if the element does not exist.
Inherited from
Map.delete
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:25
entries
▸ entries(): IterableIterator
<[string
, string
]>
Returns an iterable of key, value pairs for every entry in the map.
Returns
IterableIterator
<[string
, string
]>
Inherited from
Map.entries
Defined in
node_modules/typescript/lib/lib.es2015.iterable.d.ts:124
forEach
▸ forEach(callbackfn
, thisArg?
): void
Executes a provided function once per each key/value pair in the Map, in insertion order.
Parameters
Name | Type |
---|---|
callbackfn | (value : string , key : string , map : Map <string , string >) => void |
thisArg? | any |
Returns
void
Inherited from
Map.forEach
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:29
get
▸ get(key
): undefined
| string
Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
Parameters
Name | Type |
---|---|
key | string |
Returns
undefined
| string
Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
Inherited from
Map.get
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:34
getHostDomain
▸ Private
getHostDomain(host
): string
Parses a host using the tldts library to extract the domain. This is used for the domain of the cookie
Parameters
Name | Type | Description |
---|---|---|
host | string | The hot to parse |
Returns
string
Either the host in all lower case or the parsed domain, ready for use on cookies
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:110
has
▸ has(key
): boolean
Parameters
Name | Type |
---|---|
key | string |
Returns
boolean
boolean indicating whether an element with the specified key exists or not.
Inherited from
Map.has
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:38
insert
▸ Protected
insert(name
, entry
): void
Parameters
Name | Type |
---|---|
name | string |
entry | string |
Returns
void
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:53
keys
▸ keys(): IterableIterator
<string
>
Returns an iterable of keys in the map
Returns
IterableIterator
<string
>
Inherited from
Map.keys
Defined in
node_modules/typescript/lib/lib.es2015.iterable.d.ts:129
prepare
▸ Protected
prepare(name
, value
, «destructured»?
): string
Parameters
Name | Type |
---|---|
name | string |
value | string |
«destructured» | SecureCookieStoreSetOptions |
Returns
string
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:68
remove
▸ remove(name
): void
Parameters
Name | Type |
---|---|
name | string |
Returns
void
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:49
set
▸ set(key
, value
): CookieStore
Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
Parameters
Name | Type |
---|---|
key | string |
value | string |
Returns
Inherited from
Map.set
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:42
values
▸ values(): IterableIterator
<string
>
Returns an iterable of values in the map
Returns
IterableIterator
<string
>
Inherited from
Map.values
Defined in
node_modules/typescript/lib/lib.es2015.iterable.d.ts:134
encodeCookieOctet
▸ Private
Static
encodeCookieOctet(value
): string
Parameters
Name | Type |
---|---|
value | string |
Returns
string
Defined in
projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:127