Skip to content

Commit

Permalink
Simplify replaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Remon Oldenbeuving committed Jan 12, 2016
1 parent c4e2039 commit 1cb1027
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions transforms/create-element-to-jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ module.exports = function(file, api, options) {
const ReactUtils = require('./utils/ReactUtils')(j);
const encodeJSXTextValue = value =>
value
.replace(new RegExp('(?:<|>)', 'g'), match => {
if (match === '<') {
return '&lt;';
} else {
return '&gt;';
}
});
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');

const convertExpressionToJSXAttributes = (expression) => {
const isReactSpread = expression.type === 'CallExpression' &&
Expand Down

0 comments on commit 1cb1027

Please sign in to comment.