source: imaps-frontend/node_modules/@nodelib/fs.stat/out/providers/async.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.read = void 0;
4function read(path, settings, callback) {
5 settings.fs.lstat(path, (lstatError, lstat) => {
6 if (lstatError !== null) {
7 callFailureCallback(callback, lstatError);
8 return;
9 }
10 if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
11 callSuccessCallback(callback, lstat);
12 return;
13 }
14 settings.fs.stat(path, (statError, stat) => {
15 if (statError !== null) {
16 if (settings.throwErrorOnBrokenSymbolicLink) {
17 callFailureCallback(callback, statError);
18 return;
19 }
20 callSuccessCallback(callback, lstat);
21 return;
22 }
23 if (settings.markSymbolicLink) {
24 stat.isSymbolicLink = () => true;
25 }
26 callSuccessCallback(callback, stat);
27 });
28 });
29}
30exports.read = read;
31function callFailureCallback(callback, error) {
32 callback(error);
33}
34function callSuccessCallback(callback, result) {
35 callback(null, result);
36}
Note: See TracBrowser for help on using the repository browser.