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.1.0 to 2.2.0

18

index.js

@@ -229,3 +229,3 @@ 'use strict';

ext: 'woff',
mime: 'application/x-font-woff'
mime: 'application/font-woff'
};

@@ -237,3 +237,3 @@ }

ext: 'woff2',
mime: 'application/x-font-woff'
mime: 'application/font-woff'
};

@@ -249,3 +249,17 @@ }

if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) {
return {
ext: 'ttf',
mime: 'application/font-sfnt'
};
}
if (buf[0] === 0x4f && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4f && buf[4] === 0x00) {
return {
ext: 'otf',
mime: 'application/font-sfnt'
};
}
return null;
};

6

package.json
{
"name": "file-type",
"version": "2.1.0",
"version": "2.2.0",
"description": "Detect the file type of a Buffer/Uint8Array",

@@ -80,3 +80,5 @@ "license": "MIT",

"woff2",
"eot"
"eot",
"ttf",
"otf"
],

@@ -83,0 +85,0 @@ "dependencies": {

@@ -131,2 +131,4 @@ # file-type [![Build Status](https://travis-ci.org/sindresorhus/file-type.svg?branch=master)](https://travis-ci.org/sindresorhus/file-type)

- `eot`
- `ttf`
- `otf`

@@ -133,0 +135,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