@@ -217,10 +217,10 @@ export default function remarkValidateLinks(options, fileSet) {
217217 root,
218218 urlConfig
219219 }
220- /** @type {Array <string> } */
221- const statted = [ ]
222- /** @type {Array <string> } */
223- const added = [ ]
220+ /** @type {Set <string> } */
221+ const statted = new Set ( )
222+ /** @type {Set <string> } */
223+ const added = new Set ( )
224224 /** @type {Array<Promise<void>> } */
225225 const promises = [ ]
226226
@@ -260,7 +260,7 @@ export default function remarkValidateLinks(options, fileSet) {
260260 addReference ( fp , hash , node )
261261 }
262262
263- if ( fileSet && fp && ! statted . includes ( fp ) ) {
263+ if ( fileSet && fp && ! statted . has ( fp ) ) {
264264 promises . push ( addFile ( fp ) )
265265 }
266266 }
@@ -351,7 +351,7 @@ export default function remarkValidateLinks(options, fileSet) {
351351 * Nothing.
352352 */
353353 async function addFile ( filePath ) {
354- statted . push ( filePath )
354+ statted . add ( filePath )
355355
356356 try {
357357 const stats = await fs . stat ( filePath )
@@ -384,13 +384,13 @@ export default function remarkValidateLinks(options, fileSet) {
384384 // Else, there’s no readme that we can parse, so add the directory.
385385 if ( file ) {
386386 filePath = path . join ( filePath , file )
387- statted . push ( filePath )
387+ statted . add ( filePath )
388388 }
389389 }
390390 } catch { }
391391
392- if ( fileSet && ! added . includes ( filePath ) ) {
393- added . push ( filePath )
392+ if ( fileSet && ! added . has ( filePath ) ) {
393+ added . add ( filePath )
394394 fileSet . add (
395395 new VFile ( { cwd : file . cwd , path : path . relative ( file . cwd , filePath ) } )
396396 )
0 commit comments