(route: string)
| 2934 | let lambda: undefined | Lambda; |
| 2935 | |
| 2936 | function normalizeDataRoute(route: string) { |
| 2937 | let normalized = path.posix.join(entryDirectory, route); |
| 2938 | |
| 2939 | if (nonDynamicSsg || isFallback || isOmitted) { |
| 2940 | // the prerender-manifest can be inconsistent with |
| 2941 | // locale being provided to dataRoute so normalize here |
| 2942 | const pathToReplace = route.endsWith(routeFileNoExt + '.json') |
| 2943 | ? origRouteFileNoExt |
| 2944 | : routeFileNoExt; |
| 2945 | |
| 2946 | normalized = normalized.replace( |
| 2947 | new RegExp(`${escapeStringRegexp(origRouteFileNoExt)}.json$`), |
| 2948 | // ensure we escape "$" correctly while replacing as "$" is a special |
| 2949 | // character, we need to do double escaping as first is for the initial |
| 2950 | // replace on the routeFile and then the second on the outputPath |
| 2951 | `${pathToReplace.replace(/\$/g, '$$$$')}.json` |
| 2952 | ); |
| 2953 | } |
| 2954 | |
| 2955 | return normalized; |
| 2956 | } |
| 2957 | |
| 2958 | let outputPathData: null | string = null; |
| 2959 | if (dataRoute) { |
no test coverage detected