options.js 1.5 KB

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. var __assign = (this && this.__assign) || function () {
  3. __assign = Object.assign || function(t) {
  4. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5. s = arguments[i];
  6. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
  7. t[p] = s[p];
  8. }
  9. return t;
  10. };
  11. return __assign.apply(this, arguments);
  12. };
  13. Object.defineProperty(exports, "__esModule", { value: true });
  14. function prepare(options) {
  15. var opts = __assign({ cwd: process.cwd(), deep: true, ignore: [], dot: false, stats: false, onlyFiles: true, onlyDirectories: false, followSymlinkedDirectories: true, unique: true, markDirectories: false, absolute: false, nobrace: false, brace: true, noglobstar: false, globstar: true, noext: false, extension: true, nocase: false, case: true, matchBase: false, transform: null }, options);
  16. if (opts.onlyDirectories) {
  17. opts.onlyFiles = false;
  18. }
  19. opts.brace = !opts.nobrace;
  20. opts.globstar = !opts.noglobstar;
  21. opts.extension = !opts.noext;
  22. opts.case = !opts.nocase;
  23. if (options) {
  24. opts.brace = ('brace' in options ? options.brace : opts.brace);
  25. opts.globstar = ('globstar' in options ? options.globstar : opts.globstar);
  26. opts.extension = ('extension' in options ? options.extension : opts.extension);
  27. opts.case = ('case' in options ? options.case : opts.case);
  28. }
  29. return opts;
  30. }
  31. exports.prepare = prepare;