Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alex Quispe
doc-generator
Commits
f51f29c8
Commit
f51f29c8
authored
Oct 23, 2018
by
Alex Quispe
Browse files
Correción de errores en la verificación de rutas
parent
261176e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
class/ApidocGenerator.js
View file @
f51f29c8
...
...
@@ -48,7 +48,7 @@ class ApidocGenerator {
ROUTES
[
groupName
].
forEach
(
routeInfo
=>
{
const
{
filePath
}
=
_crearArchivoTemplateSiNoExiste
(
routeInfo
.
fileName
)
if
(
!
archivosVerificados
.
includes
(
filePath
))
{
_verificarSiExisteLaRuta
(
filePath
,
ROUTES
[
groupName
]
)
_verificarSiExisteLaRuta
(
filePath
,
ROUTES
)
archivosVerificados
.
push
(
filePath
)
}
_crearContenidoSiNoExiste
(
filePath
,
routeInfo
)
...
...
@@ -498,13 +498,16 @@ function _crearContenidoSiNoExiste (filePath, routeInfo) {
util
.
writeFile
(
filePath
,
content
)
}
function
_verificarSiExisteLaRuta
(
filePath
,
groupInfo
)
{
function
_verificarSiExisteLaRuta
(
filePath
,
ROUTES
)
{
const
existInRoutes
=
(
method
,
path
)
=>
{
for
(
let
i
in
groupInfo
)
{
const
routeInfo
=
groupInfo
[
i
]
const
ROUTE_PATH
=
`
${
routeInfo
.
group
===
'
/default
'
?
''
:
routeInfo
.
group
}${
routeInfo
.
path
}
`
if
(
routeInfo
.
method
===
method
&&
ROUTE_PATH
===
path
)
{
return
true
for
(
let
i
in
ROUTES
)
{
const
groupInfo
=
ROUTES
[
i
]
for
(
let
i
in
groupInfo
)
{
const
routeInfo
=
groupInfo
[
i
]
const
ROUTE_PATH
=
`
${
routeInfo
.
group
===
'
/default
'
?
''
:
routeInfo
.
group
}${
routeInfo
.
path
}
`
if
(
routeInfo
.
method
===
method
&&
ROUTE_PATH
===
path
)
{
return
true
}
}
}
return
false
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment