aboutsummaryrefslogtreecommitdiff
path: root/node_modules/archive-type/index.js
blob: c8dcd5b3bb1ddb8b45680e7f1d92048c4e5f465f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'use strict';
const fileType = require('file-type');

const exts = new Set([
	'7z',
	'bz2',
	'gz',
	'rar',
	'tar',
	'zip',
	'xz',
	'gz'
]);

module.exports = input => {
	const ret = fileType(input);
	return exts.has(ret && ret.ext) ? ret : null;
};