s/basic/shallow
This commit is contained in:
parent
358746b091
commit
879add5038
|
@ -15,7 +15,7 @@ const reIgnore = /^[._]/
|
|||
|
||||
module.exports = (base, default_price, invoice_ttl, files_attr) => {
|
||||
|
||||
const load = async (_path, basic=false) => {
|
||||
const load = async (_path, shallow=false) => {
|
||||
const fullpath = upath.resolve(base, _path)
|
||||
, relpath = upath.relative(base, fullpath)
|
||||
, dirname = upath.dirname(relpath)
|
||||
|
@ -28,9 +28,9 @@ module.exports = (base, default_price, invoice_ttl, files_attr) => {
|
|||
const file = { fullpath, path: relpath, urlpath: escape(relpath), name, ext, dirname, attr }
|
||||
, stat = await fs.stat(fullpath)
|
||||
|
||||
return stat.isDirectory() ? { ...file, type: 'dir', files: !basic && await listFiles(fullpath) }
|
||||
return stat.isDirectory() ? { ...file, type: 'dir', files: !shallow && await listFiles(fullpath) }
|
||||
: stat.isFile() ? { ...file, type: 'file', size: stat.size, price: attr.price || default_price
|
||||
, mime: await getMime(file), exif: !basic && await getExif(fullpath) }
|
||||
, mime: await getMime(file), exif: !shallow && await getExif(fullpath) }
|
||||
: null
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue