Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

index.js 957B

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const async = require("./providers/async");
  4. const sync = require("./providers/sync");
  5. const settings_1 = require("./settings");
  6. exports.Settings = settings_1.default;
  7. function scandir(path, optionsOrSettingsOrCallback, callback) {
  8. if (typeof optionsOrSettingsOrCallback === 'function') {
  9. return async.read(path, getSettings(), optionsOrSettingsOrCallback);
  10. }
  11. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  12. }
  13. exports.scandir = scandir;
  14. function scandirSync(path, optionsOrSettings) {
  15. const settings = getSettings(optionsOrSettings);
  16. return sync.read(path, settings);
  17. }
  18. exports.scandirSync = scandirSync;
  19. function getSettings(settingsOrOptions = {}) {
  20. if (settingsOrOptions instanceof settings_1.default) {
  21. return settingsOrOptions;
  22. }
  23. return new settings_1.default(settingsOrOptions);
  24. }