Skip to content

Commit

Permalink
allow set value of property to be undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 23, 2017
1 parent 3577f9f commit ebfef17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
@@ -1 +1 @@
module.exports = (object, defaultValue) => new Proxy(object, {get: (object, key) => typeof object[key] == 'undefined' ? defaultValue : object[key]})
module.exports = (object, defaultValue) => new Proxy(object, {get: (object, key) => key in object ? object[key] : defaultValue})

0 comments on commit ebfef17

Please sign in to comment.