{"version":3,"file":"stringUtils.mjs","names":["_","stringToProps","stringProperties","Error","configObject","configArray","JSON","parse","fromPairs","map","item","key","camelCase","Key","value","has","Value","error","message","attributes"],"sources":["../../src/utilities/stringUtils.js"],"sourcesContent":["import _ from 'lodash-es';\n\n/**\n * stringToProps\n *\n * @export\n * @param {*} stringProperties\n * @return {*}\n */\nexport function stringToProps(stringProperties) {\n  if (!stringProperties) {\n    throw new Error('No properties found');\n  }\n\n  let configObject = {};\n\n  try {\n    // Parse the JSON string into an array of objects\n    const configArray = JSON.parse(stringProperties);\n\n    configObject = _.fromPairs(\n      configArray.map((item) => {\n        // Normalize the key to camelCase, regardless of its original casing\n        const key = _.camelCase(item.key || item.Key);\n        const value = _.has(item, 'Value') ? item.Value : item.value || '';\n        return [key, value];\n      })\n    );\n  } catch (error) {\n    return { error: error.message };\n  }\n\n  return { attributes: configObject };\n}\n"],"mappings":";;;;;;;;;AASA,SAAgBC,cAAcC,kBAAkB;AAC9C,KAAI,CAACA,iBACH,OAAM,IAAIC,MAAM,sBAAsB;CAGxC,IAAIC,eAAe,EAAE;AAErB,KAAI;EAEF,MAAMC,cAAcC,KAAKC,MAAML,iBAAiB;AAEhDE,iBAAeJ,EAAEQ,UACfH,YAAYI,KAAKC,SAAS;AAIxB,UAAO,CAFKV,EAAEY,UAAUF,KAAKC,OAAOD,KAAKG,IAAI,EAC/Bb,EAAEe,IAAIL,MAAM,QAAQ,GAAGA,KAAKM,QAAQN,KAAKI,SAAS,GAC7C;IAEvB,CAAC;UACMG,OAAO;AACd,SAAO,EAAEA,OAAOA,MAAMC,SAAS;;AAGjC,QAAO,EAAEC,YAAYf,cAAc"}