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

broccoli-babel-transpiler

Package Overview
Dependencies
Maintainers
6
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-babel-transpiler - npm Package Compare versions

Comparing version 5.6.0 to 5.6.1

README.md

35

index.js

@@ -51,5 +51,11 @@ 'use strict';

}
if (this.options.helperWhiteList) {
this.helperWhiteList = this.options.helperWhiteList;
}
// Note, Babel does not support this option so we must save it then
// delete it from the options hash
delete this.options.exportModuleMetadata;
delete this.options.helperWhiteList;

@@ -202,2 +208,10 @@ if (this.options.browserPolyfill) {

if (this.helperWhiteList) {
var invalidHelpers = transpiled.metadata.usedHelpers.filter(function(helper) {
return this.helperWhiteList.indexOf(helper) === -1;
}, this);
validateHelpers(invalidHelpers, relativePath);
}
if (transpiled.metadata && transpiled.metadata.modules) {

@@ -230,2 +244,23 @@ this.moduleMetadata[byImportName(key)] = transpiled.metadata.modules;

function validateHelpers(invalidHelpers, relativePath) {
if (invalidHelpers.length > 0) {
var message = relativePath + ' was transformed and relies on `' + invalidHelpers[0] + '`, which was not included in the helper whitelist. Either add this helper to the whitelist or refactor to not be dependent on this runtime helper.';
if (invalidHelpers.length > 1) {
var helpers = invalidHelpers.map(function(item, i) {
if (i === invalidHelpers.length - 1) {
return '& `' + item;
} else if (i === invalidHelpers.length - 2) {
return item + '`, ';
}
return item + '`, `';
}).join('');
message = relativePath + ' was transformed and relies on `' + helpers + '`, which were not included in the helper whitelist. Either add these helpers to the whitelist or refactor to not be dependent on these runtime helper.';
}
throw new Error(message);
}
}
module.exports = Babel;

2

package.json
{
"name": "broccoli-babel-transpiler",
"version": "5.6.0",
"version": "5.6.1",
"description": "A Broccoli plugin which transpile ES6 to readable ES5 by using babel.",

@@ -5,0 +5,0 @@ "main": "index.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