file-type
Advanced tools
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; | ||
}; |
{ | ||
"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).* |
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
11388
259
142