file-type
Advanced tools
Comparing version 14.1.1 to 14.1.2
12
core.js
@@ -12,3 +12,3 @@ 'use strict'; | ||
const minimumBytes = 4100; | ||
const minimumBytes = 4100; // A fair amount of file-types are detectable within this range | ||
@@ -64,3 +64,3 @@ async function fromStream(stream) { | ||
await tokenizer.peekBuffer(buffer, {length: 512, mayBeLess: true}); | ||
await tokenizer.peekBuffer(buffer, {mayBeLess: true}); | ||
@@ -586,3 +586,4 @@ return buffer.includes(Buffer.from(sequence)); | ||
if (check([0x49, 0x49, 0x2A, 0x0] || [0x4D, 0x4D, 0x0, 0x2A])) { | ||
// TIFF, little-endian type | ||
if (check([0x49, 0x49, 0x2A, 0x0])) { | ||
if (checkString('CR', {offset: 8})) { | ||
@@ -632,5 +633,4 @@ return { | ||
if ( | ||
check([0x4D, 0x4D, 0x0, 0x2A]) | ||
) { | ||
// TIFF, big-endian type | ||
if (check([0x4D, 0x4D, 0x0, 0x2A])) { | ||
return { | ||
@@ -637,0 +637,0 @@ ext: 'tif', |
@@ -23,2 +23,3 @@ /// <reference types="node"/> | ||
fromStream, | ||
fromTokenizer, | ||
extensions, | ||
@@ -25,0 +26,0 @@ mimeTypes, |
{ | ||
"name": "file-type", | ||
"version": "14.1.1", | ||
"version": "14.1.2", | ||
"description": "Detect the file type of a Buffer/Uint8Array/ArrayBuffer", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
68776
1899