Last active
July 18, 2016 09:06
-
-
Save rubeniskov/912ec55240f51770e68576f62dd62f90 to your computer and use it in GitHub Desktop.
Javascript function property descriptor detection
This file contains hidden or 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
function detectPropertyDescriptor(descriptor){ | |
var keys = Object.keys(descriptor).join(' '); | |
return (/(configureable|enumerable)/).test(keys) && (/(set|get)|(value)/).test(keys); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment