Skip to content

Commit

Permalink
Merge pull request #19 from davidchambers/guard
Browse files Browse the repository at this point in the history
simplify null guard
  • Loading branch information
garyb committed Nov 16, 2014
2 parents 2404ac0 + 618fe55 commit 660a4c3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Data/Foreign/Index.purs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ class Index i where
foreign import unsafeReadPropImpl
"""
function unsafeReadPropImpl(f, s, key, value) {
if (value && typeof value === 'object') {
return s(value[key]);
} else {
return f;
}
return value == null ? f : s(value[key]);
}
""" :: forall r k. Fn4 r (Foreign -> r) k Foreign (F Foreign)

Expand Down

0 comments on commit 660a4c3

Please sign in to comment.