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

hashly

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hashly - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

36

lib/hashly.js

@@ -206,17 +206,21 @@ "use strict";

var processFilter = function (filter) {
if (!filter) {
var unixifyPath = function (filePath) {
return filePath.replace(/\\/g, "/");
};
var processFilter = function (filters, baseDir) {
if (!filters) {
return null;
}
var filters = filter.split(",").map(function (s) {
return s.trim();
});
if (typeof filters == "string") {
filters = [filters];
}
return function (filePath) {
var relativeFilePath = path.relative(baseDir, filePath);
for (var i = 0; i < filters.length; i++) {
if (filters[i].indexOf("*") < 0) {
if (filePath.toLowerCase().indexOf(filters[i]) >= 0) {
return true;
}
} else if (minimatch(path.basename(filePath), filters[i])) {
if (minimatch(unixifyPath(relativeFilePath), unixifyPath(filters[i]))) {
return true;

@@ -229,3 +233,3 @@ }

var initOptions = function (options) {
var initOptions = function (options, baseDir) {
// Store global options.

@@ -236,4 +240,4 @@ // This is to prevent having to pass around data for cross-cutting concerns (i.e. logging)

var includeFilters = processFilter(_options.include);
var excludeFilters = processFilter(_options.exclude);
var includeFilters = processFilter(_options.include, baseDir);
var excludeFilters = processFilter(_options.exclude, baseDir);

@@ -277,3 +281,3 @@ _options.shouldBeExcluded = function (filePath) {

initOptions(options);
initOptions(options, baseDir);

@@ -394,3 +398,3 @@ if (!fsutil.existsSync(baseDir)) {

initOptions(options);
initOptions(options, directory);

@@ -417,3 +421,3 @@ var serializer = serializerFactory.getSerializer(options.manifestFormat);

initOptions(options);
initOptions(options, directory);

@@ -420,0 +424,0 @@ var serializer = serializerFactory.getSerializer(options.manifestFormat);

{
"name": "hashly",
"version": "0.3.1",
"version": "0.4.0",
"description": "Renames static files with a hashcode for cache busting",

@@ -5,0 +5,0 @@ "directories": {

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