Update array and object convert to value#2634
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2634 +/- ##
==========================================
- Coverage 79.07% 79.07% -0.01%
==========================================
Files 661 661
Lines 51990 51999 +9
Branches 732 732
==========================================
+ Hits 41113 41119 +6
- Misses 10797 10800 +3
Partials 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jmthomas
left a comment
There was a problem hiding this comment.
I looked for other eval usage and it is limited to api_shared and running_script where we need it
| @@ -40,6 +41,8 @@ class String | |||
| HEX_CHECK_REGEX = /\A\s*0[xX][\dabcdefABCDEF]+\s*\z/ | |||
| # Regular expression to identify a String as an Array of numbers | |||
| ARRAY_CHECK_REGEX = /\A\s*\[.*\]\s*\z/ | |||
| # Regular expression to identify a String containing object notation | |||
| OBJECT_CHECK_REGEX = /\A\s*\{.*\}\s*\z/ | |||
There was a problem hiding this comment.
Just checking for { ... }. Is this effectively a check for json? Should we be using JSON.parse?
There was a problem hiding this comment.
JSON.parse is really picky. YAML.safe_load handles single quotes and hex like you would expect.
No description provided.