Subject: | Delimeters getting escaped twice |
Hi,
In the following scenario, I am getting delimeters escaped twice:
my $struct = {
property1 => {
'prometheus.io/port' => '1234',
},
};
my $flattened = Hash::Flatten->new({
ArrayDelimeter => '.',
HashDelimeter => '.',
EscapeSequence => '#-#ESCAPE#-#',
})->flatten($struct);
say Dumper($struct);
This outputs:
{
'property1.prometheus#-#ESCAPE#-##-#ESCAPE#-#.io/port' => '1234'
};
While what I was expecting is:
{
'property1.prometheus#-#ESCAPE#-#.io/port' => '1234'
};
The docs say about EscapeSequence:
"The escaping strategy is to place the escape sequence in front of delimiter sequences; the escape sequence itself is escaped by replacing it with two instances."
Judging by this, the behavior I was expecting is to get the delimeter escaped exactly once.
Is this behavior I am encountering deliberate?
Thanks in advance,
Oriol.