0744e454cbdb6e4ad79c03788d2c485b647c4ab6c6f64efdbac2770be9b7a6e54866f6d437a4dda88117da8fa7df7856fdd5b6a04adb5ade3a99bd0f1a6e3e 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. export const isCode = (c) => name.has(c);
  2. export const isName = (c) => code.has(c);
  3. // map types from key to human-friendly name
  4. export const name = new Map([
  5. ['0', 'File'],
  6. // same as File
  7. ['', 'OldFile'],
  8. ['1', 'Link'],
  9. ['2', 'SymbolicLink'],
  10. // Devices and FIFOs aren't fully supported
  11. // they are parsed, but skipped when unpacking
  12. ['3', 'CharacterDevice'],
  13. ['4', 'BlockDevice'],
  14. ['5', 'Directory'],
  15. ['6', 'FIFO'],
  16. // same as File
  17. ['7', 'ContiguousFile'],
  18. // pax headers
  19. ['g', 'GlobalExtendedHeader'],
  20. ['x', 'ExtendedHeader'],
  21. // vendor-specific stuff
  22. // skip
  23. ['A', 'SolarisACL'],
  24. // like 5, but with data, which should be skipped
  25. ['D', 'GNUDumpDir'],
  26. // metadata only, skip
  27. ['I', 'Inode'],
  28. // data = link path of next file
  29. ['K', 'NextFileHasLongLinkpath'],
  30. // data = path of next file
  31. ['L', 'NextFileHasLongPath'],
  32. // skip
  33. ['M', 'ContinuationFile'],
  34. // like L
  35. ['N', 'OldGnuLongPath'],
  36. // skip
  37. ['S', 'SparseFile'],
  38. // skip
  39. ['V', 'TapeVolumeHeader'],
  40. // like x
  41. ['X', 'OldExtendedHeader'],
  42. ]);
  43. // map the other direction
  44. export const code = new Map(Array.from(name).map(kv => [kv[1], kv[0]]));
  45. //# sourceMappingURL=types.js.map