DOMPurify - a DOM-only, super-fast, uber-tolerant XSS sanitizer for HTML, MathML and SVG. DOMPurify works with a secure default, but offers a lot of configurability and hooks. Demo:
The getOwnPropertyDescriptor static method returns an object describing the configuration of a specific property on a given object (that is, one directly present on an object and not in the object's prototype chain).
My understanding is that getOwnPropertyDescriptor within the cleanArray and clone functions is simply used to validate that the property exists. (Instead, the lookupGetter function actually uses the descriptor)
Therefore, I thought it would be more appropriate to utilize the hasOwnProperty function for the purpose of determining if a property exists. (Returns a boolean that suits our intent.)
Summary
@cure53 👋
The getOwnPropertyDescriptor static method returns an object describing the configuration of a specific property on a given object (that is, one directly present on an object and not in the object's prototype chain).
My understanding is that
getOwnPropertyDescriptor
within thecleanArray
andclone
functions is simply used to validate that the property exists. (Instead, thelookupGetter
function actually uses the descriptor)Therefore, I thought it would be more appropriate to utilize the hasOwnProperty function for the purpose of determining if a property exists. (Returns a
boolean
that suits our intent.)