(path, name, type, callback)
| 295 | } |
| 296 | |
| 297 | function getDirent(path, name, type, callback) { |
| 298 | if (typeof callback === 'function') { |
| 299 | if (type === UV_DIRENT_UNKNOWN) { |
| 300 | let filepath; |
| 301 | try { |
| 302 | filepath = join(path, name); |
| 303 | } catch (err) { |
| 304 | callback(err); |
| 305 | return; |
| 306 | } |
| 307 | lazyLoadFs().lstat(filepath, (err, stats) => { |
| 308 | if (err) { |
| 309 | callback(err); |
| 310 | return; |
| 311 | } |
| 312 | callback(null, new DirentFromStats(name, stats, path)); |
| 313 | }); |
| 314 | } else { |
| 315 | callback(null, new Dirent(name, type, path)); |
| 316 | } |
| 317 | } else if (type === UV_DIRENT_UNKNOWN) { |
| 318 | const filepath = join(path, name); |
| 319 | const stats = lazyLoadFs().lstatSync(filepath); |
| 320 | return new DirentFromStats(name, stats, path); |
| 321 | } else { |
| 322 | return new Dirent(name, type, path); |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | function getOptions(options, defaultOptions = kEmptyObject) { |
| 327 | if (options == null || typeof options === 'function') { |
no test coverage detected
searching dependent graphs…