You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

manifest-rev

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

manifest-rev - npm Package Compare versions

Comparing version

to
1.0.3

1

index.js

@@ -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) {}

2

package.json
{
"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');