Skip to content

Instantly share code, notes, and snippets.

View gist:a73b4e9eeca1f633da38
function forEachTransform (babel) {
var t = babel.types;
return new babel.Transformer('plugin-foreach', {
CallExpression: function (node, parent) {
var callee = node.callee;
if (callee.property.name === 'forEach') {
var arrayName = callee.object.name;