bcd16c2dac993637ae2abf3551a4fa73d1d76a5aa1fba4a72973e664640ace24ca874542913b68a0b2679832744c6a42efbb9935162de7a18bcd8e97e0dabb 876 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.modeFix = void 0;
  4. const modeFix = (mode, isDir, portable) => {
  5. mode &= 0o7777;
  6. // in portable mode, use the minimum reasonable umask
  7. // if this system creates files with 0o664 by default
  8. // (as some linux distros do), then we'll write the
  9. // archive with 0o644 instead. Also, don't ever create
  10. // a file that is not readable/writable by the owner.
  11. if (portable) {
  12. mode = (mode | 0o600) & ~0o22;
  13. }
  14. // if dirs are readable, then they should be listable
  15. if (isDir) {
  16. if (mode & 0o400) {
  17. mode |= 0o100;
  18. }
  19. if (mode & 0o40) {
  20. mode |= 0o10;
  21. }
  22. if (mode & 0o4) {
  23. mode |= 0o1;
  24. }
  25. }
  26. return mode;
  27. };
  28. exports.modeFix = modeFix;
  29. //# sourceMappingURL=mode-fix.js.map