UNPKG

react-magnetic-di

Version:
8 lines (7 loc) 419 B
var processReference = function processReference(t, ref) { var container = ref.parentPath.container; if (container.type !== 'VariableDeclarator') return; var containerID = container.id; ref.getStatementParent().insertAfter(t.expressionStatement(t.assignmentExpression('=', t.memberExpression(containerID, t.identifier('displayName')), t.stringLiteral(containerID.name)))); }; module.exports = processReference;