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

distribution-express

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distribution-express - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

45

lib/index.js

@@ -1,2 +0,2 @@

// Generated by CoffeeScript 1.6.2
// Generated by CoffeeScript 1.6.3
var fs, parseFile, watchFile;

@@ -12,5 +12,8 @@

* @param {String} options.map Config filename, default 'distribution.json'
* @param {Boolean} options.watch Watch changes in config file, default 'false' in production environment
* @param {Function} options.log Function for logging, set to 'false' to desable logging
* @param {Function} options.error Function for logging errors, set to 'false' to desable logging
* @param {Boolean} options.watch Watch changes in config file,
* default 'false' in production environment
* @param {Function} options.log Function for logging,
* set to 'false' to desable logging
* @param {Function} options.error Function for logging errors,
* set to 'false' to desable logging
* @throws {Error|SyntaxError} Error reading file or parsing content

@@ -22,17 +25,16 @@ *

module.exports = function(options) {
var assets, _ref, _ref1, _ref2, _ref3;
var assets;
if (options == null) {
options = {};
}
if ((_ref = options.watch) == null) {
if (options.watch == null) {
options.watch = process.env.NODE_ENV !== 'production';
}
if ((_ref1 = options.map) == null) {
if (options.map == null) {
options.map = 'distribution.json';
}
if ((_ref2 = options.log) == null) {
if (options.log == null) {
options.log = console.log;
}
if ((_ref3 = options.error) == null) {
if (options.error == null) {
options.error = console.error;

@@ -44,3 +46,2 @@ }

var err;
try {

@@ -59,12 +60,17 @@ assets = parseFile(options.map);

}
return function(key) {
var asset;
asset = assets[key];
if (asset == null) {
if (options.error != null) {
options.error("asset '" + key + "' not found");
return {
helper: function(key) {
var asset;
asset = assets[key];
if (asset == null) {
if (options.error != null) {
options.error("asset '" + key + "' not found");
}
return key;
}
return asset;
},
map: function() {
return assets || {};
}
return asset || '';
};

@@ -104,3 +110,2 @@ };

var timeout;
timeout = null;

@@ -107,0 +112,0 @@ return fs.watch(filename, function(event) {

{
"name": "distribution-express",
"description": "Asset manager",
"version": "0.0.1",
"description": "'Distribution' asset manager express helper",
"version": "0.0.2",
"author": "Eugeny Vlasenko <mahnunchik@gmail.com>",
"main": "./lib/index.js",
"main": "./lib/",
"engines": {

@@ -8,0 +8,0 @@ "node": ">= 0.8.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