detect-file-type
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
@@ -10,0 +10,0 @@ var _fs = require('fs'); |
{ | ||
"name": "detect-file-type", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Detect file type by signature", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -103,2 +103,11 @@ [ | ||
{ | ||
"type": "flif", | ||
"ext": "flif", | ||
"mime": "image/flif", | ||
"rules": [ | ||
{ "type": "equal", "start": 0, "end": 4, "bytes": "464c4946" } | ||
] | ||
}, | ||
{ | ||
"type": "zip", | ||
@@ -655,3 +664,17 @@ "ext": "zip", | ||
] | ||
}, | ||
{ | ||
"type": "html", | ||
"ext": "html", | ||
"mime": "text/html", | ||
"rules": [ | ||
{ "type": "or", "rules": | ||
[ | ||
{ "type": "contains", "bytes": "3c68746d6c" }, | ||
{ "type": "contains", "bytes": "3c00680074006d006c00" } | ||
] | ||
} | ||
] | ||
} | ||
] |
@@ -655,2 +655,24 @@ import {assert} from 'chai'; | ||
it('should detect flif', (done) => { | ||
detect.fromFile('./files/fixture.flif', (err, result) => { | ||
assert.equal(err, null); | ||
assert.deepEqual(result, { | ||
ext: 'flif', | ||
mime: 'image/flif' | ||
}); | ||
done(); | ||
}); | ||
}); | ||
it('should detect html started with html tag', (done) => { | ||
detect.fromFile('./files/fixture-simple-html.html', (err, result) => { | ||
assert.equal(err, null); | ||
assert.deepEqual(result, { | ||
ext: 'html', | ||
mime: 'text/html' | ||
}); | ||
done(); | ||
}); | ||
}); | ||
}); |
22
test.js
@@ -661,2 +661,24 @@ 'use strict'; | ||
}); | ||
it('should detect flif', function (done) { | ||
_index2.default.fromFile('./files/fixture.flif', function (err, result) { | ||
_chai.assert.equal(err, null); | ||
_chai.assert.deepEqual(result, { | ||
ext: 'flif', | ||
mime: 'image/flif' | ||
}); | ||
done(); | ||
}); | ||
}); | ||
it('should detect html started with html tag', function (done) { | ||
_index2.default.fromFile('./files/fixture-simple-html.html', function (err, result) { | ||
_chai.assert.equal(err, null); | ||
_chai.assert.deepEqual(result, { | ||
ext: 'html', | ||
mime: 'text/html' | ||
}); | ||
done(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11623504
81
2289
56