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

broccoli-asset-rewrite

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-asset-rewrite - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

7

index.js

@@ -119,7 +119,6 @@ var Filter = require('broccoli-filter');

replaceString = match[1].replace(assetPath, replacementPath);
if (this.prepend && this.prepend !== '') {
var removeLeadingSlashRegex = new RegExp('^/?(.*)$');
replaceString = this.prepend + removeLeadingSlashRegex.exec(replaceString)[1];
replaceString = this.prepend + replacementPath;
} else {
replaceString = match[1].replace(assetPath, replacementPath);
}

@@ -126,0 +125,0 @@

{
"name": "broccoli-asset-rewrite",
"version": "1.0.10",
"version": "1.0.11",
"description": "broccoli plugin to rewrite a source tree from an asset map.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -159,46 +159,2 @@ var fs = require('fs');

});
it('maintains fragments', function () {
var sourcePath = 'tests/fixtures/fragments';
var node = new AssetRewrite(sourcePath + '/input', {
assetMap: {
'images/defs.svg': 'images/fingerprinted-defs.svg'
}
});
builder = new broccoli.Builder(node);
return builder.build().then(function (graph) {
confirmOutput(graph.directory, sourcePath + '/output');
});
});
it('maintains fragments with prepend', function () {
var sourcePath = 'tests/fixtures/fragments-prepend';
var node = new AssetRewrite(sourcePath + '/input', {
assetMap: {
'images/defs.svg': 'images/fingerprinted-defs.svg'
},
prepend: 'https://cloudfront.net/'
});
builder = new broccoli.Builder(node);
return builder.build().then(function (graph) {
confirmOutput(graph.directory, sourcePath + '/output');
});
});
it('replaces absolute URLs with prepend', function () {
var sourcePath = 'tests/fixtures/absolute-prepend';
var node = new AssetRewrite(sourcePath + '/input', {
assetMap: {
'my-image.png': 'my-image-fingerprinted.png'
},
prepend: 'https://cloudfront.net/'
});
builder = new broccoli.Builder(node);
return builder.build().then(function (graph) {
confirmOutput(graph.directory, sourcePath + '/output');
});
});
});
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