Commit f79ba556 authored by Christian Hesse's avatar Christian Hesse

global-functions: add $ParseKeyValueStore

parent 16f04ee7
......@@ -226,3 +226,19 @@
}
:return true;
}
# parse key value store
:global ParseKeyValueStore do={
:global CharacterReplace;
:local Source $1;
:if ([ :typeof $Source ] != "array") do={
:set Source [ :tostr $1 ];
}
:local Result [ :toarray "" ];
:foreach KeyValue in=[ :toarray $Source ] do={
:set KeyValue [ :toarray [ $CharacterReplace $KeyValue "=" "," ] ];
:set ($Result->($KeyValue->0)) ($KeyValue->1);
}
:return $Result;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment