Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mirror

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mirror - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

26

mirror.js

@@ -17,2 +17,6 @@ var env = process.env.NODE_ENV || 'development';

}
// Make `instanceof Mirror` work and allow recursive embedding.
assets.__proto__ = this;
if (!options) options = {};

@@ -22,4 +26,7 @@

if (!options.type) {
if (assets.length) options.type = path.extname(assets[0]).toLowerCase();
else options.type = '.js';
if (assets.length && !assets[0].join) {
options.type = path.extname(assets[0]).toLowerCase();
} else {
options.type = '.txt';
}
} else if (options.type[0] !== '.') {

@@ -52,8 +59,8 @@ options.type = '.' + options.type.toLowerCase();

this.handler.mirror = this;
this.handler.content = this.content;
return this.handler;
return assets;
};
// Make `instanceof Array` work on return values.
Mirror.prototype.__proto__ = Array.prototype;
Mirror.defaults = {

@@ -90,2 +97,9 @@ maxAge: env === 'production' ? 3600 : 0,

// Allow adding the files "array" as a express callback directly. This is a
// shortcut that only works with express because it calls files.call().
// In new code, use files.handler instead.
Mirror.prototype.call = function(_, req, res, next) {
return this.handler(req, res, next);
};
Mirror.prototype.handler = function(req, res, next) {

@@ -92,0 +106,0 @@ this.content(function(err, data) {

{
"name": "mirror",
"version": "0.3.0",
"version": "0.3.1",
"author": "Development Seed <info@developmentseed.org> (http://www.developmentseed.org)",

@@ -5,0 +5,0 @@ "main": "./mirror",

@@ -31,3 +31,3 @@ var assert = require('assert');

status: 200
}, contentType('application/javascript; charset=utf-8'))
}, contentType('text/plain; charset=utf-8'))
};

@@ -34,0 +34,0 @@

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