manifest-rev
Advanced tools
Comparing version
@@ -29,2 +29,3 @@ module.exports = function(opts) { | ||
if (prop === 'path') return opts.prepend + val; | ||
if (prop === 'integrity') return val === str ? false : val; | ||
output = PROD ? val : false; | ||
@@ -31,0 +32,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.2", | ||
"version": "1.0.3", | ||
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -9,3 +9,7 @@ { | ||
"integrity": "sha256-YEWYfCFP9yc5DAF8K5AtLEyFuKZ1MNw+xQPm8g70LYY=" | ||
}, | ||
"fakescript.js": { | ||
"path": "fakescript-d80c4dea53.js", | ||
"random": "test" | ||
} | ||
} |
@@ -44,5 +44,18 @@ const path = require('path'); | ||
const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json'); | ||
t.is(manifestRev({ manifest })('script.js', 'integrity'), false); | ||
t.is( | ||
manifestRev({ manifest })('script.js', 'integrity'), | ||
'sha256-YEWYfCFP9yc5DAF8K5AtLEyFuKZ1MNw+xQPm8g70LYY=' | ||
); | ||
}); | ||
test('returns output false when manifest invoked with unknown file', t => { | ||
const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json'); | ||
t.is(manifestRev({ manifest })('fakescript.js', 'integrity'), false); | ||
}); | ||
test('returns output false when manifest invoked with unknown property', t => { | ||
const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json'); | ||
t.is(manifestRev({ manifest })('fakescript.js', 'random'), false); | ||
}); | ||
test('returns output of integrity when manifest invoked in PROD with new format', t => { | ||
@@ -49,0 +62,0 @@ const manifest = path.join(__dirname, 'fixtures', 'rev-manifest.json'); |
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
12742
-97.13%11
-8.33%105
-99.06%1
Infinity%