MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / checkRouteFile

Function checkRouteFile

src/shared/build-tools.ts:212–230  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

210}
211
212export async function checkRouteFile(path: string) {
213 const config = getConfig();
214 let infoFile: string;
215
216 switch (config.mode) {
217 case "qwikcity":
218 infoFile = path.split("/").slice(0, -1).concat("routeInfo.ts").join("/");
219 break;
220 default:
221 infoFile = path.replace(/\.(js|jsx|ts|tsx)$/, ".info.ts");
222 break;
223 }
224 const absPath = absoluteFilePath(config, infoFile);
225 if (!fs.existsSync(absPath)) {
226 await createInfoFile(config, path);
227 return true;
228 }
229 return false;
230}
231
232export async function buildFiles(silent: boolean = false) {
233 const config = getConfig();

Callers 2

processFileFunction · 0.90
buildFilesFunction · 0.85

Calls 3

getConfigFunction · 0.90
absoluteFilePathFunction · 0.90
createInfoFileFunction · 0.85

Tested by

no test coverage detected