Socket
Socket
Sign inDemoInstall

file-type

Package Overview
Dependencies
Maintainers
2
Versions
149
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-type - npm Package Compare versions

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;
};

11

package.json
{
"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).*

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc