ЛХ
let access
try {
access()
access = true
} catch (e) {
access = false
}Size: a a a
ЛХ
let access
try {
access()
access = true
} catch (e) {
access = false
}ЛХ
go
async function isFileExists(path) {
try {
access
} catch (e) {
...
}
return ...
}go
PS
const access = true/false
try {
access
} catch (e) {
...
}async function exists(path) {
try {
await fs.promises.access(path, fs.F_OK);
return true;
} catch {
return false;
}
}go
async function exists(path) {
try {
await fs.promises.access(path, fs.F_OK);
return true;
} catch {
return false;
}
}ЛХ
async function exists(path) {
try {
await fs.promises.access(path, fs.F_OK);
return true;
} catch {
return false;
}
}T
ЛХ
D
T
T
T
T
PS
T
T
PS