manifest-rev
Advanced tools
Comparing version
@@ -1,4 +0,4 @@ | ||
const PROD = process.env.NODE_ENV === 'production'; | ||
module.exports = function(opts) { | ||
const PROD = process.env.NODE_ENV === 'production'; | ||
module.exports = function(opts) { | ||
if (typeof opts !== 'object') { | ||
@@ -32,3 +32,4 @@ throw new TypeError('`options` argument required'); | ||
const val = String((manifest[str] && manifest[str][prop]) || str); | ||
output = prop === 'path' ? opts.prepend + val : val; | ||
if (prop === 'path') return opts.prepend + val; | ||
output = PROD ? val : false; | ||
} | ||
@@ -35,0 +36,0 @@ } catch (err) {} |
{ | ||
"name": "manifest-rev", | ||
"description": "Dynamically load assets into your views, emails, etc. from your `rev-manifest.json` manifest revision file", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -78,6 +78,3 @@ const path = require('path'); | ||
const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json'); | ||
t.is( | ||
manifestRev({ manifest })('script.js', 'integrity'), | ||
'sha256-YEWYfCFP9yc5DAF8K5AtLEyFuKZ1MNw+xQPm8g70LYY=' | ||
); | ||
t.is(manifestRev({ manifest })('script.js', 'integrity'), false); | ||
}); | ||
@@ -84,0 +81,0 @@ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
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
445200
3102.65%12
9.09%11265
8306.72%