Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1009 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | exports.Settings = exports.scandirSync = exports.scandir = void 0;
|
---|
| 4 | const async = require("./providers/async");
|
---|
| 5 | const sync = require("./providers/sync");
|
---|
| 6 | const settings_1 = require("./settings");
|
---|
| 7 | exports.Settings = settings_1.default;
|
---|
| 8 | function scandir(path, optionsOrSettingsOrCallback, callback) {
|
---|
| 9 | if (typeof optionsOrSettingsOrCallback === 'function') {
|
---|
| 10 | async.read(path, getSettings(), optionsOrSettingsOrCallback);
|
---|
| 11 | return;
|
---|
| 12 | }
|
---|
| 13 | async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
|
---|
| 14 | }
|
---|
| 15 | exports.scandir = scandir;
|
---|
| 16 | function scandirSync(path, optionsOrSettings) {
|
---|
| 17 | const settings = getSettings(optionsOrSettings);
|
---|
| 18 | return sync.read(path, settings);
|
---|
| 19 | }
|
---|
| 20 | exports.scandirSync = scandirSync;
|
---|
| 21 | function getSettings(settingsOrOptions = {}) {
|
---|
| 22 | if (settingsOrOptions instanceof settings_1.default) {
|
---|
| 23 | return settingsOrOptions;
|
---|
| 24 | }
|
---|
| 25 | return new settings_1.default(settingsOrOptions);
|
---|
| 26 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.