added doga
This commit is contained in:
9
25_02_24/node_modules/@tinyhttp/req/dist/accepts.d.ts
generated
vendored
Normal file
9
25_02_24/node_modules/@tinyhttp/req/dist/accepts.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { IncomingMessage } from 'node:http';
|
||||
type Request = Pick<IncomingMessage, 'headers'>;
|
||||
type AcceptReturns = string | boolean | string[];
|
||||
export declare const getAccepts: (req: Request) => (...types: string[]) => AcceptReturns;
|
||||
export declare const getAcceptsEncodings: (req: Request) => (...encodings: string[]) => AcceptReturns;
|
||||
export declare const getAcceptsCharsets: (req: Request) => (...charsets: string[]) => AcceptReturns;
|
||||
export declare const getAcceptsLanguages: (req: Request) => (...languages: string[]) => AcceptReturns;
|
||||
export {};
|
||||
//# sourceMappingURL=accepts.d.ts.map
|
||||
1
25_02_24/node_modules/@tinyhttp/req/dist/accepts.d.ts.map
generated
vendored
Normal file
1
25_02_24/node_modules/@tinyhttp/req/dist/accepts.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"accepts.d.ts","sourceRoot":"","sources":["../src/accepts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAGhD,KAAK,OAAO,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAA;AAE/C,KAAK,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAA;AAEhD,eAAO,MAAM,UAAU,QACf,OAAO,gBACF,MAAM,EAAE,KAAG,aACS,CAAA;AAEjC,eAAO,MAAM,mBAAmB,QACxB,OAAO,oBACE,MAAM,EAAE,KAAG,aACa,CAAA;AAEzC,eAAO,MAAM,kBAAkB,QACvB,OAAO,mBACC,MAAM,EAAE,KAAG,aACY,CAAA;AAEvC,eAAO,MAAM,mBAAmB,QACxB,OAAO,oBACE,MAAM,EAAE,KAAG,aACa,CAAA"}
|
||||
6
25_02_24/node_modules/@tinyhttp/req/dist/accepts.js
generated
vendored
Normal file
6
25_02_24/node_modules/@tinyhttp/req/dist/accepts.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Accepts } from '@tinyhttp/accepts';
|
||||
export const getAccepts = (req) => (...types) => new Accepts(req).types(types);
|
||||
export const getAcceptsEncodings = (req) => (...encodings) => new Accepts(req).encodings(encodings);
|
||||
export const getAcceptsCharsets = (req) => (...charsets) => new Accepts(req).charsets(charsets);
|
||||
export const getAcceptsLanguages = (req) => (...languages) => new Accepts(req).languages(languages);
|
||||
//# sourceMappingURL=accepts.js.map
|
||||
1
25_02_24/node_modules/@tinyhttp/req/dist/accepts.js.map
generated
vendored
Normal file
1
25_02_24/node_modules/@tinyhttp/req/dist/accepts.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"accepts.js","sourceRoot":"","sources":["../src/accepts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAM3C,MAAM,CAAC,MAAM,UAAU,GACrB,CAAC,GAAY,EAAE,EAAE,CACjB,CAAC,GAAG,KAAe,EAAiB,EAAE,CACpC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAEjC,MAAM,CAAC,MAAM,mBAAmB,GAC9B,CAAC,GAAY,EAAE,EAAE,CACjB,CAAC,GAAG,SAAmB,EAAiB,EAAE,CACxC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAC7B,CAAC,GAAY,EAAE,EAAE,CACjB,CAAC,GAAG,QAAkB,EAAiB,EAAE,CACvC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;AAEvC,MAAM,CAAC,MAAM,mBAAmB,GAC9B,CAAC,GAAY,EAAE,EAAE,CACjB,CAAC,GAAG,SAAmB,EAAiB,EAAE,CACxC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA"}
|
||||
6
25_02_24/node_modules/@tinyhttp/req/dist/fresh.d.ts
generated
vendored
Normal file
6
25_02_24/node_modules/@tinyhttp/req/dist/fresh.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { IncomingHttpHeaders, OutgoingHttpHeaders } from 'node:http';
|
||||
/**
|
||||
* Check freshness of the response using request and response headers.
|
||||
*/
|
||||
export declare function fresh(reqHeaders: IncomingHttpHeaders, resHeaders: OutgoingHttpHeaders): boolean;
|
||||
//# sourceMappingURL=fresh.d.ts.map
|
||||
1
25_02_24/node_modules/@tinyhttp/req/dist/fresh.d.ts.map
generated
vendored
Normal file
1
25_02_24/node_modules/@tinyhttp/req/dist/fresh.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fresh.d.ts","sourceRoot":"","sources":["../src/fresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AA8BzE;;GAEG;AACH,wBAAgB,KAAK,CAAC,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,mBAAmB,WAwBrF"}
|
||||
51
25_02_24/node_modules/@tinyhttp/req/dist/fresh.js
generated
vendored
Normal file
51
25_02_24/node_modules/@tinyhttp/req/dist/fresh.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
const CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/;
|
||||
const compareETags = (etag, str) => str === etag || str === `W/${etag}` || `W/${str}` === etag;
|
||||
function isStale(etag, noneMatch) {
|
||||
let start = 0;
|
||||
let end = 0;
|
||||
for (let i = 0, len = noneMatch.length; i < len; i++) {
|
||||
switch (noneMatch.charCodeAt(i)) {
|
||||
case 0x20 /* */:
|
||||
if (start === end)
|
||||
start = end = i + 1;
|
||||
break;
|
||||
case 0x2c /* , */:
|
||||
if (compareETags(etag, noneMatch.substring(start, end)))
|
||||
return false;
|
||||
start = end = i + 1;
|
||||
break;
|
||||
default:
|
||||
end = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (compareETags(etag, noneMatch.substring(start, end)))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Check freshness of the response using request and response headers.
|
||||
*/
|
||||
export function fresh(reqHeaders, resHeaders) {
|
||||
const modifiedSince = reqHeaders['if-modified-since'];
|
||||
const noneMatch = reqHeaders['if-none-match'];
|
||||
if (!modifiedSince && !noneMatch)
|
||||
return false;
|
||||
const cacheControl = reqHeaders['cache-control'];
|
||||
if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl))
|
||||
return false;
|
||||
// if-none-match
|
||||
if (noneMatch && noneMatch !== '*') {
|
||||
const etag = resHeaders.etag;
|
||||
if (!etag || isStale(etag, noneMatch))
|
||||
return false;
|
||||
}
|
||||
// if-modified-since
|
||||
if (modifiedSince) {
|
||||
const lastModified = resHeaders['last-modified'];
|
||||
if (!lastModified || !(Date.parse(lastModified) <= Date.parse(modifiedSince)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//# sourceMappingURL=fresh.js.map
|
||||
1
25_02_24/node_modules/@tinyhttp/req/dist/fresh.js.map
generated
vendored
Normal file
1
25_02_24/node_modules/@tinyhttp/req/dist/fresh.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"fresh.js","sourceRoot":"","sources":["../src/fresh.ts"],"names":[],"mappings":"AAEA,MAAM,6BAA6B,GAAG,gCAAgC,CAAA;AAEtE,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,GAAW,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,KAAK,IAAI,EAAE,IAAI,KAAK,GAAG,EAAE,KAAK,IAAI,CAAA;AAE9G,SAAS,OAAO,C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AA;IAElF,gBAAgB;IAChB,IAAI,SAAS,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,UAAU,CAAC,IAA0B,CAAA;QAElD,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;YAAE,OAAO,KAAK,CAAA;IACrD,CAAC;IAED,oBAAoB;IACpB,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,YAAY,GAAG,UAAU,CAAC,eAAe,CAAuB,CAAA;QAEtE,IAAI,CAAC,YAAY,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAAE,OAAO,KAAK,CAAA;IAC7F,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC"}
|
||||
10
25_02_24/node_modules/@tinyhttp/req/dist/index.d.ts
generated
vendored
Normal file
10
25_02_24/node_modules/@tinyhttp/req/dist/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { IncomingHttpHeaders, IncomingMessage as Request, ServerResponse as Response } from 'node:http';
|
||||
import { type Options, type Ranges, type Result } from 'header-range-parser';
|
||||
export * from './accepts.js';
|
||||
export * from '@tinyhttp/url';
|
||||
export declare const getRequestHeader: (req: Pick<Request, "headers">) => <HeaderName extends string>(header: HeaderName) => IncomingHttpHeaders[HeaderName];
|
||||
export declare const getRangeFromHeader: (req: Pick<Request, "headers">) => (size: number, options?: Options) => Result | Ranges | undefined;
|
||||
export declare const getFreshOrStale: (req: Pick<Request, "headers" | "method">, res: Pick<Response, "getHeader" | "statusCode">) => boolean;
|
||||
export declare const checkIfXMLHttpRequest: (req: Pick<Request, "headers">) => boolean;
|
||||
export declare const reqIs: (req: Pick<Request, "headers">) => (...types: string[]) => string | false;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
25_02_24/node_modules/@tinyhttp/req/dist/index.d.ts.map
generated
vendored
Normal file
1
25_02_24/node_modules/@tinyhttp/req/dist/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,IAAI,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5G,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAc,MAAM,qBAAqB,CAAA;AAKxF,cAAc,cAAc,CAAA;AAE5B,cAAc,eAAe,CAAA;AAE7B,eAAO,MAAM,gBAAgB,QAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,MACpD,UAAU,SAAS,MAAM,UAAU,UAAU,KAAG,mBAAmB,CAAC,UAAU,CAWvF,CAAA;AAED,eAAO,MAAM,kBAAkB,QACvB,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,YACvB,MAAM,YAAY,OAAO,KAAG,MAAM,GAAG,MAAM,GAAG,SAMpD,CAAA;AAEH,eAAO,MAAM,eAAe,QACrB,IAAI,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAC,OACnC,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,YAAY,CAAC,KAC9C,OAgBF,CAAA;AAED,eAAO,MAAM,qBAAqB,QAAS,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,KAAG,OAChB,CAAA;AAEtD,eAAO,MAAM,KAAK,QACV,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,gBACnB,MAAM,EAAE,mBACsC,CAAA"}
|
||||
41
25_02_24/node_modules/@tinyhttp/req/dist/index.js
generated
vendored
Normal file
41
25_02_24/node_modules/@tinyhttp/req/dist/index.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { parseRange } from 'header-range-parser';
|
||||
import { typeIs } from '@tinyhttp/type-is';
|
||||
import { fresh } from './fresh.js';
|
||||
export * from './accepts.js';
|
||||
export * from '@tinyhttp/url';
|
||||
export const getRequestHeader = (req) => {
|
||||
return (header) => {
|
||||
const lc = header.toLowerCase();
|
||||
switch (lc) {
|
||||
case 'referer':
|
||||
case 'referrer':
|
||||
return (req.headers.referrer || req.headers.referer);
|
||||
default:
|
||||
return req.headers[lc];
|
||||
}
|
||||
};
|
||||
};
|
||||
export const getRangeFromHeader = (req) => (size, options) => {
|
||||
const range = getRequestHeader(req)('range');
|
||||
if (!range)
|
||||
return;
|
||||
return parseRange(size, range, options);
|
||||
};
|
||||
export const getFreshOrStale = (req, res) => {
|
||||
const method = req.method;
|
||||
const status = res.statusCode;
|
||||
// GET or HEAD for weak freshness validation only
|
||||
if (method !== 'GET' && method !== 'HEAD')
|
||||
return false;
|
||||
// 2xx or 304 as per rfc2616 14.26
|
||||
if ((status >= 200 && status < 300) || status === 304) {
|
||||
return fresh(req.headers, {
|
||||
etag: res.getHeader('ETag'),
|
||||
'last-modified': res.getHeader('Last-Modified')
|
||||
});
|
||||
}
|
||||
return false;
|
||||
};
|
||||
export const checkIfXMLHttpRequest = (req) => req.headers['x-requested-with'] === 'XMLHttpRequest';
|
||||
export const reqIs = (req) => (...types) => typeIs(req.headers['content-type'], ...types);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
25_02_24/node_modules/@tinyhttp/req/dist/index.js.map
generated
vendored
Normal file
1
25_02_24/node_modules/@tinyhttp/req/dist/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAExF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,cAAc,cAAc,CAAA;AAE5B,cAAc,eAAe,CAAA;AAE7B,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,GA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