source: imaps-frontend/node_modules/@nodelib/fs.walk/out/index.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.4 KB
RevLine 
[d565449]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0;
4const async_1 = require("./providers/async");
5const stream_1 = require("./providers/stream");
6const sync_1 = require("./providers/sync");
7const settings_1 = require("./settings");
8exports.Settings = settings_1.default;
9function walk(directory, optionsOrSettingsOrCallback, callback) {
10 if (typeof optionsOrSettingsOrCallback === 'function') {
11 new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
12 return;
13 }
14 new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
15}
16exports.walk = walk;
17function walkSync(directory, optionsOrSettings) {
18 const settings = getSettings(optionsOrSettings);
19 const provider = new sync_1.default(directory, settings);
20 return provider.read();
21}
22exports.walkSync = walkSync;
23function walkStream(directory, optionsOrSettings) {
24 const settings = getSettings(optionsOrSettings);
25 const provider = new stream_1.default(directory, settings);
26 return provider.read();
27}
28exports.walkStream = walkStream;
29function getSettings(settingsOrOptions = {}) {
30 if (settingsOrOptions instanceof settings_1.default) {
31 return settingsOrOptions;
32 }
33 return new settings_1.default(settingsOrOptions);
34}
Note: See TracBrowser for help on using the repository browser.