create project
This commit is contained in:
7
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/cached.d.ts
generated
vendored
Normal file
7
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/cached.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* A simple caching behavior.
|
||||
* We cache the result based on the key `K`
|
||||
* which uses referential equality, to avoid re-computing
|
||||
* the result for the same key.
|
||||
*/
|
||||
export declare function cached<K, V>(generate: (key: K) => V): (key: K) => V;
|
||||
19
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/cached.js
generated
vendored
Normal file
19
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/cached.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.cached = cached;
|
||||
function cached(generate) {
|
||||
let cache = undefined;
|
||||
return (key)=>{
|
||||
if ((cache == null ? void 0 : cache.key) !== key) {
|
||||
cache = {
|
||||
key,
|
||||
value: generate(key)
|
||||
};
|
||||
}
|
||||
return cache.value;
|
||||
};
|
||||
}
|
||||
|
||||
//# sourceMappingURL=cached.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/cached.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/cached.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/web/spec-extension/cookies/cached.ts"],"names":["cached","generate","cache","undefined","key","value"],"mappings":"AAMA;;;;QAAgBA,MAAM,GAANA,MAAM;AAAf,SAASA,MAAM,CAAOC,QAAuB,EAAE;IACpD,IAAIC,KAAK,GAAqCC,SAAS;IACvD,OAAO,CAACC,GAAM,GAAK;QACjB,IAAIF,CAAAA,KAAK,QAAK,GAAVA,KAAAA,CAAU,GAAVA,KAAK,CAAEE,GAAG,CAAA,KAAKA,GAAG,EAAE;YACtBF,KAAK,GAAG;gBAAEE,GAAG;gBAAEC,KAAK,EAAEJ,QAAQ,CAACG,GAAG,CAAC;aAAE;SACtC;QAED,OAAOF,KAAK,CAACG,KAAK,CAAA;KACnB,CAAA;CACF"}
|
||||
3
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/index.d.ts
generated
vendored
Normal file
3
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export type { CookieListItem, RequestCookie, ResponseCookie } from './types';
|
||||
export { RequestCookies } from './request-cookies';
|
||||
export { ResponseCookies } from './response-cookies';
|
||||
20
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/index.js
generated
vendored
Normal file
20
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "RequestCookies", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _requestCookies.RequestCookies;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, "ResponseCookies", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return _responseCookies.ResponseCookies;
|
||||
}
|
||||
});
|
||||
var _requestCookies = require("./request-cookies");
|
||||
var _responseCookies = require("./response-cookies");
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/index.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/web/spec-extension/cookies/index.ts"],"names":["RequestCookies","ResponseCookies"],"mappings":"AACA;;;;+BACSA,gBAAc;;;+BAAdA,cAAc;;;+BACdC,iBAAe;;;gCAAfA,eAAe;;;8BADO,mBAAmB;+BAClB,oBAAoB"}
|
||||
28
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/request-cookies.d.ts
generated
vendored
Normal file
28
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/request-cookies.d.ts
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { RequestCookie } from './types';
|
||||
/**
|
||||
* A class for manipulating {@link Request} cookies (`Cookie` header).
|
||||
*/
|
||||
export declare class RequestCookies {
|
||||
readonly _headers: Headers;
|
||||
_parsed: Map<string, RequestCookie>;
|
||||
constructor(requestHeaders: Headers);
|
||||
[Symbol.iterator](): IterableIterator<[string, RequestCookie]>;
|
||||
/**
|
||||
* The amount of cookies received from the client
|
||||
*/
|
||||
get size(): number;
|
||||
get(...args: [name: string] | [RequestCookie]): RequestCookie | undefined;
|
||||
getAll(...args: [name: string] | [RequestCookie] | []): RequestCookie[];
|
||||
has(name: string): boolean;
|
||||
set(...args: [key: string, value: string] | [options: RequestCookie]): this;
|
||||
/**
|
||||
* Delete the cookies matching the passed name or names in the request.
|
||||
*/
|
||||
delete(
|
||||
/** Name or names of the cookies to be deleted */
|
||||
names: string | string[]): boolean | boolean[];
|
||||
/**
|
||||
* Delete all the cookies in the cookies in the request.
|
||||
*/
|
||||
clear(): this;
|
||||
}
|
||||
80
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/request-cookies.js
generated
vendored
Normal file
80
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/request-cookies.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _serialize = require("./serialize");
|
||||
class RequestCookies {
|
||||
_parsed = new Map();
|
||||
constructor(requestHeaders){
|
||||
this._headers = requestHeaders;
|
||||
const header = requestHeaders.get("cookie");
|
||||
if (header) {
|
||||
const parsed = (0, _serialize).parseCookieString(header);
|
||||
for (const [name, value] of parsed){
|
||||
this._parsed.set(name, {
|
||||
name,
|
||||
value
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this._parsed[Symbol.iterator]();
|
||||
}
|
||||
/**
|
||||
* The amount of cookies received from the client
|
||||
*/ get size() {
|
||||
return this._parsed.size;
|
||||
}
|
||||
get(...args) {
|
||||
const name = typeof args[0] === "string" ? args[0] : args[0].name;
|
||||
return this._parsed.get(name);
|
||||
}
|
||||
getAll(...args) {
|
||||
var ref;
|
||||
const all = Array.from(this._parsed);
|
||||
if (!args.length) {
|
||||
return all.map(([_, value])=>value);
|
||||
}
|
||||
const name = typeof args[0] === "string" ? args[0] : (ref = args[0]) == null ? void 0 : ref.name;
|
||||
return all.filter(([n])=>n === name).map(([_, value])=>value);
|
||||
}
|
||||
has(name) {
|
||||
return this._parsed.has(name);
|
||||
}
|
||||
set(...args) {
|
||||
const [name, value] = args.length === 1 ? [
|
||||
args[0].name,
|
||||
args[0].value
|
||||
] : args;
|
||||
const map = this._parsed;
|
||||
map.set(name, {
|
||||
name,
|
||||
value
|
||||
});
|
||||
this._headers.set("cookie", Array.from(map).map(([_, v])=>(0, _serialize).serialize(v)).join("; "));
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Delete the cookies matching the passed name or names in the request.
|
||||
*/ delete(/** Name or names of the cookies to be deleted */ names) {
|
||||
const map = this._parsed;
|
||||
const result = !Array.isArray(names) ? map.delete(names) : names.map((name)=>map.delete(name));
|
||||
this._headers.set("cookie", Array.from(map).map(([_, value])=>(0, _serialize).serialize(value)).join("; "));
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Delete all the cookies in the cookies in the request.
|
||||
*/ clear() {
|
||||
this.delete(Array.from(this._parsed.keys()));
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Format the cookies in the request as a string for logging
|
||||
*/ [Symbol.for("edge-runtime.inspect.custom")]() {
|
||||
return `RequestCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
||||
}
|
||||
}
|
||||
exports.RequestCookies = RequestCookies;
|
||||
|
||||
//# sourceMappingURL=request-cookies.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/request-cookies.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/request-cookies.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/web/spec-extension/cookies/request-cookies.ts"],"names":["RequestCookies","_parsed","Map","constructor","requestHeaders","_headers","header","get","parsed","parseCookieString","name","value","set","Symbol","iterator","size","args","getAll","all","Array","from","length","map","_","filter","n","has","v","serialize","join","delete","names","result","isArray","clear","keys","for","JSON","stringify","Object","fromEntries"],"mappings":"AAAA;;;;AAC6C,IAAA,UAAa,WAAb,aAAa,CAAA;AAKnD,MAAMA,cAAc;IAEzBC,OAAO,GAA+B,IAAIC,GAAG,EAAE,CAAA;IAE/CC,YAAYC,cAAuB,CAAE;QACnC,IAAI,CAACC,QAAQ,GAAGD,cAAc;QAC9B,MAAME,MAAM,GAAGF,cAAc,CAACG,GAAG,CAAC,QAAQ,CAAC;QAC3C,IAAID,MAAM,EAAE;YACV,MAAME,MAAM,GAAGC,CAAAA,GAAAA,UAAiB,AAAQ,CAAA,kBAAR,CAACH,MAAM,CAAC;YACxC,KAAK,MAAM,CAACI,IAAI,EAAEC,KAAK,CAAC,IAAIH,MAAM,CAAE;gBAClC,IAAI,CAACP,OAAO,CAACW,GAAG,CAACF,IAAI,EAAE;oBAAEA,IAAI;oBAAEC,KAAK;iBAAE,CAAC;aACxC;SACF;KACF;IAED,CAACE,MAAM,CAACC,QAAQ,CAAC,GAAG;QAClB,OAAO,IAAI,CAACb,OAAO,CAACY,MAAM,CAACC,QAAQ,CAAC,EAAE,CAAA;KACvC;IAED;;KAEG,CACH,IAAIC,IAAI,GAAW;QACjB,OAAO,IAAI,CAACd,OAAO,CAACc,IAAI,CAAA;KACzB;IAEDR,GAAG,CAAC,GAAGS,IAAI,AAAkC,EAAE;QAC7C,MAAMN,IAAI,GAAG,OAAOM,I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OAAO,CAAC,eAAe,EAAEC,IAAI,CAACC,SAAS,CAACC,MAAM,CAACC,WAAW,CAAC,IAAI,CAACvC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;KAC5E;CACF;QA/FYD,cAAc,GAAdA,cAAc"}
|
||||
27
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/response-cookies.d.ts
generated
vendored
Normal file
27
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/response-cookies.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { ResponseCookie } from './types';
|
||||
/**
|
||||
* A class for manipulating {@link Response} cookies (`Set-Cookie` header).
|
||||
* Loose implementation of the experimental [Cookie Store API](https://wicg.github.io/cookie-store/#dictdef-cookie)
|
||||
* The main difference is `ResponseCookies` methods do not return a Promise.
|
||||
*/
|
||||
export declare class ResponseCookies {
|
||||
readonly _headers: Headers;
|
||||
_parsed: Map<string, ResponseCookie>;
|
||||
constructor(responseHeaders: Headers);
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
|
||||
*/
|
||||
get(...args: [key: string] | [options: ResponseCookie]): ResponseCookie | undefined;
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
|
||||
*/
|
||||
getAll(...args: [key: string] | [options: ResponseCookie] | []): ResponseCookie[];
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
|
||||
*/
|
||||
set(...args: [key: string, value: string, cookie?: Partial<ResponseCookie>] | [options: ResponseCookie]): this;
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
|
||||
*/
|
||||
delete(...args: [key: string] | [options: ResponseCookie]): this;
|
||||
}
|
||||
88
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/response-cookies.js
generated
vendored
Normal file
88
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/response-cookies.js
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
var _serialize = require("./serialize");
|
||||
function replace(bag, headers) {
|
||||
headers.delete("set-cookie");
|
||||
for (const [, value] of bag){
|
||||
const serialized = (0, _serialize).serialize(value);
|
||||
headers.append("set-cookie", serialized);
|
||||
}
|
||||
}
|
||||
function normalizeCookie(cookie = {
|
||||
name: "",
|
||||
value: ""
|
||||
}) {
|
||||
if (cookie.maxAge) {
|
||||
cookie.expires = new Date(Date.now() + cookie.maxAge * 1000);
|
||||
}
|
||||
if (cookie.path === null || cookie.path === undefined) {
|
||||
cookie.path = "/";
|
||||
}
|
||||
return cookie;
|
||||
}
|
||||
class ResponseCookies {
|
||||
_parsed = new Map();
|
||||
constructor(responseHeaders){
|
||||
this._headers = responseHeaders;
|
||||
// @ts-expect-error See https://github.com/whatwg/fetch/issues/973
|
||||
const headers = this._headers.getAll("set-cookie");
|
||||
for (const header of headers){
|
||||
const parsed = (0, _serialize).parseSetCookieString(header);
|
||||
if (parsed) {
|
||||
this._parsed.set(parsed.name, parsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-get CookieStore#get} without the Promise.
|
||||
*/ get(...args) {
|
||||
const key = typeof args[0] === "string" ? args[0] : args[0].name;
|
||||
return this._parsed.get(key);
|
||||
}
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-getAll CookieStore#getAll} without the Promise.
|
||||
*/ getAll(...args) {
|
||||
var ref;
|
||||
const all = Array.from(this._parsed.values());
|
||||
if (!args.length) {
|
||||
return all;
|
||||
}
|
||||
const key = typeof args[0] === "string" ? args[0] : (ref = args[0]) == null ? void 0 : ref.name;
|
||||
return all.filter((c)=>c.name === key);
|
||||
}
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-set CookieStore#set} without the Promise.
|
||||
*/ set(...args) {
|
||||
const [name, value, cookie] = args.length === 1 ? [
|
||||
args[0].name,
|
||||
args[0].value,
|
||||
args[0]
|
||||
] : args;
|
||||
const map = this._parsed;
|
||||
map.set(name, normalizeCookie({
|
||||
name,
|
||||
value,
|
||||
...cookie
|
||||
}));
|
||||
replace(map, this._headers);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#CookieStore-delete CookieStore#delete} without the Promise.
|
||||
*/ delete(...args) {
|
||||
const name = typeof args[0] === "string" ? args[0] : args[0].name;
|
||||
return this.set({
|
||||
name,
|
||||
value: "",
|
||||
expires: new Date(0)
|
||||
});
|
||||
}
|
||||
[Symbol.for("edge-runtime.inspect.custom")]() {
|
||||
return `ResponseCookies ${JSON.stringify(Object.fromEntries(this._parsed))}`;
|
||||
}
|
||||
}
|
||||
exports.ResponseCookies = ResponseCookies;
|
||||
|
||||
//# sourceMappingURL=response-cookies.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/response-cookies.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/response-cookies.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/web/spec-extension/cookies/response-cookies.ts"],"names":["replace","bag","headers","delete","value","serialized","serialize","append","normalizeCookie","cookie","name","maxAge","expires","Date","now","path","undefined","ResponseCookies","_parsed","Map","constructor","responseHeaders","_headers","getAll","header","parsed","parseSetCookieString","set","get","args","key","all","Array","from","values","length","filter","c","map","Symbol","for","JSON","stringify","Object","fromEntries"],"mappings":"AAAA;;;;AACgD,IAAA,UAAa,WAAb,aAAa,CAAA;AAE7D,SAASA,OAAO,CAACC,GAAgC,EAAEC,OAAgB,EAAE;IACnEA,OAAO,CAACC,MAAM,CAAC,YAAY,CAAC;IAC5B,KAAK,MAAM,GAAGC,KAAK,CAAC,IAAIH,GAAG,CAAE;QAC3B,MA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AAG0B,IAAI,AAA2C,EAAQ;QAC/D,MAAMnB,IAAI,GAAG,OAAOmB,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,GAAGA,IAAI,CAAC,CAAC,CAAC,GAAGA,IAAI,CAAC,CAAC,CAAC,CAACnB,IAAI;QACjE,OAAO,IAAI,CAACiB,GAAG,CAAC;YAAEjB,IAAI;YAAEN,KAAK,EAAE,EAAE;YAAEQ,OAAO,EAAE,IAAIC,IAAI,CAAC,CAAC,CAAC;SAAE,CAAC,CAAA;KAC3D;IAED,CAAC0B,MAAM,CAACC,GAAG,CAAC,6BAA6B,CAAC,CAAC,GAAG;QAC5C,OAAO,CAAC,gBAAgB,EAAEC,IAAI,CAACC,SAAS,CAACC,MAAM,CAACC,WAAW,CAAC,IAAI,CAAC1B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;KAC7E;CACF;QArEYD,eAAe,GAAfA,eAAe"}
|
||||
10
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/serialize.d.ts
generated
vendored
Normal file
10
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/serialize.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { RequestCookie, ResponseCookie } from './types';
|
||||
export declare function serialize(c: ResponseCookie | RequestCookie): string;
|
||||
/**
|
||||
* Parse a `Cookie` or `Set-Cookie header value
|
||||
*/
|
||||
export declare function parseCookieString(cookie: string): Map<string, string>;
|
||||
/**
|
||||
* Parse a `Set-Cookie` header value
|
||||
*/
|
||||
export declare function parseSetCookieString(setCookie: string): undefined | ResponseCookie;
|
||||
80
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/serialize.js
generated
vendored
Normal file
80
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/serialize.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.serialize = serialize;
|
||||
exports.parseCookieString = parseCookieString;
|
||||
exports.parseSetCookieString = parseSetCookieString;
|
||||
const SAME_SITE = [
|
||||
"strict",
|
||||
"lax",
|
||||
"none"
|
||||
];
|
||||
function parseSameSite(string) {
|
||||
string = string.toLowerCase();
|
||||
return SAME_SITE.includes(string) ? string : undefined;
|
||||
}
|
||||
function compact(t) {
|
||||
const newT = {};
|
||||
for(const key in t){
|
||||
if (t[key]) {
|
||||
newT[key] = t[key];
|
||||
}
|
||||
}
|
||||
return newT;
|
||||
}
|
||||
function serialize(c) {
|
||||
const attrs = [
|
||||
"path" in c && c.path && `Path=${c.path}`,
|
||||
"expires" in c && c.expires && `Expires=${c.expires.toUTCString()}`,
|
||||
"maxAge" in c && c.maxAge && `Max-Age=${c.maxAge}`,
|
||||
"domain" in c && c.domain && `Domain=${c.domain}`,
|
||||
"secure" in c && c.secure && "Secure",
|
||||
"httpOnly" in c && c.httpOnly && "HttpOnly",
|
||||
"sameSite" in c && c.sameSite && `SameSite=${c.sameSite}`,
|
||||
].filter(Boolean);
|
||||
return `${c.name}=${encodeURIComponent(c.value ?? "")}; ${attrs.join("; ")}`;
|
||||
}
|
||||
function parseCookieString(cookie) {
|
||||
const map = new Map();
|
||||
for (const pair of cookie.split(/; */)){
|
||||
if (!pair) continue;
|
||||
const [key, value] = pair.split("=", 2);
|
||||
map.set(key, decodeURIComponent(value ?? "true"));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
function parseSetCookieString(setCookie) {
|
||||
if (!setCookie) {
|
||||
return undefined;
|
||||
}
|
||||
const [[name, value], ...attributes] = parseCookieString(setCookie);
|
||||
const { domain , expires , httponly , maxage , path , samesite , secure } = Object.fromEntries(attributes.map(([key, v])=>[
|
||||
key.toLowerCase(),
|
||||
v
|
||||
]));
|
||||
const cookie = {
|
||||
name,
|
||||
value: decodeURIComponent(value),
|
||||
domain,
|
||||
...expires && {
|
||||
expires: new Date(expires)
|
||||
},
|
||||
...httponly && {
|
||||
httpOnly: true
|
||||
},
|
||||
...typeof maxage === "string" && {
|
||||
maxAge: Number(maxage)
|
||||
},
|
||||
path,
|
||||
...samesite && {
|
||||
sameSite: parseSameSite(samesite)
|
||||
},
|
||||
...secure && {
|
||||
secure: true
|
||||
}
|
||||
};
|
||||
return compact(cookie);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=serialize.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/serialize.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/serialize.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/web/spec-extension/cookies/serialize.ts"],"names":["serialize","parseCookieString","parseSetCookieString","SAME_SITE","parseSameSite","string","toLowerCase","includes","undefined","compact","t","newT","key","c","attrs","path","expires","toUTCString","maxAge","domain","secure","httpOnly","sameSite","filter","Boolean","name","encodeURIComponent","value","join","cookie","map","Map","pair","split","set","decodeURIComponent","setCookie","attributes","httponly","maxage","samesite","Object","fromEntries","v","Date","Number"],"mappings":"AAAA;;;;QAoBgBA,SAAS,GAATA,SAAS;QAiBTC,iBAAiB,GAAjBA,iBAAiB;QAejBC,oBAAoB,GAApBA,oBAAoB;AAlDpC,MAAMC,SAAS,GAAiC;IAAC,QAAQ;IAAE,KAAK;IAAE,MAAM;CAAC;AACzE,SAASC,aAAa,CAACC,MAAc,EAA8B;IACjEA,MAAM,GAAGA,MAAM,CAACC,WAAW,EAAE;IAC7B,OAAOH,SAAS,CAACI,QAAQ,CAACF,MAAM,CAAQ,GACnCA,MAAM,GACPG,SAAS,CAAA;CACd;AAED,SAASC,OAAO,CAAIC,CAAI,EAAK;IAC3B,MAAMC,IAAI,GAAG,EAAE,AAAc;IAC7B,IAAK,MAAMC,GAAG,IAAIF,CAAC,CAAE;QACnB,IAAIA,CAAC,CAACE,GAAG,CAAC,EAAE;YACVD,IAAI,CAACC,GAAG,CAAC,GAAGF,CAAC,CAACE,GAAG,CAAC;SACnB;KACF;IACD,OAAOD,IAAI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AED,OAAOX,OAAO,CAACoB,MAAM,CAAC,CAAA;CACvB"}
|
||||
101
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/types.d.ts
generated
vendored
Normal file
101
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/types.d.ts
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
export interface CookieSerializeOptions {
|
||||
/**
|
||||
* Specifies the value for the Domain Set-Cookie attribute. By default, no
|
||||
* domain is set, and most clients will consider the cookie to apply to only
|
||||
* the current domain.
|
||||
*/
|
||||
domain?: string;
|
||||
/**
|
||||
* Specifies a function that will be used to encode a cookie's value. Since
|
||||
* value of a cookie has a limited character set (and must be a simple
|
||||
* string), this function can be used to encode a value into a string suited
|
||||
* for a cookie's value.
|
||||
*
|
||||
* The default function is the global `encodeURIComponent`, which will
|
||||
* encode a JavaScript string into UTF-8 byte sequences and then URL-encode
|
||||
* any that fall outside of the cookie range.
|
||||
*/
|
||||
encode?(val: string): string;
|
||||
/**
|
||||
* Specifies the `Date` object to be the value for the `Expires`
|
||||
* `Set-Cookie` attribute. By default, no expiration is set, and most
|
||||
* clients will consider this a "non-persistent cookie" and will delete it
|
||||
* on a condition like exiting a web browser application.
|
||||
*
|
||||
* *Note* the cookie storage model specification states that if both
|
||||
* `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is
|
||||
* possible not all clients by obey this, so if both are set, they should
|
||||
* point to the same date and time.
|
||||
*/
|
||||
expires?: Date;
|
||||
/**
|
||||
* Specifies the boolean value for the `HttpOnly` `Set-Cookie` attribute.
|
||||
* When truthy, the `HttpOnly` attribute is set, otherwise it is not. By
|
||||
* default, the `HttpOnly` attribute is not set.
|
||||
*
|
||||
* *Note* be careful when setting this to true, as compliant clients will
|
||||
* not allow client-side JavaScript to see the cookie in `document.cookie`.
|
||||
*/
|
||||
httpOnly?: boolean;
|
||||
/**
|
||||
* Specifies the number (in seconds) to be the value for the `Max-Age`
|
||||
* `Set-Cookie` attribute. The given number will be converted to an integer
|
||||
* by rounding down. By default, no maximum age is set.
|
||||
*
|
||||
* *Note* the cookie storage model specification states that if both
|
||||
* `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is
|
||||
* possible not all clients by obey this, so if both are set, they should
|
||||
* point to the same date and time.
|
||||
*/
|
||||
maxAge?: number;
|
||||
/**
|
||||
* Specifies the value for the `Path` `Set-Cookie` attribute. By default,
|
||||
* the path is considered the "default path".
|
||||
*/
|
||||
path?: string;
|
||||
/**
|
||||
* Specifies the boolean or string to be the value for the `SameSite`
|
||||
* `Set-Cookie` attribute.
|
||||
*
|
||||
* - `true` will set the `SameSite` attribute to `Strict` for strict same
|
||||
* site enforcement.
|
||||
* - `false` will not set the `SameSite` attribute.
|
||||
* - `'lax'` will set the `SameSite` attribute to Lax for lax same site
|
||||
* enforcement.
|
||||
* - `'strict'` will set the `SameSite` attribute to Strict for strict same
|
||||
* site enforcement.
|
||||
* - `'none'` will set the SameSite attribute to None for an explicit
|
||||
* cross-site cookie.
|
||||
*/
|
||||
sameSite?: boolean | 'lax' | 'strict' | 'none';
|
||||
/**
|
||||
* Specifies the boolean value for the `Secure` `Set-Cookie` attribute. When
|
||||
* truthy, the `Secure` attribute is set, otherwise it is not. By default,
|
||||
* the `Secure` attribute is not set.
|
||||
*
|
||||
* *Note* be careful when setting this to `true`, as compliant clients will
|
||||
* not send the cookie back to the server in the future if the browser does
|
||||
* not have an HTTPS connection.
|
||||
*/
|
||||
secure?: boolean;
|
||||
}
|
||||
/**
|
||||
* {@link https://wicg.github.io/cookie-store/#dictdef-cookielistitem CookieListItem}
|
||||
* as specified by W3C.
|
||||
*/
|
||||
export interface CookieListItem extends Partial<Pick<CookieSerializeOptions, 'domain' | 'path' | 'expires' | 'secure' | 'sameSite'>> {
|
||||
/** A string with the name of a cookie. */
|
||||
name: string;
|
||||
/** A string containing the value of the cookie. */
|
||||
value: string;
|
||||
}
|
||||
/**
|
||||
* Superset of {@link CookieListItem} extending it with
|
||||
* the `httpOnly`, `maxAge` and `priority` properties.
|
||||
*/
|
||||
export declare type ResponseCookie = CookieListItem & Partial<Pick<CookieSerializeOptions, 'httpOnly' | 'maxAge'>>;
|
||||
/**
|
||||
* Subset of {@link CookieListItem}, only containing `name` and `value`
|
||||
* since other cookie attributes aren't be available on a `Request`.
|
||||
*/
|
||||
export declare type RequestCookie = Pick<CookieListItem, 'name' | 'value'>;
|
||||
6
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/types.js
generated
vendored
Normal file
6
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/types.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/types.js.map
generated
vendored
Normal file
1
kitabcitab/node_modules/next/dist/server/web/spec-extension/cookies/types.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../../../server/web/spec-extension/cookies/types.ts"],"names":[],"mappings":"AAAA"}
|
||||
Reference in New Issue
Block a user