file-type
Advanced tools
Comparing version 2.0.4 to 2.1.0
21
index.js
@@ -226,3 +226,24 @@ 'use strict'; | ||
if (buf[0] === 0x77 && buf[1] === 0x4f && buf[2] === 0x46 && buf[3] === 0x46 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) { | ||
return { | ||
ext: 'woff', | ||
mime: 'application/x-font-woff' | ||
}; | ||
} | ||
if (buf[0] === 0x77 && buf[1] === 0x4f && buf[2] === 0x46 && buf[3] === 0x32 && buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) { | ||
return { | ||
ext: 'woff2', | ||
mime: 'application/x-font-woff' | ||
}; | ||
} | ||
if (buf[34] === 0x4c && buf[35] === 0x50 && ((buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x01) || (buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x00) || (buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02))) { | ||
return { | ||
ext: 'eot', | ||
mime: 'application/octet-stream' | ||
}; | ||
} | ||
return null; | ||
}; |
{ | ||
"name": "file-type", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"description": "Detect the file type of a Buffer/Uint8Array", | ||
@@ -10,3 +10,3 @@ "license": "MIT", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "http://sindresorhus.com" | ||
"url": "sindresorhus.com" | ||
}, | ||
@@ -78,6 +78,9 @@ "bin": { | ||
"swf", | ||
"rtf" | ||
"rtf", | ||
"woff", | ||
"woff2", | ||
"eot" | ||
], | ||
"dependencies": { | ||
"meow": "^2.0.0" | ||
"meow": "^3.0.0" | ||
}, | ||
@@ -84,0 +87,0 @@ "devDependencies": { |
@@ -10,3 +10,3 @@ # file-type [![Build Status](https://travis-ci.org/sindresorhus/file-type.svg?branch=master)](https://travis-ci.org/sindresorhus/file-type) | ||
```sh | ||
``` | ||
$ npm install --save file-type | ||
@@ -79,3 +79,3 @@ ``` | ||
```sh | ||
``` | ||
$ npm install --global file-type | ||
@@ -118,2 +118,3 @@ ``` | ||
- `avi` | ||
- `wmv` | ||
- `mpg` | ||
@@ -130,2 +131,5 @@ - `mp3` | ||
- `rtf` | ||
- `woff` | ||
- `woff2` | ||
- `eot` | ||
@@ -132,0 +136,0 @@ *SVG isn't included as it requires the whole file to be read, but you can get it [here](https://github.com/sindresorhus/is-svg).* |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
247
140
0
11018
4
+ Addedarray-find-index@1.0.2(transitive)
+ Addedcamelcase@2.1.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removedcamelcase-keys@1.0.0(transitive)
- Removedindent-string@1.2.2(transitive)
- Removedmeow@2.1.0(transitive)
- Removedobject-assign@2.1.1(transitive)
- Removedrepeating@1.1.3(transitive)
Updatedmeow@^3.0.0