UNPKG

1.01 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Settings = void 0;
4const path = require("node:path");
5const fsStat = require("@nodelib/fs.stat");
6const fs = require("./adapters/fs");
7class Settings {
8 followSymbolicLinks;
9 fs;
10 pathSegmentSeparator;
11 stats;
12 throwErrorOnBrokenSymbolicLink;
13 fsStatSettings;
14 constructor(options = {}) {
15 this.followSymbolicLinks = options.followSymbolicLinks ?? false;
16 this.fs = fs.createFileSystemAdapter(options.fs);
17 this.pathSegmentSeparator = options.pathSegmentSeparator ?? path.sep;
18 this.stats = options.stats ?? false;
19 this.throwErrorOnBrokenSymbolicLink = options.throwErrorOnBrokenSymbolicLink ?? true;
20 this.fsStatSettings = new fsStat.Settings({
21 followSymbolicLink: this.followSymbolicLinks,
22 fs: this.fs,
23 throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink,
24 });
25 }
26}
27exports.Settings = Settings;