Skip to content

Commit

Permalink
fix: fix throw error (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
HsuTing authored and gajus committed Jun 21, 2019
1 parent d8a3729 commit 7969ef9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rules/noDupeKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ const create = (context) => {

const builObjectStructure = (properties) => {
return _.map(properties, (property) => {
const element = analizeElement(property.value);
const element = analizeElement(
property.type === 'ObjectTypeSpreadProperty' ?
property.argument :
property.value
);

return {
...element,
Expand Down
3 changes: 3 additions & 0 deletions tests/rules/assertions/noDupeKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ export default {
},
{
code: 'var a = 1; var b = 1; type f = { get(key: a): string, get(key: b): string }'
},
{
code: 'type a = { b: <C>(config: { ...C, key: string}) => C }'
}
]
};

0 comments on commit 7969ef9

Please sign in to comment.