connect-assetmanager
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -31,3 +31,3 @@ /** | ||
// preserve strings so their content doesn't get accidentally minified | ||
css = css.replace(/("([^\\"]|\\.|\\)*")|('([^\\']|\\.|\\)*')/g, function(match) { | ||
css = css.replace(/("([^\\"\n]|\\.|\\)*")|('([^\\'\n]|\\.|\\)*')/g, function(match) { | ||
var quote = match[0]; | ||
@@ -183,2 +183,2 @@ preservedTokens.push(match.slice(1, -1)); | ||
}; | ||
exports.minify = YAHOO.compressor.cssmin; | ||
exports.minify = YAHOO.compressor.cssmin; |
@@ -9,9 +9,16 @@ var fs = require('fs') | ||
, crypto = require('crypto'); | ||
var cache = {}; | ||
module.exports = function assetManager (settings) { | ||
var cache = {} | ||
, settings = {} | ||
, cacheHashes = {} | ||
, cacheTimestamps = {}; | ||
module.exports = function assetManager (assets) { | ||
var self = this; | ||
this.cacheTimestamps = {}; | ||
this.cacheHashes = {}; | ||
settings = assets || settings; | ||
if (!settings) { | ||
throw new Exception('No asset groups found'); | ||
} | ||
if (!settings.forEach) { | ||
@@ -176,3 +183,3 @@ settings.forEach = function(callback) { | ||
} | ||
self.cacheTimestamps[groupName] = lastModified.getTime(); | ||
cacheTimestamps[groupName] = lastModified.getTime(); | ||
if (!cache[groupName]) { | ||
@@ -233,3 +240,3 @@ cache[groupName] = {}; | ||
self.cacheHashes[groupName] = crypto.createHash('md5').update(content).digest('hex'); | ||
cacheHashes[groupName] = crypto.createHash('md5').update(content).digest('hex'); | ||
@@ -309,3 +316,3 @@ cache[groupName][match].contentBuffer = new Buffer(content, 'utf8'); | ||
if (group.route.test(req.url)) { | ||
var userAgent = req.headers['user-agent']; | ||
var userAgent = req.headers['user-agent'] || ''; | ||
groupServed = group; | ||
@@ -361,5 +368,6 @@ if (group.dataType === 'javascript') { | ||
assetManager.cacheTimestamps = this.cacheTimestamps; | ||
assetManager.cacheHashes = this.cacheHashes; | ||
assetManager.cacheTimestamps = cacheTimestamps; | ||
assetManager.cacheHashes = cacheHashes; | ||
return assetManager; | ||
}; |
{ | ||
"name" : "connect-assetmanager", | ||
"description" : "Middleware for Connect (node.js) for handling your static assets.", | ||
"version" : "0.0.24", | ||
"version" : "0.0.25", | ||
"author" : "Mathias Pettersson <mape@mape.me>", | ||
"keywords": ["build", "assets", "css", "javascript"], | ||
"engines" : ["node"], | ||
@@ -7,0 +8,0 @@ "directories" : { "lib" : "./lib" }, |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
36582
834
0
1