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.

index.js 249B

123456789101112131415161718
  1. 'use strict';
  2. const fileType = require('file-type');
  3. const exts = new Set([
  4. '7z',
  5. 'bz2',
  6. 'gz',
  7. 'rar',
  8. 'tar',
  9. 'zip',
  10. 'xz',
  11. 'gz'
  12. ]);
  13. module.exports = input => {
  14. const ret = fileType(input);
  15. return exts.has(ret && ret.ext) ? ret : null;
  16. };