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

index.js 939B

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 stat(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.stat = stat;
  14. function statSync(path, optionsOrSettings) {
  15. const settings = getSettings(optionsOrSettings);
  16. return sync.read(path, settings);
  17. }
  18. exports.statSync = statSync;
  19. function getSettings(settingsOrOptions = {}) {
  20. if (settingsOrOptions instanceof settings_1.default) {
  21. return settingsOrOptions;
  22. }
  23. return new settings_1.default(settingsOrOptions);
  24. }