Skip to main content

Class: CookieStore

@sapphire/plugin-api.CookieStore

Hierarchy

  • Map<string, string>

    CookieStore

Constructors

constructor

new CookieStore(request, response, secure, domainOverwrite?): CookieStore

Parameters

NameType
requestApiRequest
responseApiResponse<IncomingMessage>
secureboolean
domainOverwrite?null | string

Returns

CookieStore

Overrides

Map&lt;string, string&gt;.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:45


[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

NameType
namestring
valuestring
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:20


delete

delete(key): boolean

Parameters

NameType
keystring

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:24


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

NameType
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:28


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

NameType
keystring

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:33


getHostDomain

getHostDomain(host): string

Parses a host using the tldts library to extract the domain. This is used for the domain of the cookie

Parameters

NameTypeDescription
hoststringThe 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

NameType
keystring

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:37


insert

insert(name, entry): void

Parameters

NameType
namestring
entrystring

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

prepare(name, value, «destructured»?): string

Parameters

NameType
namestring
valuestring
«destructured»SecureCookieStoreSetOptions

Returns

string

Defined in

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:68


remove

remove(name): void

Parameters

NameType
namestring

Returns

void

Defined in

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:49


set

set(key, value): this

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

NameType
keystring
valuestring

Returns

this

Inherited from

Map.set

Defined in

node_modules/typescript/lib/lib.es2015.collection.d.ts:41


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

encodeCookieOctet(value): string

Parameters

NameType
valuestring

Returns

string

Defined in

projects/plugins/packages/api/src/lib/structures/api/CookieStore.ts:127


groupBy

groupBy<K, T>(items, keySelector): Map<K, T[]>

Groups members of an iterable according to the return value of the passed callback.

Type parameters

Name
K
T

Parameters

NameTypeDescription
itemsIterable<T>An iterable.
keySelector(item: T, index: number) => KA callback which will be invoked for each item in items.

Returns

Map<K, T[]>

Inherited from

Map.groupBy

Defined in

node_modules/typescript/lib/lib.esnext.collection.d.ts:25