main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
619 bytes
|
Rev | Line | |
---|
[d565449] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | exports.read = void 0;
|
---|
| 4 | function read(path, settings) {
|
---|
| 5 | const lstat = settings.fs.lstatSync(path);
|
---|
| 6 | if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
|
---|
| 7 | return lstat;
|
---|
| 8 | }
|
---|
| 9 | try {
|
---|
| 10 | const stat = settings.fs.statSync(path);
|
---|
| 11 | if (settings.markSymbolicLink) {
|
---|
| 12 | stat.isSymbolicLink = () => true;
|
---|
| 13 | }
|
---|
| 14 | return stat;
|
---|
| 15 | }
|
---|
| 16 | catch (error) {
|
---|
| 17 | if (!settings.throwErrorOnBrokenSymbolicLink) {
|
---|
| 18 | return lstat;
|
---|
| 19 | }
|
---|
| 20 | throw error;
|
---|
| 21 | }
|
---|
| 22 | }
|
---|
| 23 | exports.read = read;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.