UNPKG
umi-library
Version:
latest (1.6.0)
next (1.7.0-beta.2)
1.7.0-beta.2
1.7.0-beta.1
1.6.0
1.5.1
1.5.0
1.4.1
1.4.0
1.3.2
1.3.1
1.3.0
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.1
1.1.0
1.0.1
1.0.0
Library toolkit based on rollup and docz.
github.com/umijs/umi
umijs/umi
umi-library
/
src
/
utils.ts
12 lines
(10 loc)
•
294 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import { existsSync }
from
'fs'
; import {
join
}
from
'path'
;
export function
getExistFile
(
{ cwd, files, returnRelative }
)
{
for
(
const
file
of files) {
const
absFilePath =
join
(cwd,
file
);
if
(existsSync(absFilePath)) {
return
returnRelative ?
file
: absFilePath; } } }