New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

micro-core

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-core - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

README.md

47

dist/index.js

@@ -124,2 +124,6 @@ var regeneratorRuntime = require('babel-regenerator-runtime');'use strict';

var _isstream = require('isstream');
var _isstream2 = _interopRequireDefault(_isstream);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -148,24 +152,33 @@

if (null != obj) {
var str = void 0;
if (Buffer.isBuffer(obj)) {
res.setHeader('Content-Type', 'application/octet-stream');
res.setHeader('Content-Length', obj.length);
res.end(obj);
} else if ((0, _isstream2.default)(obj)) {
res.setHeader('Content-Type', 'application/octet-stream');
obj.pipe(res);
} else {
var str = void 0;
if ('object' === (typeof obj === 'undefined' ? 'undefined' : _typeof(obj))) {
// we stringify before setting the header
// in case `JSON.stringify` throws and a
// 500 has to be sent instead
if ('object' === (typeof obj === 'undefined' ? 'undefined' : _typeof(obj))) {
// we stringify before setting the header
// in case `JSON.stringify` throws and a
// 500 has to be sent instead
// the `JSON.stringify` call is split into
// two cases as `JSON.stringify` is optimized
// in V8 if called with only one argument
if (DEV) {
str = JSON.stringify(obj, null, 2);
// the `JSON.stringify` call is split into
// two cases as `JSON.stringify` is optimized
// in V8 if called with only one argument
if (DEV) {
str = JSON.stringify(obj, null, 2);
} else {
str = JSON.stringify(obj);
}
res.setHeader('Content-Type', 'application/json');
} else {
str = JSON.stringify(obj);
str = obj;
}
res.setHeader('Content-Type', 'application/json');
} else {
str = obj;
res.setHeader('Content-Length', Buffer.byteLength(str));
res.end(str);
}
res.setHeader('Content-Length', Buffer.byteLength(str));
res.end(str);
} else {

@@ -172,0 +185,0 @@ res.end();

0.4.0 / 2016-06-07
==================
* add support for Buffer and Stream in `send` [@kevin-roark]
0.3.0 / 2016-05-16

@@ -3,0 +8,0 @@ ==================

{
"name": "micro-core",
"version": "0.3.0",
"version": "0.4.0",
"description": "Micro core utilities",

@@ -51,6 +51,7 @@ "main": "dist/index.js",

"babel-regenerator-runtime": "6.5.0",
"isstream": "0.1.2",
"media-typer": "0.3.0",
"raw-body": "2.1.6",
"minimist": "1.2.0"
"minimist": "1.2.0",
"raw-body": "2.1.6"
}
}
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