Skip to content

Commit

Permalink
convert to old fashioned javascript from the 1940s
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 23, 2017
1 parent 0fb06a7 commit 4967963
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions index.js
@@ -1,10 +1,11 @@
const error = key => new Error(`Object does not contain ${key}`)
module.exports = object => new Proxy(object, {
get: (object, key) => {
if (key in object) {
return object[key]
} else {
throw error(key)
module.exports = function (object) {
return new Proxy(object, {
get: function (object, key) {
if (key in object) {
return object[key]
} else {
throw new Error('Object does not contain ' + key)
}
}
}
})
})
}

0 comments on commit 4967963

Please sign in to comment.