Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Jan 11, 2024
1 parent a977102 commit 5a93827
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ with a value of `'foo'` on the cookie path `/`.

### Getting

The method `getCookie(name)` is used to retrieve a specific cookie from the response object. It accepts a single parameter, `name`, which is a string representing the name of the cookie. This method will always return an array since multiple cookies that share the same name can be set.
The `getCookie(name)` method is designed to fetch a specific cookie from the response object. It takes a single argument, `name`. If no cookies match the provided name, the method returns null. Conversely, if one or more cookies match, it returns an array containing the matching cookies.

#### Securing the cookie

Expand Down
4 changes: 2 additions & 2 deletions types/plugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ declare module "fastify" {
options?: fastifyCookie.CookieSerializeOptions
) => FastifyReply;

export type GetCookieWrapper = (cookieName: string) => Array<{name: string, value: string, options: fastifyCookie.SerializeOptions}> | null;
export type getCookieWrapper = (cookieName: string) => Array<{name: string, value: string, options: fastifyCookie.SerializeOptions}> | null;

interface FastifyReply {
/**
Expand All @@ -74,7 +74,7 @@ declare module "fastify" {
* @name getCookie
* @param name name
*/
getCookie: GetCookieWrapper;
getCookie: getCookieWrapper;

/**
* @alias setCookie
Expand Down
2 changes: 1 addition & 1 deletion types/plugin.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expectError, expectType } from 'tsd';
import * as fastifyCookieStar from '..';
import fastifyCookieCjsImport = require('..');
import fastifyCookieDefault, { fastifyCookie as fastifyCookieNamed } from '..';
import fastify, { FastifyInstance, FastifyReply, setCookieWrapper, } from 'fastify';
import fastify, { FastifyInstance, FastifyReply, setCookieWrapper } from 'fastify';

const fastifyCookieCjs = require('..');

Expand Down

0 comments on commit 5a93827

Please sign in to comment.