Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7112634
walk.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
665 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
);
let
info
;
try
{
// eslint-disable-next-line no-await-in-loop
info
=
await
fs
.
stat
(
fullpath
);
}
catch
(
e
)
{
console
.
error
(
e
);
return
[];
}
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
Thu, Jul 3, 23:44 (20 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
625141
Default Alt Text
walk.ts (665 B)
Attached To
Mode
rSGEN sealgen
Attached
Detach File
Event Timeline
Log In to Comment