/opt/canhelp/node_modules/next/dist/esm/build/segment-config/app
NameSizeModeActions
app-segment-config.js27930644editdlrm
app-segment-config.js.map59010644editdlrm
app-segments.js63040644editdlrm
app-segments.js.map103140644editdlrm
collect-root-param-keys.js19550644editdlrm
collect-root-param-keys.js.map33280644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/build/segment-config/app/app-segment-config.js.map (5901B)
{"version":3,"sources":["../../../../src/build/segment-config/app/app-segment-config.ts"],"sourcesContent":["import { z } from 'next/dist/compiled/zod'\nimport { formatZodError } from '../../../shared/lib/zod'\n\n/**\n * The schema for configuration for a page.\n */\nconst AppSegmentConfigSchema = z.object({\n /**\n * The number of seconds to revalidate the page or false to disable revalidation.\n */\n revalidate: z\n .union([z.number().int().nonnegative(), z.literal(false)])\n .optional(),\n\n /**\n * Whether the page supports dynamic parameters.\n */\n dynamicParams: z.boolean().optional(),\n\n /**\n * The dynamic behavior of the page.\n */\n dynamic: z\n .enum(['auto', 'error', 'force-static', 'force-dynamic'])\n .optional(),\n\n /**\n * The caching behavior of the page.\n */\n fetchCache: z\n .enum([\n 'auto',\n 'default-cache',\n 'only-cache',\n 'force-cache',\n 'force-no-store',\n 'default-no-store',\n 'only-no-store',\n ])\n .optional(),\n\n /**\n * The preferred region for the page.\n */\n preferredRegion: z.union([z.string(), z.array(z.string())]).optional(),\n\n /**\n * Whether the page supports partial prerendering. When true, the page will be\n * served using partial prerendering. This setting will only take affect if\n * it's enabled via the `experimental.ppr = \"incremental\"` option.\n */\n experimental_ppr: z.boolean().optional(),\n\n /**\n * The runtime to use for the page.\n */\n runtime: z.enum(['edge', 'nodejs']).optional(),\n\n /**\n * The maximum duration for the page in seconds.\n */\n maxDuration: z.number().int().nonnegative().optional(),\n})\n\n/**\n * Parse the app segment config.\n * @param data - The data to parse.\n * @param route - The route of the app.\n * @returns The parsed app segment config.\n */\nexport function parseAppSegmentConfig(\n data: unknown,\n route: string\n): AppSegmentConfig {\n const parsed = AppSegmentConfigSchema.safeParse(data, {\n errorMap: (issue, ctx) => {\n if (issue.path.length === 1 && issue.path[0] === 'revalidate') {\n return {\n message: `Invalid revalidate value ${JSON.stringify(\n ctx.data\n )} on \"${route}\", must be a non-negative number or false`,\n }\n }\n\n return { message: ctx.defaultError }\n },\n })\n\n if (!parsed.success) {\n throw formatZodError(\n `Invalid segment configuration options detected for \"${route}\". Read more at https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config`,\n parsed.error\n )\n }\n\n return parsed.data\n}\n\n/**\n * The configuration for a page.\n */\nexport type AppSegmentConfig = {\n /**\n * The revalidation period for the page in seconds, or false to disable ISR.\n */\n revalidate?: number | false\n\n /**\n * Whether the page supports dynamic parameters.\n */\n dynamicParams?: boolean\n\n /**\n * The dynamic behavior of the page.\n */\n dynamic?: 'auto' | 'error' | 'force-static' | 'force-dynamic'\n\n /**\n * The caching behavior of the page.\n */\n fetchCache?:\n | 'auto'\n | 'default-cache'\n | 'default-no-store'\n | 'force-cache'\n | 'force-no-store'\n | 'only-cache'\n | 'only-no-store'\n\n /**\n * The preferred region for the page.\n */\n preferredRegion?: string | string[]\n\n /**\n * Whether the page supports partial prerendering. When true, the page will be\n * served using partial prerendering. This setting will only take affect if\n * it's enabled via the `experimental.ppr = \"incremental\"` option.\n */\n experimental_ppr?: boolean\n\n /**\n * The runtime to use for the page.\n */\n runtime?: 'edge' | 'nodejs'\n\n /**\n * The maximum duration for the page in seconds.\n */\n maxDuration?: number\n}\n\n/**\n * The keys of the configuration for a page.\n *\n * @internal - required to exclude zod types from the build\n */\nexport const AppSegmentConfigSchemaKeys = AppSegmentConfigSchema.keyof().options\n"],"names":["z","formatZodError","AppSegmentConfigSchema","object","revalidate","union","number","int","nonnegative","literal","optional","dynamicParams","boolean","dynamic","enum","fetchCache","preferredRegion","string","array","experimental_ppr","runtime","maxDuration","parseAppSegmentConfig","data","route","parsed","safeParse","errorMap","issue","ctx","path","length","message","JSON","stringify","defaultError","success","error","AppSegmentConfigSchemaKeys","keyof","options"],"m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