code formatting

This commit is contained in:
Antonino Porcino 2016-07-09 10:19:44 +02:00
parent 6af5715ea1
commit 854293c589
1 changed files with 8 additions and 8 deletions

View File

@ -88,7 +88,7 @@ function getOptions(options) {
}
function reactImport(options) {
if (options.native) {
if (options.native) {
return reactNativeSupport[options.nativeTargetVersion].react.module;
}
if (_.includes(['0.14.0', '0.15.0', '15.0.0', '15.0.1'], options.targetVersion)) {
@ -295,7 +295,7 @@ function hasNonSimpleChildren(node) {
}
/**
* Trims a string the same way as String.prototype.trim(), but preserving all non breaking spaces ('\xA0')
* Trims a string the same way as String.prototype.trim(), but preserving all non breaking spaces ('\xA0')
* @param {string} text
* @return {string}
*/
@ -385,10 +385,10 @@ function convertHtmlToReact(node, context) {
}
}
}
if (node.name === virtualNode) {
const invalidAttributes = _.without(_.keys(node.attribs), scopeAttr, ifAttr, repeatAttr);
if (invalidAttributes.length > 0) {
if (node.name === virtualNode) {
const invalidAttributes = _.without(_.keys(node.attribs), scopeAttr, ifAttr, repeatAttr);
if (invalidAttributes.length > 0) {
throw RTCodeError.build(context, node, "<rt-virtual> may not contain attributes other than 'rt-scope', 'rt-if' and 'rt-repeat'");
}
@ -396,8 +396,8 @@ function convertHtmlToReact(node, context) {
if (node.children.length > 1) {
_(node.children)
.reject('attribs.key')
.forEach((child, i) => {
if (child.type === 'tag' && child.name !== virtualNode) {
.forEach((child, i) => {
if (child.type === 'tag' && child.name !== virtualNode) {
_.set(child, ['attribs', 'key'], `${node.startIndex}${i}`);
}
});