You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an object has a property called foo, you can reference it using dot notation, i.e. obj.foo. But if the property is called something like yar-bar then you have to quote it and use array notation, i.e. obj["yar-bar"]. The regex determines which kind of property it is (in 99% of cases, at least — it's possible to have certain other characters in a dot notation property, but it's costly to figure out so devalue errs on the side of caution), and safeProp returns a string like .foo or ["yar-bar"] that can be appended to obj. Hope this clarifies!
Could you elaborate what is the purpose of the safeProps function and what it the regex for?
The text was updated successfully, but these errors were encountered: