web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.0 KiB

  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. return async.read(path, getSettings(), optionsOrSettingsOrCallback);
  11. }
  12. async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
  13. }
  14. exports.scandir = scandir;
  15. function scandirSync(path, optionsOrSettings) {
  16. const settings = getSettings(optionsOrSettings);
  17. return sync.read(path, settings);
  18. }
  19. exports.scandirSync = scandirSync;
  20. function getSettings(settingsOrOptions = {}) {
  21. if (settingsOrOptions instanceof settings_1.default) {
  22. return settingsOrOptions;
  23. }
  24. return new settings_1.default(settingsOrOptions);
  25. }