UNPKG

react-magnetic-di

Version:
10 lines (8 loc) 434 B
"use strict"; 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;