Skip to content

Commit

Permalink
Merge branch 'feature/jvanbruegge-key' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizz committed Sep 28, 2017
2 parents 6a48bf8 + 1dbed5e commit 8fe7ea6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ var considerProps = function (data) { return mapObject(data,
}
); };

var considerKey = function (data) { return omit('key', data); };

var sanitizeData = function (data) { return !object(data) ? {} :
considerProps(considerDataAria(deepifyKeys(data))); };
considerProps(considerDataAria(considerKey(deepifyKeys(data)))); };

var sanitizeText = function (children) { return !array(children) || children.length > 1 || !text(children[0]) ? undefined :
children[0]; };
Expand All @@ -196,7 +198,7 @@ var createElement = function (sel, data) {
children: sanitizeChildren(children),
text: sanitizeText(children),
elm: undefined,
key: undefined
key: data ? data.key : undefined
});
};

Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ const considerProps = (data) => fn.mapObject(data,
{ props: { [key]: val } }
)

const considerKey = (data) => fn.omit('key', data)

const sanitizeData = (data) => !is.object(data) ? {} :
considerProps(considerDataAria(fn.deepifyKeys(data)))
considerProps(considerDataAria(considerKey(fn.deepifyKeys(data))))

const sanitizeText = (children) => !is.array(children) || children.length > 1 || !is.text(children[0]) ? undefined :
children[0]
Expand All @@ -57,7 +59,7 @@ export const createElement = (sel, data = {}, ...children) => is.fun(sel) ? sel(
children: sanitizeChildren(children),
text: sanitizeText(children),
elm: undefined,
key: undefined
key: data ? data.key : undefined
})

export default {
Expand Down

0 comments on commit 8fe7ea6

Please sign in to comment.