79634982

Date: 2025-05-23 06:56:51
Score: 0.5
Natty:
Report link

Here you go, I had to solve a similar problem... Credit to @andrew-coleman for the initial example

(
    $dotsToUnderscores := $each(?, function($v, $k) {
        { 
            $replace($k, '.', '_'): $type($v) = 'object' ? $dotsToUnderscores($v) : 
                                    $type($v) = 'array'  ? $map($v, function($vv) { $dotsToUnderscores($vv) } : 
                                    $v
        }
    }) ~> $merge;
    $dotsToUnderscores($)
)
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @andrew-coleman
Posted by: NeilC