create project
This commit is contained in:
34
kitabcitab/node_modules/next/dist/esm/server/request-meta.js
generated
vendored
Normal file
34
kitabcitab/node_modules/next/dist/esm/server/request-meta.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
export const NEXT_REQUEST_META = Symbol("NextRequestMeta");
|
||||
export function getRequestMeta(req, key) {
|
||||
const meta = req[NEXT_REQUEST_META] || {};
|
||||
return typeof key === "string" ? meta[key] : meta;
|
||||
}
|
||||
export function setRequestMeta(req, meta) {
|
||||
req[NEXT_REQUEST_META] = meta;
|
||||
return getRequestMeta(req);
|
||||
}
|
||||
export function addRequestMeta(request, key, value) {
|
||||
const meta = getRequestMeta(request);
|
||||
meta[key] = value;
|
||||
return setRequestMeta(request, meta);
|
||||
}
|
||||
export function getNextInternalQuery(query) {
|
||||
const keysToInclude = [
|
||||
"__nextDefaultLocale",
|
||||
"__nextFallback",
|
||||
"__nextLocale",
|
||||
"__nextSsgPath",
|
||||
"_nextBubbleNoFallback",
|
||||
"__nextDataReq",
|
||||
];
|
||||
const nextInternalQuery = {};
|
||||
for (const key of keysToInclude){
|
||||
if (key in query) {
|
||||
// @ts-ignore this can't be typed correctly
|
||||
nextInternalQuery[key] = query[key];
|
||||
}
|
||||
}
|
||||
return nextInternalQuery;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=request-meta.js.map
|
||||
Reference in New Issue
Block a user