Created
April 2, 2017 05:31
-
-
Save devsnek/c32baa4013aa926b8f0c3947387aefc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handler = { | |
get: (target, name) => { | |
if (name === 'toString') return () => target.path.join('/').toLowerCase(); | |
const x = { path: target.path.concat(name) }; | |
return new Proxy(x, handler); | |
} | |
} | |
const bored = new Proxy({ path: [''] }, handler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment