Socket
Socket
Sign inDemoInstall

mime-kind

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mime-kind - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

16

main.js

@@ -12,4 +12,3 @@ 'use strict';

function isStream(stream) {
return stream && typeof stream === 'object' && typeof stream.pipe === 'function' && stream.readable !== false
&& typeof stream._read === 'function' && typeof stream._readableState === 'object';
return stream && typeof stream === 'object' && typeof stream.pipe === 'function' && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
}

@@ -45,11 +44,16 @@

function streamSync(stream, length) {
var buf;
if (!stream.closed && !stream.destroyed && length > 0) {
/*var state = stream._readableState;*/
try {
var buf = chunkSync(stream, length/* || state.highWaterMark*/);
/*stream.emit('end');*/
var data = {
path: stream.path,
flags: stream.flags,
mode: stream.mode,
fd: stream.fd
};
buf = chunkSync(data, length);
return buf;
} catch (e) {
stream.emit('end');
throw new Error('The file must be local and exists.');

@@ -56,0 +60,0 @@ }

{
"name": "mime-kind",
"author": "Alexey Bystrov <strikeentco@gmail.com>",
"version": "1.0.1",
"version": "1.0.2",
"description": "Detect the mime type of a Buffer, ReadStream, file path and file name.",

@@ -6,0 +6,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc