Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F3010485
walk.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
594 B
Referenced Files
None
Subscribers
None
walk.ts
View Options
import
{
promises
as
fs
}
from
"fs"
;
import
{
resolve
}
from
"path"
;
export
async
function
walkDir
(
dir
:
string
)
:
Promise
<
string
[]
>
{
const
entries
=
await
fs
.
readdir
(
dir
);
let
ret
:
string
[]
=
[];
for
(
const
entry
of
entries
)
{
if
(
entry
.
includes
(
".#"
))
{
continue
;
}
const
fullpath
=
resolve
(
dir
,
entry
);
// eslint-disable-next-line no-await-in-loop
const
info
=
await
fs
.
stat
(
fullpath
);
if
(
info
.
isDirectory
())
{
// eslint-disable-next-line no-await-in-loop
ret
=
[...
ret
,
...(
await
walkDir
(
fullpath
))];
}
else
{
ret
=
[...
ret
,
fullpath
];
}
}
return
ret
;
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, May 7, 19:43 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625226
Default Alt Text
walk.ts (594 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment