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

broccoli-asset-rev

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-asset-rev - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

1

lib/asset-rev.js

@@ -23,2 +23,3 @@ var Fingerprint = require('./fingerprint');

exclude: options.fingerprintExclude || [],
generateRailsManifest: options.generateRailsManifest
description: options.description

@@ -25,0 +26,0 @@ });

@@ -20,2 +20,3 @@ var fs = require('fs');

this.description = options.description;
this.generateRailsManifest = options.generateRailsManifest;
}

@@ -70,2 +71,38 @@

Fingerprint.prototype.writeRailsManifest = function(destDir) {
var assetRegex = /^assets\//,
digestRegex = /-([0-9a-f]+)\.\w+$/,
assetMap = {},
files = {};
for (var key in this.assetMap) {
if (assetRegex.test(key)) {
var fingerprintedPath = this.assetMap[key],
assetlessKey = key.replace(assetRegex, ''),
assetlessFingerprintedPath = fingerprintedPath.replace(assetRegex, ''),
stats = fs.statSync(destDir + '/' + fingerprintedPath);
files[assetlessFingerprintedPath] = {
mtime: stats.mtime,
logical_path: assetlessKey,
digest: fingerprintedPath.match(digestRegex)[1],
size: stats.size
}
assetMap[assetlessKey] = assetlessFingerprintedPath;
}
}
var assets = { assets: assetMap, files: files };
fs.writeFileSync(destDir + '/assets/manifest.json', JSON.stringify(assets));
};
Fingerprint.prototype.write = function(readTree, destDir) {
var self = this;
return Filter.prototype.write.apply(this, arguments).then(function() {
if (!!self.generateRailsManifest) {
self.writeRailsManifest(destDir);
}
});
};
module.exports = Fingerprint;

2

package.json
{
"name": "broccoli-asset-rev",
"version": "0.0.6",
"version": "0.0.7",
"description": "broccoli asset revisions (fingerprint)",

@@ -5,0 +5,0 @@ "main": "lib/asset-rev.js",

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