Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-manifest

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-manifest - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

12

index.js

@@ -9,2 +9,3 @@ "use strict";

slash = require('slash'),
minimatch = require('minimatch'),
lineBreak = '\n';

@@ -20,2 +21,3 @@

var hasher = crypto.createHash('sha256');
var prefixCache = options.prefixCache || '';

@@ -43,7 +45,9 @@ if (options.timestamp) {

if (exclude.indexOf(file.relative) >= 0) {
return;
}
for (var i = 0; i < exclude.length; i++) {
if(minimatch(file.relative, exclude[i])){
return;
}
}
contents.push(encodeURI(slash(file.relative)));
contents.push(encodeURI(slash(prefixCache + file.relative)));

@@ -50,0 +54,0 @@ if (options.hash) {

{
"name": "gulp-manifest",
"version": "0.0.6",
"version": "0.0.7",
"description": "Generate HTML5 Cache Manifest files",

@@ -31,4 +31,5 @@ "main": "index.js",

"gulp-util": "~2.2.6",
"slash": "^0.1.1"
"slash": "^0.1.1",
"minimatch": "~2.0.1"
}
}

@@ -90,3 +90,3 @@ # gulp-manifest

preferOnline: true,
network: ['http://*', 'https://*', '*'],
network: ['*'],
filename: 'app.manifest',

@@ -113,4 +113,2 @@ exclude: 'app.manifest'

NETWORK:
http://*
https://*
*

@@ -117,0 +115,0 @@

@@ -19,3 +19,8 @@ var fs = require('fs'),

describe('gulp-manifest', function() {
var fileNames = ['file1.js', 'file2.js', 'file3.js', 'file4.js'];
var fileNames = ['file1.js', 'file2.js', 'file3.js', 'file4.js',
'exclude/exclude1.js','exclude/exclude2.js',
'exclude/children1/exclude3.js',
'children2/include1.js','children2/exclude4.js',
'children2/children3/include2.js','children2/children3/exclude5.js'
];
var fakeFiles = fileNames.map(createFakeFile);

@@ -124,2 +129,34 @@

});
it('Should exclude special files', function(done) {
var stream = manifestPlugin({
filename: 'cache.manifest',
exclude: ['file2.js','exclude/**',"children2/**/exclude*.js"],
hash: true,
network: ['http://*', 'https://*', '*'],
preferOnline: true
});
stream.on('data', function(data) {
data.should.be.an.instanceOf(gutil.File);
data.relative.should.eql('cache.manifest');
var contents = data.contents.toString();
contents.should.startWith('CACHE MANIFEST');
contents.should.contain('CACHE:');
contents.should.contain('file1.js');
contents.should.not.contain('file2.js');
contents.should.contain('file3.js');
contents.should.contain('file4.js');
contents.should.contain('# hash: ');
contents.should.not.contain('exclude');
contents.should.contain('include1.js');
contents.should.contain('include2.js');
});
stream.once('end', done);
fakeFiles.forEach(stream.write.bind(stream));
stream.end();
});
});
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