forked from Laboratoria/LIM018-md-links
-
Notifications
You must be signed in to change notification settings - Fork 0
/
md.links.js
31 lines (24 loc) · 908 Bytes
/
md.links.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// const mdLinks = (filePath) => new Promise ((resolve,reject) => {
// //Si la ruta existe
// if(routeExists(filePath)){
// //convertir a absoluta
// const absolute = routeAbsolute(filePath);
// //Si es un directorio
// if(fs.statSync(absolute).isDirectory()){
// //recursividad
// const linksContainer = recursion(absolute);
// const arrayPromises = linksContainer.map((link) => mdLinks(link));
// Promise.all(arrayPromises).then((resultado) => (resultado.flat()));
// } else if (fs.statSync(absolute).isFile()) {
// if(routeExtension(absolute) === '.md') {
// }
// const linksContainer1 = linksRoute(absolute);
// const arrayPromises1 = getStatus(linksContainer1);
// Promise.all(arrayPromises1).then((res) => {
// resolve (res.flat())
// })
// }
// } else {
// reject('Ingrese una ruta válida');
// }
// })